I want my code to do different things when SetStopLoss() or SetTakeProfit() gets filled. I've declared my entry order as a variable and I can access that order in OnOrderUpdate, but i don't know which OrderState gives me information if the entry order did get to StopLoss target or Takeprofit target. (I also added a picture) I tried initializing the StopLoss and TakeProfit as variables like this:
newTakeProfit = SetProfitTarget(entryCounter.ToString(), CalculationMode.Ticks, takeProfit);
The newTakeProfit has been declared in the beginning of the script, but the I get this error when compiling: Cannot implicitly convert type 'void' to 'NinjaTrader.Cbi.Order'
Thank You!
Comment