2 options to open a trade type..

Created at 12 May 2018, 23:52
How’s your experience with the cTrader Platform?
Your feedback is crucial to cTrader's development. Please take a few seconds to share your opinion and help us improve your trading experience. Thanks!
JE

jelle2500

Joined 25.11.2017

2 options to open a trade type..
12 May 2018, 23:52


hello,

i have 2 options to open a Buy trade.

i also have 2 options to open a sell trade.

i've put my rules into a private bool so i have 4 bools..

 

how it is now:

  protected override void OnBar()

                var AllowBuy1 = AllowBuyTrade1();
                var AllowBuy2 = AllowBuyTrade2();

                var AllowSell1 = AllowSellTrade1();
                var AllowSell2 = AllowSellTrade2();

 

  if (AllowBuy1 == true  (to open a buy trade)

(execute market order bla bla bla)

 

else if (AllowSell1 == true (to open a sell trade)

(execute market order bla bla bla)

 

so i would like to get this:

allowbuy1 == true 'or' allowbuy2 == true (to open a buy trade)

allowsell1 == true 'or' allowsell2 == true (to open a sell trade)

 


@jelle2500
Replies

PanagiotisCharalampous
14 May 2018, 09:44

Hi jelle2500,

See below

if(AllowBuy1 || AllowBuy2)
{
// Execute Buy Order
}
if(AllowSell1 || AllowSell2)
{
// Execute Sell Order
}

Let me know if this is what you are looking for.

Best Regards,

Panagiotis


@PanagiotisCharalampous

jelle2500
14 May 2018, 09:49

RE:

Panagiotis Charalampous said:

Hi jelle2500,

See below

if(AllowBuy1 || AllowBuy2)
{
// Execute Buy Order
}
if(AllowSell1 || AllowSell2)
{
// Execute Sell Order
}

Let me know if this is what you are looking for.

Best Regards,

Panagiotis

Perfect! thanks a lot Panagiotis!

 


@jelle2500