Forex & EA basics
MT5 pending order expiration: keep old signals from lingering
An entry idea can become outdated before its pending order fills. Expiration gives that idea a defined lifetime. This is a different question from the stop loss on a position that has already opened.
Choose the lifetime
MT5 supports several order time policies, subject to the symbol and broker. Good-till-cancelled and specified-time orders express different intentions. Check the supported expiration modes before assuming that every symbol accepts the same request.
An illustrative session rule
Suppose a morning breakout setup should expire at noon. An unfilled pending order should be cancelled then; an already filled position follows its own exit rules. Cancelling a pending order does not close the position it previously created.
Try a small experiment
On a demo account, place a small pending order away from the market with an allowed expiry. Record the server timestamp, expiry, order ticket and final state. Repeat across a session boundary. Check that the EA does not immediately recreate the expired order from the same stale signal.
A useful AI customisation
Ask AI to explain the order lifetime and re-entry rules separately. A clear change request is: expire unfilled entries after the selected session, retain existing position management, and log the cancellation reason. Compare the before-and-after order history, including orders that never became trades.
Back to top












