Pending Order Expiry Cleaner Utility
- ユーティリティ
- バージョン: 1.0
- アクティベーション: 5
FORGOTTEN PENDING ORDERS FILL AT THE WORST MOMENT. THIS UTILITY CLEANS THEM UP FIRST.
Try it free first: attach Pending Order Expiry Cleaner Utility to a demo chart in SCAN ONLY mode, place a few pending orders, and watch the panel count down the age of every order and mark which ones it would remove.
A quiet housekeeper for your pending book: it removes Limit, Stop and Stop Limit orders that have grown too old, drifted too far from price, or are still waiting when the trading day or the trading week ends.
In five lines
1. Removes pending orders older than the age you set, measured from the moment each order was placed.
2. Optional distance rule removes orders that price has left far behind.
3. Optional daily sweep and a Friday sweep clear the book before the overnight or weekend gap.
4. Filters by chart symbol (or all symbols), by magic number, by order type and by comment text.
5. Starts in SCAN ONLY, so you see every decision on the panel before a single order is touched.
START HERE
Attach it to any chart, any timeframe. It is a utility: it never opens a position, never changes a stop loss or take profit of an open trade, and only deletes pending orders that pass every filter you set. Leave it in SCAN ONLY for a session, check that the orders it marks are the ones you expected, then press the ARMED button. Keep Algo Trading enabled in the terminal, otherwise the panel shows a red warning and nothing can be removed.
Why a pending order needs an expiry
A pending order is a promise you made to the market at one moment, based on what you saw at that moment. Hours later the reason may be gone, the level may no longer matter and the spread around the news or the session open may be very different. Many brokers do not offer a convenient expiry on every symbol, and many traders simply forget an order on a chart they no longer watch. The result is the classic surprise: an old Buy Stop triggers on a spike long after you stopped caring about it. This utility gives every pending order a life span that you decide, and it keeps working on the charts you are not looking at.
How it works, one scan at a time
Step one, the filter. Every few seconds the utility reads the pending orders of the account and keeps only those that match your scope: the chart symbol or all symbols, the magic number you chose (any, manual orders only, or one exact magic), the order types you enabled and, if you wish, a piece of comment text. Orders of other strategies are never touched when the magic filter is set.
Step two, the clock. For each matching order it measures the age from the broker's setup time and the distance from the current price. The panel shows the age of every order and how long it has left before it becomes due.
Step three, the decision. An order is due when it reaches the maximum age, when it is further than your distance limit, or when a daily or Friday sweep time is reached. In ARMED mode a due order is deleted, with a small number of retries if the server is busy; in SCAN ONLY it is only marked WOULD REMOVE and written to the journal.
Step four, optional broker-side expiry. If your broker supports a specified expiration time on the symbol, the utility can stamp an expiry on orders that have none, so the order disappears on the server even when your terminal is closed. If the broker does not support it, the local timer still does the job while the terminal runs.
The panel
A dark, clean card on the left side of the chart, in the same premium style as our newest tools, leaving the right side and the price scale free. The header shows the scope and magic filter with a status pill (ARMED, SCAN ONLY or PAUSED). The live console lists the active rules, the number of matching orders, the countdown to the next expiry, orders removed today and in total, and the server time used for the sweeps. A table shows up to twelve pending orders, oldest first, with type, lots, price, age and status (DUE, WOULD REMOVE, FAR, RETRY). Four buttons switch ARMED and SCAN ONLY, pause and resume, toggle the dotted price marks, and CLEAN NOW, which asks for a second click within eight seconds before it removes every matching order. The panel measures its own text, fits any screen size, can be dragged by the MOVE handle and minimised.
What is new compared with our previous utilities
A next-expiry countdown so you always know when the next removal will happen, a two-click confirmation on the manual clean button, and the optional broker-side expiry stamp that protects you even when the terminal is offline.
Every setting explained
InpAllSymbols: false manages only the chart symbol; true manages pending orders on every symbol of the account from one chart.
InpMagicFilter: -1 manages orders with any magic number, 0 manages only manual orders, any positive number manages only orders with that magic.
InpIncludeLimits: include Buy Limit and Sell Limit orders.
InpIncludeStops: include Buy Stop and Sell Stop orders.
InpIncludeStopLimits: include Buy Stop Limit and Sell Stop Limit orders.
InpCommentFilter: only orders whose comment contains this text; leave empty for all.
InpMaxAgeMinutes: maximum life of a pending order in minutes, counted from its setup time; 0 switches the age rule off. Default 240.
InpMaxDistancePoints: remove an order when the market is further away than this many points; 0 switches it off.
InpDailySweep: once a day, at the time below, remove every matching pending order.
InpDailySweepTime: server time of the daily sweep in HH:MM.
InpFridaySweep: on Friday, at the time below, remove every matching pending order before the weekend gap. On by default.
InpFridaySweepTime: server time of the Friday sweep in HH:MM.
InpStampBrokerExpiry: set a broker-side expiry (setup time plus maximum age) on orders that have none, where the symbol allows it.
InpStartArmed: false starts in SCAN ONLY preview; true starts ARMED and removes due orders at once.
InpScanSeconds: how often the book is scanned, in seconds. New and deleted orders also trigger an immediate scan.
InpRetryLimit: how many times a failed delete is retried in one scan.
InpLogJournal: write every removal, preview decision and error to the Experts journal.
InpFontSize: panel font size; the whole panel scales with it.
InpPanelX and InpPanelY: starting position of the panel.
InpMarksOn: draw dotted marks at the price of each pending order on the chart symbol, coloured by status.
InpSellerURL: the link shown in the panel footer.
Honest expectations
This tool does not trade and does not predict anything. It removes pending orders according to your rules, nothing more. Sweep times use the broker's server time, so check the SERVER TIME row before you choose them. The local timer works only while the terminal is running; use the broker-side expiry stamp or a VPS if you need cover while you are away. In the Strategy Tester it scans on ticks, so you can test it together with an EA that places pending orders. No DLLs and no extra files are needed.
If the utility saves you from one forgotten order, a short honest review on the product page helps other traders decide, and tells us what to improve next.
