jennifer1978bgf
jennifer1978bgf's avatar

Info

Username:jennifer1978bgf
Name:jennifer1978bgf
Member since: 22 Jan 2023

About

None

Signature

None

Last Forum Posts

@How to apply multiple currencies by one cBot?:  25 Jan 2023, 08:19


firemyst said:

You haven't updated the code in all the required places, and are still using Symbol.Ask in places you shouldn't be.

:-)

@How to apply multiple currencies by one cBot?:  25 Jan 2023, 08:15


PanagiotisChar said:

Hi there,

See below

            PlaceLimitOrder(TradeType.Buy, symbol_1, Vol, symbol_1.Ask - 15 * Symbol.PipSize, "BU", 30, 15);
            PlaceLimitOrder(TradeType.Buy, symbol_2, Vol, symbol_2.Ask - 15 * Symbol.PipSize, "BE", 30, 15);           
            PlaceLimitOrder(TradeType.Buy, symbol_3, Vol, symbol_3.Ask - 15 * Symbol.PipSize, "BG", 30, 15);           

Aieden Technologies

Need help? Join us on Telegram

Need premium support? Trade with us

@How to apply multiple currencies by one cBot?:  25 Jan 2023, 08:10


jennifer1978bgf said:

firemyst said:

How about posting your updated code?

using System;
using System.Linq;
using cAlgo.API;
using cAlgo.API.Indicators;
using cAlgo.API.Internals;
using cAlgo.Indicators;
namespace cAlgo
{
    [Robot(TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)]
    public class UnderTest2 : Robot
    {
        [Parameter(DefaultValue = "USDJPY")]
        public string symbol_1 { get; set; }
        
        [Parameter(DefaultValue = "EURUSD")]
        public string symbol_2 { get; set; }
        
        [Parameter(DefaultValue = "GBPUSD")]
        public string symbol_3 { get; set; }

        [Parameter("Vol", DefaultValue = 10000)]
        public int Vol { get; set; }
        
        public double targetPrice_1 { get; set; }
        public double targetPrice_2 { get; set; }
        public double targetPrice_3 { get; set; }
        
        ///////////////////////////////////////////////////////////////////////////////////////////////

        protected override void OnStart()
        {
            Symbol symbol_1 = MarketData.GetSymbol("USDJPY");
            Symbol symbol_2 = MarketData.GetSymbol("EURUSD");
            Symbol symbol_3 = MarketData.GetSymbol("GBPUSD");

            var result =

            PlaceLimitOrder(TradeType.Buy, symbol_1, Vol, Symbol.Ask - 15 * symbol_1.PipSize, "BU", 30, 15);
            PlaceLimitOrder(TradeType.Buy, symbol_2, Vol, Symbol.Ask - 15 * symbol_2.PipSize, "BE", 30, 15);
            PlaceLimitOrder(TradeType.Buy, symbol_3, Vol, Symbol.Ask - 15 * symbol_3.PipSize, "BG", 30, 15);

            if (!result.IsSuccessful) Print("Error: ", result.Error);
             Stop();
        }
    }
}

@How to apply multiple currencies by one cBot?:  25 Jan 2023, 08:09


firemyst said:

How about posting your updated code?

@How to apply multiple currencies by one cBot?:  25 Jan 2023, 07:07


jennifer1978bgf said:

firemyst said:

jennifer1978bgf said:

How to apply multiple currencies by one cBot?

I have tried the code below, even different currencies get opened, the price is not correct.

