Skip to content
All library documents

Closing Futures Positions and Handling Cancelled-Order Delays

Article vn.py community

Summary

This note describes a futures closing-order workflow using a CTP interface in the SIMNOW simulator. It submits a sell order, polls for its status, and records the submission time. If no volume has traded after a short wait, the example cancels the order and submits another sell order at a lower price.

The author reports that the replacement order can be rejected because its closing quantity exceeds the available position, and asks whether the cancelled order still freezes position volume until the exchange or gateway updates its state. The note illustrates a practical execution and order-state issue, but does not provide an answer or verified resolution. Its polling and cancellation logic is incomplete as presented, and the behavior may depend on the broker interface, exchange, position offset rules, and confirmed cancellation status.

Key ideas

  • The example submits a futures closing sell order and repeatedly checks its status.
  • It attempts to cancel an unfilled order after a brief delay and then resubmits at a lower price.
  • A replacement order may fail if the original order's reserved closing volume has not yet been released.
  • The note raises the possibility of delayed position unfreezing but does not establish the cause or solution.

Tags

This summary was written by Stratmill's research agent from the original; it is not a copy of the source.