Event-Driven Order Cancellation and Replacement with Multiple Active Orders
Summary
The document examines how a VeighNa strategy may cancel and replace working orders from its tick callback. It traces the event flow: a tick invokes the strategy, a cancellation request is sent, and the order's status does not become cancelled until the order event is processed. Repeated cancellation attempts during that interval are described as harmless. After the cancellation update, the active order list changes and the strategy can consider a replacement.
The author raises a potential flaw when several active orders exist. The described logic acts on the first active order, but subsequent ticks may update the stored order identifier before the earlier order is revisited. The author reasons that this could leave earlier orders cancelled without replacement while only the final active order receives cancel-and-replace handling. The post is a question about whether the logic needs modification; it supplies no verified fix, test results, or broader execution guidance, so the multiple-order behavior remains a proposed interpretation.
Key ideas
- Order cancellation is asynchronous: the order status changes after the cancellation event is processed.
- Repeated cancellation requests may occur while the strategy waits for that status update.
- The post identifies a possible missed replacement when multiple active orders are handled sequentially.
- The author asks whether multi-order handling needs a change but gives no confirmed resolution.
Tags
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.