in SampleOnOrderUpdate: https://ninjatrader.com/support/help...and_onexec.htm
On line 122:
if (execution.Order.OrderState == OrderState.Filled || execution.Order.OrderState == OrderState.PartFilled || (execution.Order.OrderState == OrderState.Cancelled && execution.Order.Filled > 0)){
...
}
Is it a redundant judgment condition?
Is it possible to replace with:
if (execution.Order.Filled > 0){
....
}
On line 125:
Is sumFilled redundant?
On line 142 it can be replaced with if (execution.Order.OrderState == OrderState.Filled){
entryOrder = null;
sumFilled = 0;
}

Comment