Oneclick Trade closer
- 实用工具
- 版本: 1.0
Oneclick Trade closer — MT4 Emergency Trade Closer
Oneclick Trade closer is a lightweight MT4 utility script designed to help traders quickly close open positions with a single action.
It is ideal for situations where you need to exit multiple trades immediately, reduce exposure, or quickly clear positions during fast market conditions.
Main Features
- Close all BUY trades instantly
- Close all SELL trades instantly
- Optional deletion of pending orders
- Close trades from all EAs and manual trades
- Filter trades by Magic Number
- Filter trades by Symbol
- Automatic retry system for failed closures
- Configurable maximum slippage
- Detailed execution report after completion
- Works with Forex, Gold, Indices, Crypto and other MT4 symbols
How It Works
Simply drag the script onto any chart and it will immediately scan your open trades.
Depending on your selected settings, the script can:
- Close BUY positions
- Close SELL positions
- Delete pending orders
- Close only trades belonging to a specific EA
- Close only trades on a specific symbol
After the process is completed, the script displays a summary showing:
- Number of positions successfully closed
- Number of pending orders deleted
- Number of failed actions
Input Settings
CloseBuyTrades = true
Close all BUY positions that pass the selected filters.
CloseSellTrades = true
Close all SELL positions that pass the selected filters.
DeletePendingOrders = false
Set to true if you also want to delete pending Buy Limit, Sell Limit, Buy Stop and Sell Stop orders.
MagicNumberFilter = -1
Controls which EA trades the script can close.
- -1 = Close trades from every EA and manual trades
- Enter a specific Magic Number = Close only trades belonging to that EA
SymbolFilter = ""
Controls which symbol should be affected.
- Leave empty = All symbols
- Example: XAUUSD = Only Gold trades
- Example: EURUSD = Only EURUSD trades
MaximumSlippagePoints = 30
Maximum allowed slippage when closing market positions.
MaximumRetries = 5
Maximum number of attempts the script will make if the broker temporarily rejects a close or delete request.
RetryDelayMilliseconds = 500
Delay between retry attempts.
🛡 Smart Retry Protection
During volatile market conditions, brokers may temporarily reject a trade request because of:
- Requotes
- Price changes
- Off quotes
- Trade server busy
- Trade context busy
- Temporary connection problems
Instead of immediately giving up, the script automatically retries the request according to the configured retry settings.
Example Uses
Close everything on the account:
CloseBuyTrades = true
CloseSellTrades = true
DeletePendingOrders = true
MagicNumberFilter = -1
SymbolFilter = ""
Close only XAUUSD trades:
MagicNumberFilter = -1
SymbolFilter = "XAUUSD"
Close trades from only one EA:
Enter that EA's Magic Number into MagicNumberFilter.
Emergency Trade Management Tool
This script can be especially useful when:
- You want to immediately exit multiple positions
- You need to reduce account exposure
- You are approaching a drawdown limit
- You want to close an EA's trades without affecting other strategies
- You want to quickly remove trades before major market volatility
- You need a faster alternative to manually closing trades one by one
Important
The script executes immediately after being attached to a chart.
Please carefully check your selected Symbol Filter, Magic Number Filter and pending-order settings before running it.
Once positions are successfully closed, they cannot be reopened automatically by this script.
Risk Notice: Trading involves risk. This script is a trade-management utility and does not guarantee protection against slippage, price gaps, execution delays, broker restrictions or losses.
