On bar update this line moves the stop
SetStopLoss(@"entryOrderShort",CalculationMode.Pri ce, stopLossLevel,false);
the stoploss moves and receives this error: (unable to change)
2021-10-01 09:35:49:820|1|32|Order='1592082970/208241' Name='Stop loss' New state='Working' Instrument='NQ 12-21' Action='Buy to cover' Limit price=0 Stop price=14692 Quantity=1 Type='Stop Market' Time in force=GTC Oco='501326807552' Filled=0 Fill price=0 Error='Unable to change order' Native error='Buy order stop price must be above last trade price ExchangeRejectCode = 2061'
So this line comes into play
if(order.Name == "Stop loss" && error == ErrorCode.UnableToChangeOrder)
{
ExitLong(order.FromEntrySignal);
ExitShort(order.FromEntrySignal);
}
It got filled
2021-10-01 09:35:49:963|1|32|Order='1592044797/208241' Name='Buy to cover' New state='Filled' Instrument='NQ 12-21' Action='Buy to cover' Limit price=0 Stop price=0 Quantity=1 Type='Market' Time in force=GTC Oco='' Filled=1 Fill price=14566 Error='No error' Native error=''
Immediately after this error occurs: (unable to cancel order)
2021-10-01 09:35:49:978|1|32|Order='1592082970/208241' Name='Stop loss' New state='Working' Instrument='NQ 12-21' Action='Buy to cover' Limit price=0 Stop price=14692 Quantity=1 Type='Stop Market' Time in force=GTC Oco='501326807552' Filled=0 Fill price=0 Error='Unable to cancel order' Native error='Buy order stop price must be above last trade price ExchangeRejectCode = 2061'
Maybe it is necessary to cancel the stop before sending the exitshort ()?
How can I get this error on replay?
Thanks in advance. Log on the attachments

Comment