Basket Recovery Manager
- Utilities
- Version: 1.0
- Activations: 10
Recovery and basket manager for MT5: average-in / DCA layers, hedge lock and basket take-profit for a losing trade, with hard limits it can never exceed and the worst case shown before anything is sent.
Basket Recovery Manager takes over a losing position or a whole basket on the chart symbol – opened by hand or by any other Expert Advisor – and runs the recovery plan you choose: add layers as price moves against you, lock the loss with a hedge, and close everything together at a basket target or at break-even. Every plan is drawn on the chart and listed on the panel before it is executed: level, lot, break-even and target after each layer, and one number that answers the question every averaging trader fears – "what is the most I can lose?"
Hard limits come first. Equity floor, max basket loss, daily loss limit, max layers, max total lot, max lot per layer, max spread and min margin level are set in the inputs only – no click on the panel can loosen them. The planner shows only the layers that fit inside the loss budget, every order is checked against all limits again right before it is sent, and when a limit is reached the basket is closed (or frozen) at once.
What it manages (scope)
- All trades on the chart symbol, or only the magic numbers you list (0 = manual trades) – works next to any EA without its source code.
- Buy and sell trades, or one direction only.
- Layers and hedges it opens carry their own magic number and comment, so your EA is never confused by them.
- Hedging and netting accounts (hedge mode needs a hedging account); any symbol – forex, gold, indices, crypto – broker suffixes included.
Recovery modes (switch on the panel)
- Average-in / DCA – up to N layers against the basket. First distance in points or as a multiple of ATR, each further distance x a factor (equal or expanding spacing). First layer lot fixed or a multiple of the original volume, each further lot x a factor (1.0 = flat DCA). Layers are added at market when price reaches the planned level (no pending orders that could bypass the checks), or at once with Add layer now.
- Hedge recovery – opens an opposite position when price is a set number of points beyond the break-even: ratio 1.0 locks the loss completely, lower ratios reduce the exposure. Optional automatic unlock when price comes back, or Close hedge by hand; each hedge counts against the layer limit.
- Close only – no new trades; only the basket exits below.
Basket exits
- Basket target in points beyond the basket break-even, in money, or in % of the balance – the whole basket is closed together.
- Break-even exit – once a layer or hedge has been added, close everything as soon as the basket is back to break-even plus a small profit.
- Profit trail – after the basket reaches a profit, close it when a set amount is given back.
- Close basket button with a two-step confirmation.
Plan preview – before anything is sent
- Panel table for the next layers: level, lot, basket break-even after the fill and target price after the fill.
- Chart lines: basket break-even, target, every planned layer, hedge trigger and unlock level, and the worst-case line.
- Worst case strip: the loss at which the basket is closed, the price where that happens with every planned layer filled, which limit sets it, and the equity left afterwards.
- Layers that would lie beyond the loss limit, exceed the total lot or fall below the broker's minimum lot are simply not planned – the panel tells you why.
Hard limits (inputs only)
- Equity floor – % of a reference balance (the balance when first attached, or a value you enter, e.g. a challenge's starting balance).
- Max basket loss and daily loss limit – % of the reference balance; the trading day starts at the server hour you choose and is measured from the higher of balance and equity, the balance or the equity at day start.
- Max layers + hedges per basket, max total lot, max lot per layer, max spread to add a layer, min margin level after a new layer, and a free-margin check before every order.
- When a loss limit is reached: close the basket and stop, close every position on the account and stop, or freeze (keep the positions, add nothing). After the floor or daily limit, new trades in scope are closed until you reset (floor) or until the next trading day (daily).
- Optional broker-side stop loss at the worst-case price on every basket position, so the loss limit also holds while the terminal is offline.
- Limit state is saved and survives a terminal restart.
Prop-firm presets
- 5 % daily / 10 % max, 4 % daily / 8 % max and 3 % daily / 6 % max – each keeps a safety buffer below the rule (e.g. 4 % / 8.5 % for the 5 / 10 rule) and limits the basket loss and the number of layers.
- A conservative personal preset (3 % daily / 15 % max).
- Set the reference balance to your challenge's starting balance and the limits follow the firm's way of measuring.
Panel
- One panel: basket (side, positions, volume, break-even, floating P/L, distance to break-even), mode tabs, adjustable plan values (layers, distance, lot factor, target, hedge trigger, ratio, unlock), plan table, worst case, actions and live bars for every hard limit.
- Dark and light themes (auto from the chart), sharp at any screen scaling (100–300 %), movable and minimisable.
- Popup and push alerts for every layer, hedge, close and limit; activity line on the panel.
- Settings and panel values are kept across restarts and timeframe or symbol changes.
Strategy Tester
The free demo runs in the Strategy Tester. With "Tester only: open a starter trade when flat" (on by default) the utility opens a small starter trade whenever it is flat, so you can watch the plan, the layers, the exits and the hard limits work in visual mode. The starter trades exist only for this demonstration.
Good to know
- Averaging and hedging do not turn a losing trade into a winner – they change where and how it is closed. Use the worst-case figure and the hard limits to decide how much you are willing to risk; past results in the tester do not guarantee future results.
- No DLL, no WebRequest. One instance per symbol chart; run several charts for several symbols.
- Questions and suggestions are welcome in the comments or by private message.
