https://ninjatrader.com/support/foru...s-cs-expecting
[URL="https://ninjatrader.com/support/forum/forum/ninjatrader-8/platform-technical-support-aa/97419-priceos-cs-expecting"]protected override void OnStateChange() { else if (State == State.Configure) { AddDataSeries(BarsPeriodType.Tick, 1); } } if (BarsInProgress == 1 && Position.MarketPosition == MarketPosition.Long) { if (UseStopLoss && TrailStopLoss && Close[0] > currentSlPrice + StopLossDistance * TickSize) { currentSlPrice = Close[0] - StopLossDistance * TickSize; SetStopLoss(CalculationMode.Price, currentSlPrice); } }[/URL]
- Should you have multiple Bars objects of the same instrument while using SetStopLoss() in your strategy, you should only submit orders for this instrument to the first Bars context of that instrument. This is to ensure your order logic is processed correctly and any necessary order amendments are done properly.
Thanks
Comment