Have you already developed a winning trading system that is profitable over time? Are you taking advantage of the full potential of your system? If you have some doubts to answer these questions, it is because you are probably not squeezing all the juice out of your strategy.

In this post I am going to teach you how to make the most of your trading system so that you can get the most profit possible. To do this we will analyze the results of our trading strategy using two metrics: MAE and MFE. Let’s see what each of these metrics developed by John Sweeney is about.

Contents

## 1. What is the MAE?

**MAE** is the acronym in English for *“Maximum Adverse Excursion”* which translated into Spanish means ” **Maximum Adverse Excursion** “. To the point and in a summarized way: it measures the maximum partial losses that an operation had while it was open.

Example (which is how it is well understood): if you carry out a purchase operation, the MAE is the difference between the entry price and the lowest price that the financial asset had from the opening until the operation was closed. In the case of opening a short operation, the MAE is the difference between the entry price and the highest price that the asset had from the opening to the closing of the operation.

The MAE is an extremely useful metric to define quantitatively where to place the optimal levels of losses (stop loss).

## 2. What is the MFE?

**MFE** is the acronym in English for *“Maximun Favorable Excursion”* which translated into Spanish means ” **Maximum Favorable Excursion** “. This metric measures the maximum partial profit of the trade while it was open.

Let’s take an example: if you open a buy operation, the MFE is the difference between the entry price and the highest price that the financial asset had from the opening until the operation was closed. In the case of opening a short operation, the MFE is the difference between the entry price and the lowest price that the asset had from the opening to the closing of the operation.

The MFE allows us to quantitatively define where to place the optimal levels of profit (take profit).

## 3. Initial considerations to use the MAE and MFE correctly.

Although these metrics are very useful to optimize our trading systems, we must understand their limitations.

The size of the sample or results to be evaluated from our system should not be less than 50 operations. A minimum number of operations close to 100 would be ideal.

There are several ways to measure MAE and MFE. You can measure it in pips in the case of Forex, dollars or euros per share in the case of the stock market, the total of dollars or euros per operation (base currency of our account), percentage with respect to the initial price, multiples of R …

If you develop a trading strategy that is going to operate in a single market, you will not have major problems interpreting the results and you can calculate them in pips or monetary units (euros or dollars) per share.

When your system operates in different currency pairs you must be careful when measuring these metrics because you must take into account the volatility of each currency pair where you want your trading system to operate. For example, you cannot compare 15 pips in the NZDUSD pair with 15 pips in the GBPJPY pair where the volatility is much higher.

To obtain more precise and objective results, we measure the MAE and MFE in percentage (%) with respect to the entry price.

## 4. How to calculate the MAE and MFE.

When we open a buy or sell operation, the price is constantly fluctuating in our favor or against us. In this way the operation reaches a maximum profit value and maximum loss until the operation is closed, either because it reached our take profit, stop loss or because it is closed due to market conditions in our system.

Surely this has happened to you: you open a trade, it goes against you, touches the stop loss and then goes in the direction of your analysis, reaching or exceeding your initial take profit level, but first it left you out of the market.

At other times, you notice that the price almost reaches your take profit level, but does not reach it. Then the price goes against you until you touch the stop loss, not only losing your potential partial gains, but also ending the operation with a loss.

This is because generally, when we start in the world of trading we focus on the net results of our operation, that is, if it produced a profit or a loss. But we do not realize that each operation provides us with a net result of the operation (profit or loss) and also two very important metrics: MAE and MFE. These two metrics will provide us with valuable information to optimize our trading system.

The formulas to calculate the MAE and the MFE are the following:

** MAE (%) = [(entry price – minimum price) / entry price] * 100 **

** MFE (%) = [maximum price – entry price) / entry price] * 100 **

To better understand how to calculate these two metrics look at this example:

Suppose we design a trading system that operates only on the EURUSD, we do the respective backtesting and obtain the following results:

(To facilitate calculations, the closing price will be equal to the take profit or stop loss that we place at the time of opening the operation).

Type of Operation Entry Price Minimum Price Maximum Price Closing Price MAE (Pips) MAE (%) MFE (Pips) MFE (%) Purchase Result 1,08200 1,07900 1.08350 1.07900.00 -30 -0.28 $ 15.00 0.14 Loser Buy 1.07525 1.07255 1.07805 1.07255.00 -27 -0.25 $ 28.00 0.26 Loser Sell 1.09950 1.09700 1.10101 1.09700.00 -15.1 -0.14 $ 25.00 0.23 winning Buy 1.06100 1.05910 1.06450 1.06450.00 -19 -0.18 $ 35.00 0.33 winning

