Close all orders
A utility EA that provides a GUI button to close all open market positions and/or delete all pending orders with a single click. It features a confirmation dialog, real-time order count display, and configurable slippage tolerance. The EA does not open any trades itself; it solely manages existing orders.
Open the interactive view (equity curve, symbol switch)Key facts
Backtest results (H1, about 1 year)
Not backtested yet — this EA could not be converted automatically.
Strategy analysis
This EA is not a trading strategy EA but rather an order management utility, so it has no traditional entry or exit strategy concept. Its core function is batch closing of positions and batch deletion of pending orders, triggered by user clicking a chart button. For position management, the EA iterates through all positions and pending orders in reverse order to avoid index shifting during deletion. Money management is not applicable since the EA does not open positions or calculate lot sizes. The slippage parameter allows users to control price deviation tolerance when closing positions. The confirmation dialog adds operational safety by preventing accidental closures from misclicks.
Strengths
- One-click close all feature is convenient for scenarios requiring rapid liquidation
- Confirmation dialog prevents accidental operations, improving operational safety
- Reverse iteration over orders avoids index shifting issues, logic is correct
- Real-time display of market and pending order counts provides intuitive information
- Separate controls for closing market orders vs pending orders offers good flexibility
Weaknesses
- No filtering capability — cannot selectively close by symbol, magic number, or direction
- No retry mechanism — failed closures are skipped without reattempting
- UpdateInfoDisplay and ChartRedraw called every tick may impact chart performance
- No filling mode (FILLING) specified, which some brokers may require
- INFO button functionality is simple, only displaying settings with limited practical use
Possible improvements
- Add filtering by symbol, magic number, and direction for selective closing capability
- Implement a retry mechanism for failed closures to improve success rate during unstable network conditions
- Optimize info update frequency by using a timer instead of per-tick refresh to reduce performance overhead
Risk assessment
Overall risk: Safe
- Per-tick chart refresh may impact performance in high-frequency environments
- Missing filling mode specification may cause closure failures on some broker platforms
Evaluation scores
Parameters
| Parameter | Default | Description |
|---|---|---|
ButtonX | 20 | Button X coordinate position |
ButtonY | 50 | Button Y coordinate position |
ButtonWidth | 180 | Button width |
ButtonHeight | 40 | Button height |
ButtonColor | clrCrimson | Button background color |
TextColor | clrWhite | Button text color |
CloseMarketOrders | true | Close market orders |
ClosePendingOrders | true | Delete pending orders |
Slippage | 10 | allowedslippage (points) |
ShowConfirmation | true | Show confirmation dialog |
Similar Utility EAs
Backtests are historical simulations and do not guarantee future results. Not financial advice.