I am using this function :
protected override void OnExecutionUpdate(Execution execution, string executionId, double price, int quantity, MarketPosition marketPosition, string orderId, DateTime time){
if (execution.Order.OrderState == OrderState.Filled){
if(execution.Order.Name == Long_Entry_Name){
...my commands;
}
...
But sometimes "my commands" get executed whereas they should not.
In the output I see :
6/26/2019 6:20:00 PM Strategy 'ON_V4_SIM/167471567': Entered internal SubmitOrderManaged() method at 6/26/2019 6:20:00 PM: ...
6/27/2019 8:39:00 AM Strategy 'ON_V4_SIM/167471567: Cancelled pending exit order, since associated position is closed, ....
(Tested on 6/27/2019 after 11:00 AM)
I would like to not execute "my commands" when the strategy enters in internal SubmitOrderManaged()
How could I do that?
Thanks
Comment