Sell 1.10450 1.10340 1.10750 1.10750.00 -30 -0.27 $ 11.00 0.10 Loser Buy 1.08100 1.07900 1.08450 1.07850.00 -20 -0.19 $ 35.00 0.32 Loser Buy 1.09150 1.08980 1.09550 1.08980.00 -17 -0.16 $ 40.00 0.37 Loser Buy 1.10300 1.10200 1.10700 1.10700.00 -10 -0.09 $ 40.00 0.36 Winner Buy 1,09700 1,09500 1,10050 1,10050.00 -20 -0.18 $ 35.00 0.32 Winner

Buy 1,08700 1,08500 1,09100 1,08500.00 -20 -0.18 $ 40.00 0.37 loser

The analysis of our system gives us the following results:

Average MAE in Pips = -20.8

Average MAE in% = -0.19

Average MFE in Pips = 30.4

Average MFE in% = 0.28

% Success = 40

% failure = 60

Total Losses (pips) = 149

Total Profit (pips) = 135

Mathematical Hope = -1.4

The negative mathematical expectation of our system tells us that it is not profitable and if we implement it in a real account it would cause us losses. Now we use the MAE and MFE metrics to readjust the take profit and stop loss levels and see what happens with the results of our trading system. How do we do it? Very simple, as follows:

- To adjust the
**new stop loss level**of a buy operation, we multiply the entry price by the average value of the MAE (in percent). We are going to subtract this value obtained from the entry price and the result will be our SL. In the case of a sale operation, the result obtained is added to the entry price.

- For the
**new take profit level**of a purchase operation, we multiply the entry price by the average value of the MFE and this value is added to the entry price, thus we obtain the new TP. In the case of a sale operation, instead of adding the result we subtract it from the entry price.

The results are shown in the following table:

Take Profit |
Stop Loss |
G/P |

**Result**

1.08503 1.07984 -21.6 loser 1.07826 1.07310 -21.5 loser

1.09642 1.10170 30.8 Winner 1.06397 1.05888 29.7 Winner 1.10759 1.10671 -22.1 losing 1.08403 1.07884 30.3 winning 1.09456 1.08932 30.6 winning

1.10609 1.10079 30.9 Winner 1.10007 1.09481 30.7 Winner 1.09004 1.08483 30.4 winner

% of Success = 70

% failure = 30

Total Losses (pips) = 65.2

Total Earnings (pips) = 213.4

Mathematical Hope = 14.81

If we analyze these results, we can see that by using the MAE and the MFE to adjust the TP and SL levels, we have maximized the gains and reduced the losses. Now the mathematical expectation of our system is positive, which means that we transform a losing system into a winning system. It is important to note that the rules of our system did not change, we only changed the TP and SL levels.

Important clarification: doing this is optimizing our trading strategy, so it is recommended that you leave a percentage of the data out of sample (out of sample) to do a real backtest of your trading system and not fall into over-optimization.

## 5. Distribution of MAE and MFE.

When we analyze the results of our trading system using the data provided by our platform or software, it usually shows us a graph of distribution of points that reflects the profit obtained on one of its axes and the MAE or MFE on the other axis.

In the previous graph, a distribution of the MFE is shown, the green dots represent those operations that, while the operation was kept open, showed a partial profit greater than the final profit of the operation. This means that a take profit order was not used to fix profits.

In the previous graph, a distribution of the MAE is shown, the red points represent those operations, which during their duration had partial losses greater than the final loss. This means that the system does not use stop loss orders or that it is too far away and also tends to wait for the position to recover to compensate for losses. You do not limit them if the market goes against you.

## 6. Analysis of the MAE and MFE.

If you analyze the calculation formula for these metrics and their possible values we can deduce some interesting things:

- When we open a buy trade and the price immediately rises to touch our take profit without falling into the partial loss zone, then the
**MAE is equal to zero**. And in the case of a short trade, the price falls until touching the TP without ever exceeding the entry price. This would be the ideal scenario that every trader wants every time he opens a trade.

- If, on the contrary, the operation immediately turns against us and at no time does it orbit the partial profit zone, then in
**MFE it is equal to zero**.

- If the
**MFE is much higher than the profit from the operation**, this means that we are leaving money on the table. This is a clear sign that we are not closing operations at the right time. When this happens, it is best to place a trailing stop or trailing stop to protect the gains already made.

- If the
**MAE is too far from the entry price**, our tolerance to risk may be too high. This can be a clear sign that our trading system can be improved.

Finally, I tell you that it is a good idea to complement these metrics with the **ATR** (Average True Range) **indicator** because it shows us the volatility of the price when entering the market. This allows you to place profit and loss margins based on current volatility and not just as a fixed percentage. In this way, we avoid exiting the market early at times of higher volatility and at the same time allow us to tighten stops even more at times of lower volatility.

If you haven’t been applying this, don’t go crazy. Just keep them in mind and learn about it. It is about having more and better information about your trading systems.

Now I ask you, did you know these metrics? Do you apply them in your trading? Are you going to use them? I read you in comments!