Order Cancellation and Replacement Timing in VeighNa Target Position Strategies
Summary
This short forum post asks how VeighNa's TargetPosTemplate handles order replacement during live trading. The shown trade routine checks whether an order has finished; if not, it cancels an old order, and otherwise sends a new one. The author asks whether a bar-driven strategy could call the new-order function immediately after requesting cancellation, so a replacement is submitted without waiting for the next call. They also ask whether the existing sequence avoids repeated cancel-and-replace cycles. The post presents a practical execution question, not a tested answer or a reported trading result.
The key operational uncertainty is whether cancellation is synchronous or merely requested, and how order status updates arrive in live trading. Sending a replacement before the old order is confirmed canceled could leave overlapping orders or unintended exposure; waiting may introduce delay. The post does not include a response, broker-specific behavior, or a complete event flow, so it cannot establish the safe implementation. It is useful as a prompt to examine order lifecycle handling and state transitions in live execution, but readers would need to verify the framework and gateway semantics before drawing a conclusion.
Key ideas
- The template cancels an unfinished order and sends a new one only when the prior order is finished.
- The author asks whether cancellation and replacement can occur in the same bar-driven call.
- The post raises the possibility of repeated cancel-and-replace behavior but does not answer the question.
- Live execution depends on when cancellation is confirmed and how order status updates are delivered.
- No broker-specific behavior, testing, or implementation recommendation is provided.
Tags
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.