Hello, i can't get my cbot to only trade buy positions after sell positions in order --- for example.
I'm trying to get this
Buy,sell,buy,sell,buy,sell
And to only open buy positions if the last order was a sell position and to only open sell positions if the last order was a buy position.
I want to stop it from opening a buy order after the last order was already a buy order for example.
I don’t want this
Buy,buy,buy,buy,buy
So far i have:
[Parameter("TradeDirectionBuy", DefaultValue = true)]
public bool TradeDirectionBuy { get; set; }
[Parameter("TradeDirectionSell", DefaultValue = true)]
public bool TradeDirectionSell { get; set; }
and then for my order execution i have:
if (TradeDirectionSell == true);
ExecuteMarketOrder(TradeType.Buy, Symbol.Name, volumne, "DragonStochastic1", StopLoss, TakeProfit);
if (TradeDirectionBuy == true);
ExecuteMarketOrder(TradeType.Sell, Symbol.Name, volumne, "DragonStochastic1", StopLoss, TakeProfit);
Any help would be much appreciated.