MT5 Auto Delete Pending Orders by Timeframe
- 유틸리티
-
Xin You Lin
Golden Wings - 버전: 1.7
- 활성화: 5
This EA deletes pending orders that stay on the account longer than a period you define. It does not open or close any market position and it makes no trading decision.
A pending order that has been forgotten can block margin or get filled at a price you no longer want. This utility removes such orders automatically once they pass the time limit you set, so your capital stays available and your order list stays clean.
Key features
- Deletes pending orders after a configurable time in the terminal
- No trading logic, no indicators, no market orders are ever sent
- Works with orders placed manually or by another EA
- Filter by magic number to manage one strategy only
- Filter by symbol to manage only the current chart symbol
- Optional filter by order type: buy limit, sell limit, buy stop, sell stop
- Deletion is logged in the Experts journal, with optional pop-up alert
- Lightweight, one chart is enough for the whole account
How to use
1. Attach the EA to any MT5 chart and enable Algo Trading.
2. Set TimeoutPeriod, the maximum lifetime of a pending order.
3. Set CheckInterval, how often the EA scans the order list.
4. Optionally set MagicNumber and SymbolFilter. Zero means all.
5. Leave the EA running. Orders older than TimeoutPeriod are deleted automatically.
Inputs
- TimeoutPeriod - order lifetime in minutes before deletion
- CheckInterval - scan frequency in seconds, for example 10
- MagicNumber - only orders with this magic number, 0 = all
- SymbolFilter - current symbol only, or the whole account
- OrderTypeFilter - all pending types, or a single type
- EnableAlerts - pop-up alert when an order is deleted
- ShowComment - on-chart panel with the number of managed orders
(Replace the names above with the actual input names of your EA.)
Example
TimeoutPeriod = 60 and CheckInterval = 10 means the EA scans the orders every ten seconds and deletes every pending order that has existed for more than one hour.
Notes
- Only pending orders are deleted. Open market positions are never touched.
- The terminal must stay running, so a VPS is recommended.
- Test the settings on a demo account before using them on a live account.
- Questions are welcome in the comments or by private message on MQL5.