Can someone help?


        [Parameter("Vol", DefaultValue = 10000)]
        public int Vol { get; set; }

        protected override void OnStart()
        {
            Symbol symbol_1 = MarketData.GetSymbol("USDJPY");
            Symbol symbol_2 = MarketData.GetSymbol("EURUSD");
            Symbol symbol_3 = MarketData.GetSymbol("GBPUSD");

            var result =

            PlaceLimitOrder(TradeType.Buy, symbol_1, Vol, Symbol.Ask - 15 * Symbol.PipSize, "BU", 30, 15);
            PlaceLimitOrder(TradeType.Buy, symbol_2, Vol, Symbol.Ask - 15 * Symbol.PipSize, "BE", 30, 15);           
            PlaceLimitOrder(TradeType.Buy, symbol_3, Vol, Symbol.Ask - 15 * Symbol.PipSize, "BG", 30, 15);           

            if (!result.IsSuccessful) Print("Error: ", result.Error);
             Stop();
        }
    }
}

one of your issues is for each of those, you're using the chart's current symbol to get the ask and pipsize, not the currency you want.

Symbol.Ask gets the charts current symbol's asking price.

If you want the asking price of USDJPY for example, with your code you have to use symbol_1.Ask and symbol_1.PipSize

@How to apply multiple currencies by one cBot?:  25 Jan 2023, 07:05


firemyst said:

jennifer1978bgf said:

How to apply multiple currencies by one cBot?

I have tried the code below, even different currencies get opened, the price is not correct.

Can someone help?


        [Parameter("Vol", DefaultValue = 10000)]
        public int Vol { get; set; }

        protected override void OnStart()
        {
            Symbol symbol_1 = MarketData.GetSymbol("USDJPY");
            Symbol symbol_2 = MarketData.GetSymbol("EURUSD");
            Symbol symbol_3 = MarketData.GetSymbol("GBPUSD");

            var result =

            PlaceLimitOrder(TradeType.Buy, symbol_1, Vol, Symbol.Ask - 15 * Symbol.PipSize, "BU", 30, 15);
            PlaceLimitOrder(TradeType.Buy, symbol_2, Vol, Symbol.Ask - 15 * Symbol.PipSize, "BE", 30, 15);           
            PlaceLimitOrder(TradeType.Buy, symbol_3, Vol, Symbol.Ask - 15 * Symbol.PipSize, "BG", 30, 15);           

            if (!result.IsSuccessful) Print("Error: ", result.Error);
             Stop();
        }
    }
}

one of your issues is for each of those, you're using the chart's current symbol to get the ask and pipsize, not the currency you want.

Symbol.Ask gets the charts current symbol's asking price.

If you want the asking price of USDJPY for example, with your code you have to use symbol_1.Ask and symbol_1.PipSize

@How to apply multiple currencies by one cBot?:  24 Jan 2023, 20:01


PanagiotisChar said:

Hi there,

See below

            PlaceLimitOrder(TradeType.Buy, symbol_1, Vol, symbol_1.Ask - 15 * Symbol.PipSize, "BU", 30, 15);
            PlaceLimitOrder(TradeType.Buy, symbol_2, Vol, symbol_2.Ask - 15 * Symbol.PipSize, "BE", 30, 15);           
            PlaceLimitOrder(TradeType.Buy, symbol_3, Vol, symbol_3.Ask - 15 * Symbol.PipSize, "BG", 30, 15);           

Aieden Technologies

Need help? Join us on Telegram

Need premium support? Trade with us

using System;
using System.Linq;
using cAlgo.API;
using cAlgo.API.Indicators;
using cAlgo.API.Internals;
using cAlgo.Indicators;
namespace cAlgo
{
    [Robot(TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)]
    public class UnderTest2 : Robot
    {
        [Parameter(DefaultValue = "USDJPY")]
        public string symbol_1 { get; set; }
        
        [Parameter(DefaultValue = "EURUSD")]
        public string symbol_2 { get; set; }
        
        [Parameter(DefaultValue = "GBPUSD")]
        public string symbol_3 { get; set; }
  
        [Parameter("Vol", DefaultValue = 10000)]
        public int Vol { get; set; }
        
        public double targetPrice_1 { get; set; }
        public double targetPrice_2 { get; set; }
        public double targetPrice_3 { get; set; }
        
        ///////////////////////////////////////////////////////////////////////////////////////////////

