I added in onbarupdate a condition to prevent NT from moving stoploss back to the value of setstoploss once I moved stoploss manually during the trade. I thought instead of adding a bool I simply use the barnumbers so that with next bar after entry (barNumberOfOrder=CurrentBars[2] together with entrylong...) NT will not move the stoploss, but it seems it does move stoploss also when CurrentBars[2]>barNumberOfOrder.
if (Positions[4].MarketPosition != MarketPosition.Long)
{
if(barNumberOfOrder==CurrentBars[2])
{
SetStopLoss("rL1a", CalculationMode.Ticks, st1L1, false);
SetStopLoss("rL1b", CalculationMode.Ticks, st2L1, false);
....
....
}
What do I miss to make it working please?
Thank you!
Tony

Comment