I have been getting this error in the NT LOG running a strategy against NQ 03-21, using Strategy Analyzer
Strategy 'cscCTMacdv02/-1': An order has been ignored since the stop price ‘12364.75’ near the bar stamped ‘2020-12-09 7:50:00 PM’ is invalid based on the price range of the bar. This is an invalid order and subsequent orders may also be ignored.
The logic around the ExitShortStopMarket, where dblSL is the stop price:
//Long
if (dblSL < Position.AveragePrice
&& dblSL < stopOrder.StopPrice
&& Instrument.MasterInstrument.Compare(dblSL, Low[0]) == -1
&& Instrument.MasterInstrument.Compare(dblSL, GetCurrentAsk()) == -1
&& Instrument.MasterInstrument.Compare(dblSL, GetCurrentBid()) == -1)
stopOrder = ExitLongStopMarket(0, true, Position.Quantity, dblSL, "MyStop", "MyEntry");
// Short
if (dblSL > Position.AveragePrice
&& dblSL > stopOrder.StopPrice
&& dblSL > High[0]
&& Instrument.MasterInstrument.Compare(dblSL, High[0]) == 1
&& Instrument.MasterInstrument.Compare(dblSL, GetCurrentAsk()) == 1
&& Instrument.MasterInstrument.Compare(dblSL, GetCurrentBid()) == 1)
stopOrder = ExitShortStopMarket(0, true, Position.Quantity, dblSL, "MyStop", "MyEntry");
Can you please tell me what exactly this NT error message is trying to say or a link to somewhere in Help ?
Thank you
Comment