AE DeletePendingOrders
- Utilità
- Evgenii Averkiev
- Versione: 1.0
AE-DeletePendingOrders is a professional script for MetaTrader 5 designed to quickly and securely delete all pending orders on a trading account. The script provides full control over the deletion process thanks to a flexible filtering system and reliable error handling mechanisms.
Main features
The script automatically deletes all types of pending orders: BUY LIMIT, SELL LIMIT, BUY STOP and SELL STOP. An intelligent retry system has been implemented in case of temporary communication errors with the trading server, which guarantees maximum deletion efficiency even in conditions of unstable connection.
The built-in filtering system allows you to delete orders selectively: only for the current trading instrument or for all symbols at the same time.
To prevent accidental deletion, a confirmation dialog has been implemented with detailed information about the number of orders found and filters applied. The user always sees exactly what will be deleted before confirming the operation.
Safety and reliability
The script uses a proven algorithm for reverse order sorting (from the last to the first), which eliminates problems with index shifting during deletion and guarantees processing of all found orders. Each deletion operation is accompanied by detailed logging in the terminal log indicating the ticket, type, symbol, volume and price of the deleted order.
Full processing of all possible trading errors with clear descriptions has been implemented. If critical errors occur that do not require repeated attempts (incorrect ticket, trade ban), the script correctly completes processing the problematic order and proceeds to the next one.
Settings and management
All script parameters are configured via the user-friendly input parameters interface.:
Enabling/disabling the confirmation dialog
Filtering by the current symbol or processing all tools
Setting the number of repeated attempts in case of errors (default 3)
Setting the delay between attempts in milliseconds (500 ms by default)
After completion, the script outputs complete statistics: the total number of orders found, the number of successfully deleted orders, and information about unsuccessful attempts (if any). The final message is displayed both in the log and as a pop-up Alert.
The script is ideal for quickly clearing the account of accumulated pending orders, preparing for the launch of a new trading strategy, or urgently closing all pending positions in non-standard market situations.
