|
My Requirement is : After sent the Order, and if the OrderStatus is "PartiallyFilled", then Right Click the Order in the OrderManager Window and choose the menu of "Cancel" to cancel the Order.
The ExecutionProvider need the 'ProviderOrderId' to cancel the Order. So I try the two ways as below with some problems:
1. After sent the SellOrder to the ExecutionProvider, the ExecutionProvider will create ProviderOrderId and other execution report( eg. Price,OrderStatus) sent to MyStrategy by EmitExecutionReport. I can see the Order's Avg.Price and Status Changed as expected. But the ProviderOrderId is allways empty and can not be updated. So the later CancelCommand can not be executed correctly because the command need ProviderOrderId.
2. Load the Order's ProviderOrderId by " OrderManager.Get(ExecutionCommand.OrderId).ProviderOrderId" in the ExecutionProvider after receive the CancelCommand, It's ok without reboot the OpenQuant. But if the OpenQuant reboot then the " OrderManager.Get(ExecutionCommand.OrderId).ProviderOrderId" will return the empty. I have allready set Strategy's Persistence to Full option like "this.StrategyManager.Persistence = StrategyPersistence.Full". So the expected result is the " OrderManager.Get(ExecutionCommand.OrderId).ProviderOrderId" will allway return the no-empty value after reboot OpenQuant. But why return empty value after reboot?
|