Skip to content
All library documents

Polling Order Status with a Time-Based Timeout

Article FMZ forum · Author: hunter1015

Summary

This trading-programming question describes placing a sell order and repeatedly querying its status. The author records the start time, intends to stop after two seconds if the order remains pending, and wants to return different results for a completed order, a canceled or pending order, and a status lookup that fails. In the reported live test, execution appears to remain in the loop after the order submission message.

The included logic checks elapsed time only within branches for missing status or for pending and canceled states; a non-null status outside those cases has no explicit timeout path. The excerpt does not include a diagnosis or a verified fix, and it gives no details about the exchange API’s polling behavior. It therefore serves as an example of status-polling and timeout control flow to inspect, rather than evidence that a particular order-management approach works reliably in live trading.

Key ideas

  • The example submits a sell order and then repeatedly requests its status.
  • It records the time before polling and intends to stop after two seconds in specified cases.
  • A non-null status that is neither pending nor canceled nor closed does not visibly trigger a return in the shown logic.
  • The author reports an apparent infinite loop, but the excerpt contains no confirmed diagnosis or fix.

Tags

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