General Advisor Strategy Description 

Advisor "AW Recovery EA" is used to restore losing positions on the trader's account.

The EA locks * a losing position, and then opens averaging * orders. The losing position is virtually divided into small parts, each of which is closed separately. Using partial closure * allows you to load less deposit and make the recovery process safer.

  • Locking is the alignment of orders of type Buy and Sell in volume. Locking is used to fix the loss in the current position, if the volumes are the same, then when the price changes, the loss will remain at the previous value. If there is a locked position, the loss increases due to the accrual of swaps from the broker, this should be taken into account when calculating risks.
  • Averaging orders are orders that the adviser opens in order to restore a losing position with the help of their profit. Averaging orders can also be opened by yourself using the EA panel.
  • Partial closing - when closing, the EA does not close orders entirely. That is, if there is an order with a large volume, the EA will virtually divide it into small parts and will not close the entire volume at once, but will close the order in parts. For example, an order of 1.00 lots can be closed in parts of 0.10 lots or for example, 0.05 lots.

The EA includes an intelligent system for closing averaging orders. In this algorithm, the basket of averaging orders is not completely closed, as is usually the case. Only the very first and most recent of the averaging orders closes. This is done in order to less load the deposit. Since at each closing of averaging orders, part of the losing order is also closed. It is used if there is no need to close the entire basket, so the adviser can close only that part, which will reduce the total volume of the basket of averaging orders and reduce part of the losing position.

For example - If the number of averaging orders is more than 3, then the EA will not close all 3 at once, but will close only the very first one that it opened and the very last. The remaining orders will be closed later when the next averaging orders open. In addition to averaging orders, the EA will close in part from the losing position.

How the EA opens averaging orders

The EA opens averaging orders with a distance equal to "Step for average", the first averaging order is equal to the volume "Volume of average order",   the following averaging orders will differ by the "Multiplier to volume" coefficient. A trader can choose the type of orders that the EA can use, which is important for working with a trend. Also in the input settings you can use an additional trend filter for averaging orders. The AW Trend Predictor indicator is used as a trend filter. The first averaging order will be opened with the "Step for average" distance from the order that the EA will restore. The next averaging order will be opened by the advisor if the previous one is at a loss by "Step for average" points. If a trend filter is used, then through the "Step for average" points, the EA will start waiting for a signal from the trend indicator to open a new averaging order.

  • The EA opens no more than 1 order per 1 candlestick, which allows filtering strong market movements when economic news appears.
  • A trend filter can have a timeframe different from the current one; this option is available in the input settings.
  • Step for average - in this case, the distance can be dynamic, the step between the averaging can be determined taking into account the trend filter.
  • If the type of orders is not selected in the input settings, the EA will determine itself which type of averaging orders to use at each moment of the position recovery.

How an Expert Advisor closes a losing position

A losing position is closed in parts. The EA performs partial closing of orders in order to recover the loss. For example, we have a losing position of 1 lot. When launched, the EA locks the position, virtually splits it into several parts and closes each of them separately. That is, an order with a volume of 1 lot can be divided into 10 parts with a volume of 0.10, each of which will be closed separately. Partial closure allows you to consume less account resources, leaves more free funds and does not need to open large volumes. It is due to the partial closing of a losing position that the loss recovery process can be safer and more stable.

Setup Recommendations 

To configure the part to close:

When determining the volume of a part for closing an order, one should take into account the volume of a long-term unprofitable order, as the most difficult to close. For correct operation at an average risk level, it is desirable to virtually divide a losing order into about 6-8 parts. That is, if a long-range order has a volume of 1 lot, then the closing part can be from 0.16 lots to 0.12 lots. In some cases, this number can be changed in one direction or another.

" Part to close from a loss-making position " = volume of a long-range losing order / 6 or 8.

By setting up averaging orders:

The volume of the first averaging order must be no less than the closing part. I usually recommend a 1: 1.5 ratio. This parameter can be changed based on the available volumes, distance and current volatility. You can check different odds in the strategy tester and check which level of aggressiveness is right for you.

" Volume of average order " = "Part to close from a loss-making position" * 1.5.

By setting the step between orders:

Step between averaging orders. If the step is too small, the number of averaging orders will increase, which may increase the drawdown. If the step is too large, this can greatly slow down the recovery process. To understand the golden mean, you can see the adviser's recommendations based on the current volatility of the instrument, as well as testing this step in the strategy tester.

It depends on the instrument that is used, as different instruments have different daily volatility. The task of the trader to determine the average daily volatility. To do this, use the "Average True Range" (ATR) indicator on the "D1" (Daily) timeframe with a period of "14". It is necessary to determine the average daily volatility, while eliminating the abnormal behavior of the indicator (strong spikes or too calm sections of the chart).

