MFE and MAE Explained: Improve Exit Analysis in Backtests
Backtest Learning · BT08
MFE and MAE Explained: Improve Exit Analysis in Backtests
Once your entry logic is settled, the next room to improve is usually the exit. By reading each trade’s maximum favorable excursion (MFE) and maximum adverse excursion (MAE) beside its realized result, you can see where take-profit, stop-loss and trailing rules leave value on the table. This guide moves from definitions to formulas, scatter plots, exit efficiency and a hands-on calculator.
- What MFE and MAE mean, and the units used: price, pips or R-multiples
- Long and short formulas that avoid sign confusion, and the data you need
- The MFE-versus-realized scatter plot and four exit patterns it reveals
- How to define exit efficiency, and why mechanical TP/SL tuning is risky
Key takeaways
- MFE is the largest open profit during a trade, MAE the largest open loss. Both are measured from entry, in price, pips or R-multiples.
- The favorable direction flips between long and short, so switch the MFE/MAE sign definitions by direction.
- An MFE-versus-realized scatter plot reveals four patterns: captured well, gave back profit, stopped out flat, and small but steady.
- Exit efficiency is commonly realized divided by MFE. Watch for zero or negative denominators and differing definitions.
- Do not mechanically pick an optimal TP/SL from MFE/MAE; re-test with out-of-sample data, costs, sample size and regimes.
Contents
This guide goes one step beyond the trade list in a backtest and uses each trade’s journey while it was open, the peaks of open profit and open loss, to diagnose your exit rules. It is written for intermediate and advanced users whose entry logic is largely settled but who want to test where take-profit, stop-loss and trailing behavior can improve. We start with the answer, then move through definitions and formulas, required data, scatter and quadrant reading, exit efficiency, the calculator, the danger of mechanical optimization, and segment analysis. If you want to see how this fits the broader picture, the complete TradingView backtesting workflow puts each diagnostic in context.
The 30-second answer
MFE (Maximum Favorable Excursion) is the distance price moved in your favor at its best point while a trade was open, and MAE (Maximum Adverse Excursion) is how far it moved against you at its worst. Both are measured from the entry price, and both are separate from the realized result you actually booked at the exit. Line up these three numbers, MFE, MAE and realized, for each trade, and you can see in figures how much of the open profit you captured and how much adverse movement you had to sit through.
Using them is simple. If many trades show a large MFE but a small realized result, you may be taking profit too early or giving gains back before you close. Conversely, if many trades show a deep MAE yet still win, your stop may be so wide that you are being rescued by luck. As the rest of this guide stresses, though, these are only the start of a hypothesis: deriving a mechanically optimal take-profit or stop-loss straight from MFE/MAE is dangerous. Do not conclude from a single metric; re-confirm across out-of-sample periods and cost assumptions.
What MFE and MAE mean, and their units
Let us define the terms carefully. For one trade, consider the holding window from entry to exit. The gap between the most favorable level price reached in that window and the entry price is the MFE; the gap between the most adverse level and the entry price is the MAE. You can read MFE as “the largest open profit you could have taken” and MAE as “the largest open loss you had to endure.”
Choose the unit by purpose. It can be an absolute price distance (for example, 3.20), pips, ticks, or an R-multiple (normalized so that one unit of risk, the distance to your stop, equals 1R). If you want to compare across symbols and volatility levels, R-multiples tend to be fairer than raw price distance, but you must define R consistently, whether by the initial stop or by an assumed loss, or the comparison breaks down. From here on, unless noted otherwise, every number in this article is fictional, illustrative data for education, and R-multiples are the main unit.
Long and short formulas and signs
The biggest accident in MFE/MAE work is flipping the sign between long and short. Because the favorable direction reverses, the same “high and low” carry opposite meanings. Split the definitions by direction as below (these are price-distance formulas, before quantity and costs).
Long (buy)
- MFE = intratrade high − entry price
- MAE = entry price − intratrade low (a negative open loss as a value)
- Realized = exit price − entry price
Short (sell)
- MFE = entry price − intratrade low
- MAE = intratrade high − entry price (a negative open loss as a value)
- Realized = entry price − exit price
To turn these into actual profit or loss, multiply the price distances by quantity (lot size) and subtract costs such as spread, commissions and slippage. MFE and MAE themselves are raw price excursions and exclude costs, but when you compare them against the realized result you must line everything up on a cost-adjusted basis, or you will overstate exit efficiency. If you want a feel for the risk amount or lot size behind 1R, estimate the loss with the FX & CFD lot size calculator first, which makes normalizing to R-multiples easier.
The data you need and granularity traps
To compute MFE and MAE accurately, you need each trade’s entry and exit price plus the intratrade high and low. If your trade-list CSV already includes those extremes, you can use them directly; if not, you reconstruct them from the price series over the holding window. This is where granularity bites. Trying to measure a minute-scale swing when you only have daily bars will miss the true peak, and both MFE and MAE end up understated.
So it is not safe to claim that “a CSV alone always yields accurate MFE/MAE.” The required input format and granularity depend on the analysis tool, so verify the input requirements before you rely on the numbers. Understanding how to pull the trade list itself pairs well with the metrics discussed around how to read backtest results, which makes it easier to judge which columns you need before stepping into exit analysis.
Reading the MFE-versus-realized scatter plot
You cannot read a tendency from a single trade. Put many trades on a scatter plot and read the distribution. The most basic version puts MFE on the horizontal axis and the realized result on the vertical axis. Points where the two are equal fall on the diagonal, the ideal line where you “captured the full open profit.” How far a point sits below that diagonal is the size of what you left behind.
Four ways to read it
Depending on where the points cluster, this scatter plot splits your exit behavior into four readings.
- Near the ideal line (captured well): MFE is large and the realized result is close to it. Like T8 and T1, this group captured most of the open profit cleanly.
- Far below the ideal line (gave back profit or took profit too early): MFE is large but the realized result is small. T2 (MFE 3.1R, realized 0.6R) and T5 (2.6R, 0.4R) are typical: either profit was taken early or given back after the trade ran.
- Below the zero line (stopped out flat): MFE was small to begin with and the result is negative. T4, T7 and T10 barely moved in your favor before hitting the stop.
- Small wins at lower left (small but steady): both MFE and realized are small, but reliably positive. Like T6 and T9, these produce modest ranges yet stay ahead of costs. If frequent, they can be a steady source of return.
The table below is the fictional data behind that scatter plot. Exit efficiency (realized divided by MFE) is computed only when MFE is positive, and losing trades show “—”.
| Trade | Direction | MFE | MAE | Realized | Exit efficiency | Reading |
|---|---|---|---|---|---|---|
| T1 | Long | 2.40 | −0.50 | 1.90 | 79% | Captured well |
| T2 | Long | 3.10 | −0.80 | 0.60 | 19% | Gave back profit |
| T3 | Short | 1.80 | −0.40 | 1.50 | 83% | Captured well |
| T4 | Long | 0.90 | −1.60 | −1.20 | — | Stopped out flat |
| T5 | Short | 2.60 | −0.60 | 0.40 | 15% | Gave back profit |
| T6 | Long | 1.20 | −0.30 | 1.00 | 83% | Small but steady |
| T7 | Long | 2.00 | −1.90 | −0.90 | — | Wide stop |
| T8 | Short | 3.40 | −0.70 | 2.90 | 85% | Captured well |
| T9 | Long | 0.70 | −0.20 | 0.50 | 71% | Small but steady |
| T10 | Short | 1.50 | −1.20 | −0.80 | — | Stopped out flat |
In this fictional data, the seven winning trades have an average exit efficiency of about 62%. T2 and T5 in particular fall below 20%, leaving most of a large open profit on the table. If such high-MFE, low-realized cases recur across the whole sample, your trailing rule or take-profit placement becomes a candidate for review. T7, meanwhile, shows an MAE of −1.90R, a case where a wide stop let the loss grow. Since how easily losses widen feeds directly into drawdown, reading this alongside maximum drawdown analysis gives a fuller picture.
Check the scatter plot and efficiency on your own trade list
The scatter plot and exit efficiency above make more sense on real data than in theory. Import your Strategy Tester CSV or XLSX and the free core analysis visualizes KPIs, equity and drawdown first. Once you need to dig into exits with MFE/MAE, the exit-efficiency frontier or session optimization, compare the Pro and Premium use cases.
The MFE/MAE quadrant map
Put MFE and MAE on two axes and split each into “large” and “small” to get four quadrants that broadly characterize a group of trades. The conceptual map below uses MFE (how far open profit tends to run) vertically and MAE (how deep the adverse move goes) horizontally. Each quadrant is not a verdict of good or bad but a question to check next.
High MFE, shallow MAE
Runs easily with shallow adverse moves. If nothing is left behind, this group has room to lift exit efficiency. First check whether you are giving open profit back.
High MFE, deep MAE
Runs far but the adverse move is deep too. Tightening the stop cuts winners, widening it raises risk. Re-check whether it is worth sitting through, together with costs.
Low MFE, shallow MAE
Small range, small but steady captures. Effective if frequency supports it, but always confirm a profit remains after costs are deducted.
Low MFE, deep MAE
Does not run, yet the adverse move is deep. Before adjusting the exit, question whether the entry has an edge. Pair this with parameter-stability checks.
Exit efficiency: definition and pitfalls
Exit efficiency (the flip side of what you leave behind) measures how much of the open profit you managed to realize. A common definition is as follows.
It is simple, but there are several pitfalls. First, zero or negative denominators. A trade that never moved in your favor has an MFE of zero, so the division is undefined. Bundling losing trades together as 0% efficiency distorts the distribution, so aggregate winners and losers separately, or restrict the read to trades whose MFE clears a threshold. Second, differing definitions across implementations. Basing the denominator on MAE instead of MFE, or including or excluding costs, changes what the same “efficiency” number means. When you compare tools or articles, confirm the definition matches. Third, the near-sightedness of chasing efficiency alone. The fastest way to push efficiency toward 100% is to close the moment any open profit appears, but that throws away the gains from trades that would run far, and can lower total expectancy. Efficiency is a supporting metric to read together with realized results and expectancy. The foundations of expectancy and profit factor are covered in how to read backtest results.
Estimate MFE, MAE and exit efficiency
For one trade, enter the direction, entry, intratrade high and low, and exit price, and this calculator returns MFE, MAE, the realized result and a simple exit efficiency. Inputs are computed entirely in your browser and no prices or personal data are sent anywhere. If JavaScript is disabled, see the static worked example directly below.
Estimate MFE, MAE and exit efficiency
- MFE (max open profit)
- +3.20
- MAE (max open loss)
- −1.20
- Realized result
- +1.50
- Exit efficiency (realized ÷ MFE)
- about 47%
The defaults are the long example. Change the values and press Calculate to update.
This estimate is an educational, price-distance view of a single trade and excludes quantity and costs. Real profit and loss depend on lot size, costs and the distribution across many trades. Do not judge an exit rule on a single trade’s efficiency alone.
Why mechanical TP/SL tuning is risky
Looking at an MFE/MAE distribution, it is tempting to think, “put the take-profit around the median past MFE and the stop out in the tail of the MAE distribution, and efficiency should be maximized.” But that is precisely hindsight fitting to past data. Adjusting TP/SL to past extremes yields parameters optimized to that period’s price action, with no guarantee they behave the same in the future.
The principles for avoiding the danger are the same as for any validation. First, always re-evaluate TP/SL candidates on out-of-sample (OOS) periods. See whether an exit chosen on in-sample MFE/MAE still holds on data you did not touch (the design is covered in walk-forward and out-of-sample testing). Second, reflect costs. The longer you let profit run, the longer you hold, which changes the impact of spread, swap and slippage (see cost sensitivity and stress testing). Third, sample size: a distribution drawn from few trades is at the mercy of chance. Fourth, regime: when volatility shifts, the appropriate width shifts too, so check whether behavior differs across market conditions.
Segmenting the analysis
Lumping all trades together buries important differences in MFE/MAE. Aggregating by direction, session, symbol and volatility band reveals where you leave the most behind. The table below is a fictional aggregation split by direction and session (imagine a larger fictional sample, separate from the 10 trades in Table 1).
| Segment | Trades | Avg MFE | Avg MAE | Avg realized | Avg exit efficiency | Focus |
|---|---|---|---|---|---|---|
| Long · Tokyo | 42 | 1.60 | −0.90 | 0.70 | 44% | Under-capturing |
| Long · London | 55 | 2.30 | −0.80 | 1.40 | 61% | Relatively strong |
| Short · London | 48 | 2.10 | −0.70 | 1.30 | 62% | Relatively strong |
| Short · New York | 39 | 1.40 | −1.10 | 0.30 | 21% | Needs review |
In this fictional example, London-session trades show exit efficiency around 60%, relatively high, while Tokyo-session longs and New York-session shorts run lower, suggesting either open profit left behind or deeper adverse movement. The important thing is that when you spot such a difference, you do not immediately add a session filter: first confirm whether the sample is large enough and whether a few outlier trades are dragging the numbers. A feature like session optimization is suited to examining such segment differences systematically, but all of these are past tendencies and do not guarantee the future. If you want the macro backdrop behind market conditions, an outside view such as the macro research workbench can help.
Practical checklist
- Did you define the MFE/MAE signs correctly for each direction (long or short), without mixing up the columns?
- Are you using the intratrade high and low for MFE/MAE? Are coarse bars missing the extremes?
- On the MFE-versus-realized scatter plot, did you check the four patterns: captured well, gave back profit, stopped out flat, and small but steady?
- Did you exclude or separately handle trades whose exit-efficiency denominator (MFE) is zero or negative, and are the definitions consistent?
- Instead of chasing efficiency alone, did you read it together with realized results, expectancy and drawdown?
- Did you re-test any TP/SL derived from MFE/MAE across out-of-sample data, costs, sample size and regimes?
- Did you split by direction, session, symbol and volatility, and check sample size and outliers?