        protected override void OnStart()
        {
            Symbol symbol_1 = MarketData.GetSymbol("USDJPY");
            Symbol symbol_2 = MarketData.GetSymbol("EURUSD");
            Symbol symbol_3 = MarketData.GetSymbol("GBPUSD");

            var result =

            PlaceLimitOrder(TradeType.Buy, symbol_1, Vol, Symbol.Ask - 15 * Symbol.PipSize, "BU", 30, 15);
            PlaceLimitOrder(TradeType.Buy, symbol_2, Vol, Symbol.Ask - 15 * Symbol.PipSize, "BE", 30, 15);  
            PlaceLimitOrder(TradeType.Buy, symbol_3, Vol, Symbol.Ask - 15 * Symbol.PipSize, "BG", 30, 15);         

            if (!result.IsSuccessful) Print("Error: ", result.Error);
             Stop();
        }
    }
}

@How to apply multiple currencies by one cBot?:  23 Jan 2023, 15:16


PanagiotisChar said:

Hi there,

What do you expect this code to do and what does it do instead? I don't understand why do you use the current symbol's Ask price as a target price.

Aieden Technologies

Need help? Join us on Telegram

Need premium support? Trade with us

@How to apply multiple currencies by one cBot?:  22 Jan 2023, 05:40


How to apply multiple currencies by one cBot?

I have tried the code below, even different currencies get opened, the price is not correct.

Can someone help?


        [Parameter("Vol", DefaultValue = 10000)]
        public int Vol { get; set; }

        protected override void OnStart()
        {
            Symbol symbol_1 = MarketData.GetSymbol("USDJPY");
            Symbol symbol_2 = MarketData.GetSymbol("EURUSD");
            Symbol symbol_3 = MarketData.GetSymbol("GBPUSD");

            var result =

            PlaceLimitOrder(TradeType.Buy, symbol_1, Vol, Symbol.Ask - 15 * Symbol.PipSize, "BU", 30, 15);
            PlaceLimitOrder(TradeType.Buy, symbol_2, Vol, Symbol.Ask - 15 * Symbol.PipSize, "BE", 30, 15);           
            PlaceLimitOrder(TradeType.Buy, symbol_3, Vol, Symbol.Ask - 15 * Symbol.PipSize, "BG", 30, 15);           

            if (!result.IsSuccessful) Print("Error: ", result.Error);
             Stop();
        }
    }
}

@How to apply multiple currencies by one cBot?:  22 Jan 2023, 05:30


Dear Spotware,

How to apply multiple currencies by one cBot?

I have tried the code below, even different currencies get opened, the price is not correct.

Can someone help?


        [Parameter("Vol", DefaultValue = 10000)]
        public int Vol { get; set; }

        protected override void OnStart()
        {
            Symbol symbol_1 = MarketData.GetSymbol("USDJPY");
            Symbol symbol_2 = MarketData.GetSymbol("EURUSD");
            Symbol symbol_3 = MarketData.GetSymbol("GBPUSD");

            var result =

            PlaceLimitOrder(TradeType.Buy, symbol_1, Vol, Symbol.Ask - 15 * Symbol.PipSize, "BU", 30, 15);
            PlaceLimitOrder(TradeType.Buy, symbol_2, Vol, Symbol.Ask - 15 * Symbol.PipSize, "BE", 30, 15);           
            PlaceLimitOrder(TradeType.Buy, symbol_3, Vol, Symbol.Ask - 15 * Symbol.PipSize, "BG", 30, 15);           

            if (!result.IsSuccessful) Print("Error: ", result.Error);
             Stop();
        }
    }
}

Notification Publishing copyrighted material is strictly prohibited. If you believe there is copyrighted material in this section you may use the Copyright Infringement Notification form to submit a claim.

No uploaded.

Warning! Executing cBots downloaded from this section may result in loss of funds. Use them at your own risk.

No uploaded.