Ballast Close All
- Utilità
- Versione: 1.0
Free. Close all your trades with one click - or only the profitable ones, only the losing ones, only buys, only sells, half of every trade, or just the pending orders. For all symbols or only the chart's symbol, for all trades or one magic number.
When the market turns, closing ten trades one by one takes too long, and a requote or a busy server can leave one of them open without you noticing. Ballast Close All closes them in one go, tries again on temporary errors, and tells you exactly what was closed, the result, and what could not be closed and why.
Buttons
- Close ALL: pending orders first (so none can fill while you close), then every open trade.
- Close positions, Close profitable, Close losing, Close buys, Close sells.
- Close half: half of every trade, rounded down to the lot step (a 0.01 lot cannot be halved and is reported, not closed).
- Delete pending: only the pending orders.
- Second click to confirm (input): the button turns orange and waits 4 seconds for the second click, so a misclick closes nothing.
- The panel shows open buys and sells with their lots, the floating result and pending orders, and after each click a report such as "Close ALL: 5/5 closed, -0.56 EUR, 2.1 s".
Made to be reliable
- Temporary errors (requote, price changed, off quotes, busy server, timeout) are retried, up to 5 tries per trade (input).
- Trades larger than the broker's maximum volume are closed in several parts.
- Market closed, trading disabled, Algo Trading off or no connection: the trade is not attempted, and the panel names the symbol and the reason ("Not closed: GER40 market closed").
- The filling mode is chosen from what the symbol allows.
- Each close, failure and deleted order is written to MQL5\Files\CloseAll_log.csv (input).
Tested
- Strategy Tester, 3 symbols at once, 10,456 button presses on random sets of trades and pending orders with 3 magic numbers, in 4 settings (all symbols or this symbol, all magics or one). After every press: each trade that should close was closed, every other trade and order was untouched, and the closed result equalled the floating result before the click. 0 failures. 13,422 of these closes were made in parts (with a lower test maximum).
- Live on a demo account: 16 presses of all 8 buttons on real broker execution, 0 failures, about 0.4 s per trade.
- Market-style check: 8 symbol/timeframe/deposit combinations without errors.
Notes
- It closes at market price: in a fast market the fill can differ from the price you see (the allowed slippage is an input).
- "Profitable" and "losing" use the trade's floating result including swap at the moment of the click.
- It only acts when you click. In the Strategy Tester it opens and closes a few small demo trades, so there is something to see.
Inputs
- Buttons act on: all symbols, or only this chart's symbol
- Magic number: -1 = all trades, 0 = manual trades only
- Ask for a second click: true
- Allowed slippage: 50 points
- Tries for temporary errors: 5
- Write a log file: true
- Font size, panel corner: 9, upper left
Works well with
- Ballast Equity Target: closes everything automatically at your profit target or loss limit for the day or the account
- Ballast Exit Manager: break-even, trailing stop and partial closes for each trade
- Ballast Prop Guard: keeps a prop-firm challenge inside its daily and total loss limits
