An order has been ignored since the stop price ... is invalid based on the price range of the bar.
The stop prices have no relation to the data prices, the stop prices can be above or below the data prices.
This code will create the error on ES data
protected override void OnBarUpdate()
{
//Add your custom strategy logic here.
/*
This will reproduce the "order has been ignored since the stop price ‘xxxx’ near the bar stamped ‘01/01/2025 18:21:00’ is invalid" error
These are the first 2 prices for this test on ES
1/1/2025 6:21:00 PM 5950 , 5950 , 5947.75 , 5948.25
1/1/2025 6:22:00 PM 5948.25 , 5949.5 , 5948 , 5949.5
It occurs on the very first time the stop limit is executed.
If the order is ShortStopLimit and the stop price greater than about 5760 the error occurs
If the order is LongStopLimit and the stop price less than about 6160 the error occurs
*/
if (CurrentBar < BarsRequiredToTrade)
return;
EnterLongStopLimit(2000 , 6160 );
//EnterShortStopLimit(8000 , 5760 );
if ( numPrinted++ < 2 )
Print( Bars.GetTime(CurrentBar) + " " + Open[0] + " , " + High[0] + " , " + Low[0] + " , " + Close[0] );
}

Comment