AW Recovery EA recovers a losing position part by part: it locks the position, opens averaging orders and uses their profit to close the losing orders in small parts. This article describes every input of version 4.40: what it changes in the EA's work, in what units it is set and which other inputs it is linked to.
Note! Two other articles in this series:
How to set up the EA, ready set files for EURUSD, XAUUSD and BTCUSD: HERE
The EA panel, simple and new, with a description of each button: HERE
Input names are given as they appear in the EA settings window. Distances are in points, volumes are in lots.
Not sure what to set - keep the value from the ready set file. Custom values are needed only in four inputs: "Part to close from a loss-making position", "Volume of first average order", "Step for average" and "TakeProfit in points for partial close". How to calculate them - in the main article: HERE.
To read only one part - section 8: which inputs make the work calmer or faster.
The article contains the following sections:
- ORDERS TO RECOVERY SETTINGS - which orders to recover
- LAUNCH SETTINGS - when to start work
- TAKEPROFIT AND PARTIAL RECOVERY SETTINGS - parts and TakeProfit
- RECOVERY GRIDS AND AVERAGE ORDERS SETTINGS - averaging orders
- PROTECTION SETTINGS - limits and protection
- GRAPHICS SETTINGS - panel and graphics
- AW TREND PREDICTOR FILTERING SETTINGS - trend filter
- Which inputs affect risk the most
Terms used below.
- Point - the smallest price step: on EURUSD 1.08451 → 1.08452 is 1 point.
- Lock (locking) - an opposite order after which Buy and Sell are equal and the loss stops growing.
- Losing position - the orders the EA recovers. The lock is part of it too.
- Averaging order - an order of the EA, its profit closes the loss. Such orders have the comment "AW Recovery Average".
- Part - a piece of a losing order that is closed at one time.
- Basket - all averaging orders of one side.
- MagicNumber - the number the EA uses to mark its orders. Orders opened manually have 0.
- Ticket - the order number, the Order column in the Trade tab.
- Timeframe - the candle period: M15 - 15 minutes, H1 - one hour, D1 - one day.
1. ORDERS TO RECOVERY SETTINGS
This section defines which orders the EA treats as the losing position and in what order it closes their parts.
| Input | What it does |
|---|---|
| "What orders to start from" | The order in which parts are closed. "Start with easy to close orders" - first the parts of the orders closest to the current price (the smallest loss per part). "Start with hard to close orders" - first the parts of the farthest order: the highest price for Buy, the lowest for Sell. |
| "MagicNumbers group for recovery" | Whose orders to recover. "All orders on same Symbol" - all orders of the chart symbol. "Manual opened orders on same Symbol" - orders with MagicNumber 0 (opened manually), the EA's own orders and orders with a MagicNumber from the list below. "Same MagicNumbers on same Symbol" - only orders with a MagicNumber from the list below. |
| "MagicNumbers for recovery(sep by comma ",")" | A comma-separated list of MagicNumbers for the "Same MagicNumbers on same Symbol" option. Manual orders are marked in the list with 0. |
| "First ticket for recovery(0-not used)" | The ticket of the order to start recovery with, if it must go first regardless of difficulty. 0 - not used. After this order is closed, the EA moves on to the other orders in the order set by "What orders to start from". |
| "Use locking" | Automatic locking. On - the EA equalizes the Buy and Sell volumes of the recovered orders and keeps the lock during the whole work: if an order is opened or closed manually, the lock is restored. Off - no lock, the EA works with the position as it is. |
| "Delete SL and TP" | StopLoss and TakeProfit levels of the recovered orders. "Off" - do not touch. "Delete At Launch" - delete once at launch. "Delete Always" - delete during the whole work, including levels set later. |
When to turn off locking? When the orders of the position are still managed by another EA or by the trader manually: new orders are opened, old ones are closed. With locking on, the EA equalizes the volumes back right after each such action. With locking off, the EA does not open locking orders, but still closes parts and opens averaging orders.
2. LAUNCH SETTINGS
This section defines the moment the EA leaves sleep mode and the actions it performs once at launch.
| Input | What it does |
|---|---|
| "Type of Launch" | "Instant start" - work starts at once, as soon as there are orders to recover on the symbol. "Start at drawdown in percents" - the EA waits until the loss of the processed orders exceeds the set percent of the balance. "Start at drawdown in money" - the same in the deposit currency. Before launch the EA is in sleep mode: it does not open or close orders, the panel shows "Advisor in sleep mode". |
| "Drawdown in percentage or in money to Launch" | Launch threshold: a percent of the balance or an amount in the deposit currency, depending on "Type of Launch". Not used for "Instant start". |
| "Disable other EAs at Launch" | What to do with other EAs at the moment of launch. "Disable advisors on same Symbol" - close the charts of the same symbol. "Disable advisors on all Symbols" - close all other charts of the terminal. "Do not disable other advisors" - touch nothing. The EA closes the charts completely and does not remember which EAs were on them: after recovery they are turned on manually. |
| "Close profit at Launch" | On - before the lock, close the profitable orders of the larger side. Example: Buy 1.00, Sell 0.60 - the EA closes up to 0.40 lot of profitable Buy orders. The lock comes out smaller, and the loss drops at once. Works with "Use locking" = On. |
| "Delete Pending Orders at Launch" | On - at launch, delete the pending orders that belong to the processed position, so that its volume does not change without the EA. |
Note! Launch actions are performed each time the EA leaves sleep mode. After recovery in the drawdown modes, the EA returns to sleep mode by itself, and at the next drawdown it does the preparation again. In "Instant start" mode there is no sleep mode, the EA works all the time while there are orders on the symbol.
3. TAKEPROFIT AND PARTIAL RECOVERY SETTINGS
The main section for risk management. It sets the size of the part closed from each losing order at one time and the profit at which the closing is done.
| Input | What it does |
|---|---|
| "Part to close from a loss-making position" | Volume of the part in lots that is closed from the losing Buy and from the losing Sell in one closing. The smaller the part, the more closings are needed and the less profit each one requires. |
| "TakeProfit in points for partial close" | A small plus above the closed loss, in points. This is not a price target. In money = TakeProfit × volume of averaging orders × point value Closing when: profit of averaging orders + loss of two parts is greater than this amount Example: 0.30 lot, 30 points, EURUSD - 9 USD. The usual value is spread × 3; more is not better. |
| "Allow overlap after number of orders" | Overlap. When the basket has more orders than this number, the EA can close only the first and the last of them together with two parts, without waiting for the profit of the whole basket. It cannot be set below 2. Overlap does not work on the last part of the position. |
| "Use TP for total busket if possible" | On - close everything at once (recovered, locking and averaging orders of both directions) when the total profit reaches "TP for total basket in money". |
| "TP for total basket in money" | Amount in the deposit currency for closing the whole basket. Used only with "Use TP for total busket if possible" = On; the closing is done if the total profit is greater than this amount and greater than zero. |
Order of closing checks on each tick:
- The whole basket by "TP for total basket in money", if enabled.
- All averaging orders of one direction plus one part from Buy and one from Sell.
- Overlap: the first and the last averaging order plus one part from Buy and one from Sell.
"Part to close from a loss-making position" = 0.03 (the base for any deposit and position)
Raise - not above the volume of the largest losing order / 8 (6 to 8 is fine: the smaller the divisor, the larger the part)
"TakeProfit in points for partial close" = spread × 3 (not less)
For example, the largest order is 1.00 lot: the part is not more than 0.12-0.17. In a grid with growing orders the largest order is the closest to the price, the limit is calculated from it, not from the farthest one. If an order is smaller than the part, it is closed whole. The part is not scaled to the deposit: how and when the volumes are raised - the main manual, section 4. The EURUSD spread is 13 points: TakeProfit is at least 39 points, otherwise slippage can turn the closing into a loss.
Why is the last round closed in full? When one part of the position is left, the EA closes everything at once: the rest and all averaging orders. Overlap and opening the second direction are not used at this moment, so that no extra averaging orders are left on the account after the end.
4. RECOVERY GRIDS AND AVERAGE ORDERS SETTINGS
This section controls averaging orders: when, in which direction and with what volume they open.
| Input | What it does |
|---|---|
| "Trend filtering for average orders" | When to open an averaging order. "Simple Grids" - strictly by step. "Bulls Bears Candles Filtering" - by step, but only after a candle of the right color: a rising candle - Buy, a falling candle - Sell. "AW Trend Predictor Filtering" - the first order by the trend indicator signal, the next ones by step (section 7). |
| "Allowed types of average orders" | "Buy and Sell orders" - both directions. "Buy orders" or "Sell orders" - only one. "Without opening" - the EA does not open averaging orders itself and only closes parts; averaging orders are then opened with the panel buttons. |
| "Volume of first average order" | Volume of the first averaging order of each direction, in lots. |
| "Multiplier to volume" | Each next averaging order of the same direction is this many times larger than the previous one. 1 - all orders have the same volume. |
| "Step for average" | Distance in points that the price must move against the last averaging order for the next one to open. For the first order - the offset from the middle of the position (half a step in each direction). |
| "Multiplier to step" | Each next step is this many times larger than the previous one. 1 - the step is constant. |
"Volume of first average order" = part × 2 (1.5 to 2 is fine; the base is 0.06 with a part of 0.03)
"Step for average" = ATR(14) on D1 in points / 2 (divisor 3 or 4 - faster and with a higher load)
Example with the volume multiplier. "Volume of first average order" 0.01, "Multiplier to volume" 1.3: the second order is 0.01 × 1.3 = 0.013, the terminal accepts only 0.01. The EA remembers the real calculation, so the third order is calculated from 0.013: 0.013 × 1.3 = 0.0169, rounding gives 0.02. If the calculated volume is not larger than the largest order already open, the EA takes the largest one and multiplies it by the multiplier.
Example with the step multiplier. "Step for average" 100, "Multiplier to step" 1.5: the second order opens 150 points from the first (100 × 1.5), the third 225 from the second, the fourth 338. The basket grows slower and has fewer orders.
The ATR divisor is chosen by risk:
| Risk | Step | What changes |
|---|---|---|
| High | ATR / 4 | more orders, faster recovery, larger drawdown during work |
| Medium | ATR / 3 | the middle between the two extreme options |
| Low | ATR / 2 | fewer orders, longer recovery, lower deposit load |
The step calculation is explained step by step, with a table for different instruments and digit counts, in the main article: HERE, section 4. The indicator value is converted to points: on EURUSD 0.00700 = 700 points, on XAUUSD with two digits 42.58 = 4258 points. With brokers that quote gold with a different number of digits (three or four), all point inputs - step, TakeProfit, slippage, spread - are multiplied by 10 or 100.
Why did the next averaging order not open after the set step? In "Bulls Bears Candles Filtering" mode, after the step the EA waits for a candle of the right color. In "AW Trend Predictor Filtering" mode, the first order of the basket opens by the indicator signal without a step, and the next ones by step; with "Averaging only by trend direction" also only while the trend points toward the basket. One more limit is "One Opened Order per Bar filtering" in section 5: no more than one order per direction per candle.
5. PROTECTION SETTINGS
| Input | What it does |
|---|---|
| "One Opened Order per Bar filtering" | On - no more than one averaging order of one direction per candle of the current timeframe. With this option the chart timeframe sets the pace of work. Off - an order opens as soon as the conditions are met, there are more orders, recovery is faster and riskier. |
| "Multidirectional trading" | On - while a basket of one direction is open, the EA can open averaging orders in the other direction, for example when the market reverses. The directions close independently. Off - a new direction opens only after the previous one is closed. The second direction does not open on the last part of the position. |
| "Maximum slippage in points" | Allowed slippage when closing orders. |
| "Maximum spread in points" | If the current spread is not less than this value, the EA does not open new orders. Closings are done at any spread. |
| "Maximum volume of average order" | Volume cap for one averaging order and for an order opened with the panel buttons. Limits the volume growth from "Multiplier to volume". |
| "Maximum number of average orders" | How many averaging orders of one direction can be open at the same time. When the limit is reached, new orders of this direction do not open until the basket closes. |
| "MagicNumber of average orders(Should be unique)" | MagicNumber of the EA's averaging and locking orders. It must differ from the MagicNumber of other EAs on the account. |
| "Use full commission when calculating" | For accounts where, at a partial close, the broker charges commission on the whole remaining order, as for a new order: 0.10 closed from 1.00 lot - commission as for the whole order. true - the EA includes this commission in the calculation of each partial close; the commission size is taken from "Comission per 1 Lot(0-no comisions)", without it this input changes nothing. Most accounts need false. |
| "Comission per 1 Lot(0-no comisions)" | Broker commission per 1 lot in the deposit currency. The EA subtracts it from the profit of each order when calculating closings. 0 - commission is not counted. Swaps are always counted, there is no need to set them separately. |
| "Notifications at launch and end of work" | On - Alert, Push and Email when the EA leaves sleep mode (with the current drawdown) and when the last order of the position is closed (with the balance). Push and Email arrive only if they are set up in the terminal: Tools - Options - Notifications and Email. |
| "Confirmation window for "Close All" button" | On - the Close All button on the panel asks for confirmation first. Off - it closes at once. There is no confirmation window in the tester. |
| "Open Average orders via Panel" | Which orders the Open Buy and Open Sell buttons on the panel open. On - averaging orders: the EA manages them as its own and uses them to close parts. Off - the orders go into the position for recovery; this is how a losing position is built in the tester. |
| "Show Possible Closures panel" | On - the panel shows the Possible Closures block with the Reduce Volume button. Off - no block, and its calculation is not done. |
Commissions in MT5. In MT5 a position has no commission field, as it had in MT4: the commission is visible only in the deal history. So for accurate partial closes it is set with the "Comission per 1 Lot(0-no comisions)" input. On accounts without commission the input is left at 0.
6. GRAPHICS SETTINGS
| Input | What it does |
|---|---|
| "Color Cheme for Panels" | "Dark scheme" or "Light scheme" - panel colors for a dark or light chart. |
| "Show closed profit on chart" | A label with the result of each closing on the chart. "Not Used" - no labels. "Show text on chart" - as text. "Show images on chart" - as a badge. |
| "Panel style" | "Canvas panel (rasterized)" - the new panel, drawn as a raster image, scaled for the monitor. "Simple panel (standard chart objects)" - the simple panel made of standard chart objects, as in versions before 4.00. "Do not show Advisor Panel" - no panel; the EA works the same way, there are no buttons. Both panels in detail - in the panel article. |
| "Panel size (Canvas panel)" | Size of the new panel: "Auto" (by monitor DPI), "Small (100%)", "Medium (125%)", "Large (150%)". Does not affect the simple panel. |
| "Font size (Canvas panel)" | Font size of the new panel with the same options; "Auto" follows the panel size. |
| "Show line of possible zone for closures" | true - the "Buy TP Zone" and "Sell TP Zone" lines: the approximate price from which closing can start. This is a zone, not an exact level: the line calculation does not include commissions and current volatility, so closing can happen both before and after the line. |
| "Open lots for panel buttons" | Volume in the Order Size field when the EA starts. After that the volume is changed on the panel with the arrows or by typing. |
Besides labels and zones, the EA draws a line of the next averaging order with the label "First Average order" or "Next Average order" and the volume: the next order opens by step from this price. In "Bulls Bears Candles Filtering" and "AW Trend Predictor Filtering" modes there is no line, because one step is not enough to open an order.
7. AW TREND PREDICTOR FILTERING SETTINGS
This section works only with "Trend filtering for average orders" = "AW Trend Predictor Filtering". In other modes the indicator is not created and not calculated.
| Input | What it does |
|---|---|
| "AW Trend Predictor timeframe" | The period on which the indicator looks for the trend. Set it higher than the chart: chart M15 - filter M30 or H1. In the ready sets the chart is M30 and the filter is H1. |
| "Amplitude AW Trend Predictor" | Sensitivity of the indicator. The larger the value, the rarer the signals and the slower the filter reacts to a reversal. The smaller the value, the more frequent the signals. The indicator replaces values below 1 with 1. |
| "Signals of AW Trend Predictor" | Condition for the first order of the basket. "First trade at trend reverse" - only on a new reversal signal: one basket per trend, fewer trades. "First trade by trend direction" - at any moment in the current trend direction: after the basket closes, the next one can open at once, more trades. |
| "Averaging with Trend Predictor filtering" | Condition for the next orders of the basket. "Averaging only by trend direction" - only while the trend points toward the basket. "Averaging in any direction" - by step, regardless of trend changes. |
Comparison of the three "Trend filtering for average orders" modes:
| Mode | When an order opens | Character |
|---|---|---|
| Simple Grids | strictly by step | medium aggressiveness, orders strictly by step |
| Bulls Bears Candles Filtering | by step and the color of the previous candle | works on corrections, in some situations the most aggressive |
| AW Trend Predictor Filtering | by the indicator signal | the strictest filtering, the fewest orders |
8. Which inputs affect risk the most
| For more aggressive work | For calmer work |
|---|---|
| larger "Volume of first average order" and "Multiplier to volume" | "Multiplier to volume" closer to 1 |
| smaller "Step for average" (ATR / 4) | larger "Step for average" (ATR / 2), "Multiplier to step" above 1 |
| larger "Part to close from a loss-making position" | smaller part: the losing order is divided into 8 or more parts |
| "One Opened Order per Bar filtering" = Off | "One Opened Order per Bar filtering" = On and a higher timeframe |
| "Multidirectional trading" = On | "Multidirectional trading" = Off |
| "Bulls Bears Candles Filtering" | "AW Trend Predictor Filtering" with a higher filter timeframe |
How these inputs work on real history, with test figures and ready set files for EURUSD, XAUUSD and BTCUSD - in the main article: HERE.
Buy AW Recovery EA:
MT5 version
👉 https://www.mql5.com/en/market/product/49692
MT4 version
👉 https://www.mql5.com/en/market/product/49453

AW Trading Software


