| 11/18/21 12:52 | Order | Received order in unknown state 'Cancellation Failed', Order Id '48374984' |
| 11/18/21 12:52 | Order | Order='48374984/***' Name='Exit Long 1' New state='Cancelled' Instrument='NQ 12-21' Action='Sell' Limit price=16448.75 Stop price=0 Quantity=1 Type='Limit' Time in force=GTC Oco='' Filled=0 Fill price=0 Error='Unable to cancel order' Native error='Send cancels only after 30 secs. More cancels within this period will lead to logoff/disable of this user.' |
| 11/18/21 12:52 | Order | Received unknown order type '', Order Id '48374984' |
| 11/18/21 12:52 | Order | Order='48374984/***' Name='Exit Long 1' New state='Cancelled' Instrument='NQ 12-21' Action='Sell' Limit price=16448.75 Stop price=0 Quantity=1 Type='Limit' Time in force=GTC Oco='' Filled=0 Fill price=0 Error='No error' Native error='' |
| 11/18/21 12:52 | Order | Order='7b759212a8604624806561ce25adb3d0/***' Name='Sell' New state='Submitted' Instrument='NQ 12-21' Action='Sell short' Limit price=16439.75 Stop price=0 Quantity=1 Type='Limit' Time in force=GTC Oco='' Filled=0 Fill price=0 Error='No error' Native error='' |
| 11/18/21 12:52 | Order | Order='48374984/***' Name='Exit Long 1' New state='Cancel submitted' Instrument='NQ 12-21' Action='Sell' Limit price=16448.75 Stop price=0 Quantity=1 Type='Limit' Time in force=GTC Oco='' Filled=0 Fill price=0 Error='No error' Native error='' |
| 11/18/21 12:52 | Order | Order='48374984/***' Name='Exit Long 1' New state='Cancel submitted' Instrument='NQ 12-21' Action='Sell' Limit price=16448.75 Stop price=0 Quantity=1 Type='Limit' Time in force=GTC Oco='' Filled=0 Fill price=0 Error='No error' Native error='' |
| 11/18/21 12:52 | Execution | Execution='68641:M:11470252TN0244083|48375045|6826 876237077' Instrument='NQ 12-21' Account='***' Exchange=Globex Price=16439.75 Quantity=1 Market position=Short Operation=Operation_Add Order='48375045' Time='11/18/2021 12:52 PM' |
| 11/18/21 12:52 | NinjaScript | NinjaScript strategy 'aaMAllBarStrategy02/233514812' submitting order |
| 11/18/21 12:52 | Order | Order='48375045/***' Name='Stop Long' New state='Filled' Instrument='NQ 12-21' Action='Sell' Limit price=16439.75 Stop price=0 Quantity=1 Type='Limit' Time in force=GTC Oco='' Filled=1 Fill price=16439.75 Error='No error' Native error='' |
| 11/18/21 12:52 | Position | Instrument='NQ 12-21' Account='***' Average price=16440 Quantity=1 Market position=Flat Operation=Remove |
| 11/18/21 12:52 | Order | Order='48375045/***' Name='Stop Long' New state='Working' Instrument='NQ 12-21' Action='Sell' Limit price=16439.75 Stop price=0 Quantity=1 Type='Limit' Time in force=GTC Oco='' Filled=0 Fill price=0 Error='No error' Native error='' |
| 11/18/21 12:52 | Order | Order='48375045/***' Name='Stop Long' New state='Accepted' Instrument='NQ 12-21' Action='Sell' Limit price=16439.75 Stop price=0 Quantity=1 Type='Limit' Time in force=GTC Oco='' Filled=0 Fill price=0 Error='No error' Native error='' |
| 11/18/21 12:52 | Order | Order='40f885d938dd4ca1820f080f5d435f78/***' Name='Stop Long' New state='Submitted' Instrument='NQ 12-21' Action='Sell' Limit price=16439.75 Stop price=0 Quantity=1 Type='Limit' Time in force=GTC Oco='' Filled=0 Fill price=0 Error='No error' Native error='' |
When the stoplong is happens and state is filled, then it will cancel the exitlong1.
In my strategy (OnExecutionUpdate), i write
if (execution.Order==stopLong && stopLong != null)
{
if (stopLong.OrderState == OrderState.Filled)
{
if (exitLong1 != null && cancelexitLong1fromstoplong == 0)
{
CancelOrder(exitLong1);
cancelexitLong1fromstoplong = 1;
}
}
}
In my strategy (OnOrderUpdate), i write
if ( (order.OrderState == OrderState.Cancelled && order.Filled == 0) || order.OrderState == OrderState.Rejected || (order.OrderState == OrderState.Cancelled && order.Filled > 0) )
{
exitLong1 = null;
exitLongQuantity1 = 0;
}
Any help from this ??
Or I should not call the "cancelorder" inside the state.filled ??

Comment