On the example of the EURUSD chart image, it can be seen that the average daily volatility is 600-700 points.

Based on the data obtained by analyzing the chart of the instrument, we consider the variable " Step for average":

For high-risk trading, we take a small step between orders, then many orders will open. Divide the daily average volatility by 4. (650/4 = 163 " Step for average" ).

In order to use average risks, we divide the average daily volatility by 3 (650/3 = 217 " Step for average" ).

For low risks, we divide this indicator by 2 (650/2 = 325 " Step for average" ).

Drawdown Testing


Before starting the adviser, it is recommended to check the available settings in the strategy tester. For testing, you should run the EA in the "Visualization" mode.

If the "Visualization" checkbox is not visible, then try to stretch the window in height, at a low height the checkbox is hidden.


Choose the volume of the tested deposit similar to the available one.

The adviser should be started in power-on mode during a drawdown. To do this, set the variable " Type of the launch " = " Start at drawdown in money " in the input settings. The variable " Drawdown in money to start " will indicate which drawdown should be received in the deposit currency from processed orders in order for the EA to begin recovery.

Opening orders for their subsequent recovery:

It is advisable to use a similar volume or slightly larger than in a real situation.

Additional panel for testing 

When starting the strategy tester, the EA opens an additional panel with which you can open orders. The EA will restore orders opened using this panel of the order, which will allow testing various situations. If necessary, the start of recovery can be paused using the buttons on the main panel. After open the volume necessary for testing and take a break.

This way you can test your settings and see if they are appropriate for your situation and your risk strategy.

Testing if "Start at drawdown in money" mode is selected in the "Type of the launch" variable

Open the required order volume using the panel. When the loss from these orders reaches the one specified in the "Drawdown in money to start" variable, the EA will start recovery.

Preparing a deposit for the launch of the adviser

About deposit replenishment:

During testing, the relevance of replenishing the balance may be revealed. The fact that in order to fully recover a loss requires the availability of free funds not only for opening averaging orders, but also for locking a position, it should be borne in mind. In some cases, replenishment of the balance may be relevant, in some - not.

About manual closing of drawdown part:

In some cases, before launching the adviser, an understanding of the relevance of manually closing part of orders may arise. In such cases, it is advisable to close part of the excess orders, for example, to reduce the difference between BUY and SELL orders, which will reduce the opening volume of a locking order.

About other advisors:

If the terminal has running advisers that may conflict with "AW Recovery EA", then it is better to disable them in advance. If you have other advisers, it is better not to use locking.


If the orders have such handlers as trailing stop enabled, then it is better to disable them as well.

Launch and port to VPS 

During initialization, the adviser can lock the position.

If the adviser is launched in several places at the same time, you should limit its ability to trade in one of the terminals.

The possibility of duplication of locking orders, as well as averaging orders, can lead to an increase in the load on the deposit. It should be borne in mind the obligatory work of "AW Recovery EA" from only one place at a time.

When transferring the adviser to VPS, it should be noted that the settings are fixed only through the input settings menu. If some settings were applied in the input settings, and others were applied in the expert panel, the trading terminal will transfer data from the input settings to VPS without taking into account changes from the expert panel.

Wake up

Upon exiting the standby mode, the adviser performs a certain amount of actions that are aimed at fixing the position in the current position and preparing it for further processing. Here is a list of these actions:

  • Disabling other advisors is necessary in order to avoid conflict between orders. The adviser can disconnect all advisers from a similar symbol or from all symbols in general, which is important when using multi-currency algorithms. If there are orders on different pairs, AW Recovery should be launched on each.

For example, an Expert Advisor using TakeProfit and StopLoss was included. During its work, " AW Recovery EA" ensures that the processed orders do not have external StopLoss and TakeProfit ; upon detection, they will be deleted. If on each tick another adviser will install them, and " AW Recovery EA"   If they are deleted, then there is a possibility of limiting the operation of the account by the broker. Brokers monitor the maximum number of operations at a time and an abnormal excess of the allowable limit can cause the account to be limited for a couple of hours or your manager’s call from a brokerage company.

  • Removing TakeProfit, StopLoss levels, as well as pending orders to avoid accidental opening and closing orders.
  • Opening a lock order

Disabling other advisors 

When can I use AW Recovery with another advisor:

If locking is disabled, you can use AW Recovery together with other advisers. If the advisers have different MagicNumber or AW Recovery does not restore orders processed by other advisers, you can also use them together.

When you cannot use AW Recovery   together with another adviser:

In cases when permanent auto-locking is enabled, it is necessary to disable other expert advisors, and it is also necessary to ensure that AW Recovery only works from one place at a time.

How AW Recovery disables other advisors:

