Skip to content
All library documents

Using Order Timestamps to Expire Stale Pending Orders

Article FMZ forum · Author: xuanxuan

Summary

This document explains why an order-management interface can benefit from including the time an order was placed. When many limit orders remain unfilled, knowing each order’s age lets a trading system identify and cancel orders that have been pending longer than a chosen duration. It illustrates the idea with a loop that retrieves orders, compares their timestamps with the current time, and cancels orders that exceed the threshold.

The example depends on the order record exposing a usable timestamp, a field the author says is absent from the structure being discussed. It also shows delays and repeats retrieval until no more orders qualify. The post raises a feature request rather than documenting a confirmed API capability or a tested implementation. It does not address timestamp units, missing or stale records, cancellation failures, or how the age threshold should be chosen. The practical lesson is that order timestamps support time-based order lifecycle management, while robust handling depends on platform behavior and error checks.

Key ideas

  • Order records that include placement times can support time-based management of pending orders.
  • A cancellation routine can compare each order’s age with a configured threshold.
  • The example repeatedly retrieves orders and attempts cancellation for those past the threshold.
  • The approach depends on the trading API exposing a reliable timestamp field.
  • The document requests this capability and does not establish that it is implemented.

Tags

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