Three options are available in the Disable another EAs at launch variable:

  • Do not disable other advisors - Do not disable other advisors;
  • Disable advisors on same Symbol - Disable all advisors on the same symbol;
  • Disable advisors on all Symbols - Disable all advisors on all symbols.

Full list of input settings with comments

      • Type of the launch - A variable that determines the type of launch of the adviser, where:
      • Instant start - Start at the moment the EA is turned on. This means that the adviser will begin processing orders at the time of initialization.
      • Start at drawdown in money - Start when reaching the drawdown in money. This means that the adviser will analyze the processed orders from the moment of initialization, but will only be able to start trading operations when the drawdown from the processed orders reaches a certain amount in the currency of the trader’s deposit. Drawdown volume is changed in the variable " Drawdown in money to start ".
      • Drawdown in money to start - Drawdown volume in money after which the EA will start recovery.
      • First ticket for recovery (0-not used) - The ticket of the order that will be processed first.
      • Work with selected MagicNumber - Restore orders of the selected magic number. If you want to restore not the entire position on the current instrument, but only orders with a specific magic number, then select "True". If the value of the variable is set to "false", the EA will work with absolutely all orders opened on the current symbol.
      • Magic for recovery (if used) - Enter the magic number for the losing position. That is, the magic number of the advisor that made the drawdown. To restore a manually opened order in this variable, use the value "0".
      • Disable another EAs at launch - module to disable other advisers
      • Do not disable other advisors - Do not disable other advisors;
      • Disable advisors on same Symbol - Disable all advisors on the same symbol;
      • Disable advisors on all Symbols - Disable all advisors on all symbols.
      • Use locking - Enables automatic locking. If this variable is “true”, then the adviser will maintain a position in the castle, that is, equalize the volumes of purchases and sales among themselves so as not to allow the loss to increase and fix the position in a given position for further recovery. It acts not only at startup, but also during processing. When you enable this variable, you should limit the operation of other algorithms that process the same orders as "AW Recovery EA" in order to avoid possible conflicts between the algorithms.
      • Allowed types of average orders - Allowed types of averaging orders that the EA will open, where
      • Buy and Sell orders - Ability to open OP_BUY and OP_SELL types of averaging orders
      • Buy orders - Ability to open only OP_BUY type of averaging orders
      • Sell orders - Ability to open only OP_SELL type of averaging orders
      • Without opening - Do not open averaging orders, orders will be opened by another advisor (Magic and commentary of orders must match for correct identification)

      • Trend filtering for average orders - This variable controls the trend filters of the EA. The EA will open orders in accordance with the specified strategy only if there is an appropriate trend determined by one of the indicators. When using filters, the adviser analyzes the indicators on the current timeframe, therefore, the choice of timeframe affects the signals of the indicators and therefore the degree of filtering.
      • Volume of average order - The volume of the first recovery order, measured in lots.
      • Multiplier to volume - Multiplier for recovering orders. Each subsequent recovery order in the order grid will be greater than the previous one by a given coefficient. When using a small volume of orders and a small volume of the multiplier, the system also takes into account the number of orders, which allows high-quality multiplication when it is impossible to increase orders after basic normalization. It is undesirable to use values smaller than "1" without the availability of high-quality knowledge of the operation of pyrimidine order processing systems.
      • Step for average - Step between averaging orders. The variable that regulates the minimum step between recovery orders is measured in points. In the case of work without trend filtering, this is a step for opening orders. In the case of using trend filters, this is the minimum distance after which the system will wait for a signal from the trend filtering system to open a subsequent order.
      • Multiplier to step - Multiplier for the step of recovering orders. Using this multiplier, you can more flexibly approach the calculation of order volumes using the dynamic step of the order grid.
      • Part to close from a loss-making position - Part of the loss that will be closed from orders of each type when the position is partially closed. Determines how much will be closed with the help of profit from recovery orders. It is measured in lots.
      • TakeProfit in money for partial close - TP in money for the current group of orders. The profit from restoring orders is used, as well as the loss, which is part of the volume of " Part to close from a loss-making position " of lots from each type of order from a losing position.
      • Maximum slippage in points - Maximum slippage in points for opening and closing orders.
      • Maximum volume of average order - The maximum volume for one averaging order. It is measured in lots.
      • Maximum number of average orders - The maximum allowable number of averaging orders of the same type.
      • MagicNumber of average orders (Should be unique) - The main identifier for the averaging orders of the adviser. The magic number for averaging orders must be unique. In order for the orders of "AW Recovery EA" not to overlap with the orders of other advisers.
      • Font size - font size on the EA panel.
      Can I ask the price include both MT4 and MT5 or purchase separately?
      Is there any accounts limit for this EA can use at the same time?