TradingView Backtest & Robustness Lab

MFE and MAE Explained: Improve Exit Analysis in Backtests

MFE and MAE Explained for Backtest Exit Analysis | SG Group

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
About 13 min read Updated July 13, 2026 Intermediate to advanced · exit-rule review

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.

Single-trade price path with MFE, MAE and exit One long trade’s price path. Entry 100.00, intratrade high 103.20 is the MFE, low 98.80 is the MAE, exit 101.50 is the realized result. All values are fictional, illustrative data for education. Single trade path: entry / MFE / MAE / exit (fictional data, long) 103 100 99 Time in trade → entry 100.00 MFE +3.20 (1.60R) MAE −1.20 (−0.60R) entry high = MFE low = MAE exit 101.50
Figure 1: one long trade’s price path. Against an entry of 100.00, the intratrade high of 103.20 is the MFE (+3.20 = 1.60R), the low of 98.80 is the MAE (−1.20 = −0.60R), and the exit of 101.50 is the realized result (+1.50 = 0.75R). Only part of the peak open profit was booked at the exit. All figures are fictional, illustrative data for education, not recommended values.

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.

Point: coarse bars hide the extremes. The finer the bars, or the more complete the intratrade price series, the more stable your MFE/MAE estimates, but historical ticks are not always available. Stay alert to whether the values you obtained are understated.

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.

MFE-versus-realized scatter plot Horizontal axis MFE in R-multiples, vertical axis realized result in R-multiples. The diagonal is the ideal line where you capture the open profit; below the horizontal zero line is a loss. Ten fictional trades are shown as circles for winners and triangles for losers. MFE vs realized (fictional data, 10 trades, R-multiples) +4R 0 −2R 0 MFE 2R MFE 4R ideal capture line (realized = MFE) T1 T2 T3 T4 T5 T6 T7 T8 T9 T10 winning trade losing trade ideal capture line
Figure 2: MFE-versus-realized scatter plot (10 trades of fictional, illustrative data). The green dashed line is the ideal where you captured the open profit in full; the red dashed line is zero. The farther a point sits below the ideal line, the more you left behind, and points below zero ended as losses. Beyond color, winners are circles and losers are triangles.

Four ways to read it

Depending on where the points cluster, this scatter plot splits your exit behavior into four readings.

  1. 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.
  2. 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.
  3. 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.
  4. 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 “—”.

Table 1: MFE, MAE, realized result and exit efficiency for 10 trades (fictional data, R-multiples)
TradeDirectionMFEMAERealizedExit efficiencyReading
T1Long2.40−0.501.9079%Captured well
T2Long3.10−0.800.6019%Gave back profit
T3Short1.80−0.401.5083%Captured well
T4Long0.90−1.60−1.20Stopped out flat
T5Short2.60−0.600.4015%Gave back profit
T6Long1.20−0.301.0083%Small but steady
T7Long2.00−1.90−0.90Wide stop
T8Short3.40−0.702.9085%Captured well
T9Long0.70−0.200.5071%Small but steady
T10Short1.50−1.20−0.80Stopped 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.

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.

MFE and MAE four-quadrant map Vertical axis MFE, higher means open profit runs further; horizontal axis MAE, further right means deeper adverse movement. Each of the top-left, top-right, bottom-left and bottom-right quadrants carries an exit-diagnosis focus. A conceptual diagram with fictional, illustrative data. MFE and MAE four-quadrant map (fictional data, conceptual) MFE high MFE low MAE shallow MAE deep High MFE, shallow MAE Runs far with shallow adverse moves. Efficiency is easy to lift if nothing is left behind. Test room to let winners run. High MFE, deep MAE Runs far but the adverse move is deep. Stop width and trailing are hard to design. Re-check whether it is worth sitting through. Low MFE, shallow MAE Little range. Small but steady, though costs need watching in this group. Confirm it stays positive after costs. Low MFE, deep MAE Does not run yet the adverse move is deep. The entry edge itself may be thin, before any exit change. Revisit entry rules.
Figure 3: the MFE and MAE four-quadrant map (conceptual, fictional data). MFE runs vertically, MAE horizontally. Each quadrant is a focus for diagnosis, not a verdict. In particular, “low MFE, deep MAE” is a region where you should question the entry edge itself before adjusting the exit.

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.

Exit efficiency = realized result ÷ MFE (for a long, (exit − entry) ÷ (high − entry)). Closer to 1.0 means you captured the open profit; closer to 0 means you left more behind.

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.

Exit-efficiency frontier, conceptual Horizontal axis is the average MAE you tolerate, meaning stop width; vertical axis is average realized R. Exit-rule candidates A to E are plotted as points, with a curve showing the frontier where the two cannot both improve. A conceptual diagram with fictional, illustrative data. Exit-efficiency frontier, conceptual (fictional data) high low average realized R stop width (average MAE tolerated) → wider frontier (the trade-off boundary) A too tight: cuts winners B C D E too wide: losses grow
Figure 4: the exit-efficiency frontier, conceptual (fictional data). Exit-rule candidates A to E, produced by varying stop and trailing width, are arranged with tolerated stop width on the horizontal axis and average realized R on the vertical axis. The too-tight A and too-wide E both give up realized R, while B and C sit near the trade-off boundary. This illustrates the concept and does not recommend any particular setting.

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.

Static worked example (when JavaScript is off): for a long with entry 100.00, intratrade high 103.20, low 98.80 and exit 101.50, MFE = 103.20 − 100.00 = +3.20, MAE = 98.80 − 100.00 = −1.20, and realized = 101.50 − 100.00 = +1.50. Exit efficiency = 1.50 ÷ 3.20 = about 47% (a little under half of the open profit realized). For a short the favorable direction reverses, so compute MFE = entry − low, MAE = high − entry and realized = entry − exit.

Estimate MFE, MAE and exit efficiency

The favorable direction affects the result
Price you opened the position
Highest price during the holding window
Lowest price during the holding window
Price you actually closed at
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.

In other words: MFE/MAE is a map that tells you where to test, not an answer that says “place it here and you will win.” Use the map to form a hypothesis, then confirm it with OOS data, costs and regimes, in that order, as your practical defense.

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).

Table 2: average MFE/MAE and exit efficiency by direction and session (fictional data, R-multiples)
SegmentTradesAvg MFEAvg MAEAvg realizedAvg exit efficiencyFocus
Long · Tokyo421.60−0.900.7044%Under-capturing
Long · London552.30−0.801.4061%Relatively strong
Short · London482.10−0.701.3062%Relatively strong
Short · New York391.40−1.100.3021%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?

Frequently asked questions

What do MFE and MAE stand for?
MFE stands for Maximum Favorable Excursion, the largest unrealized profit a trade reached while it was open; MAE stands for Maximum Adverse Excursion, the largest unrealized loss it endured. Both are measured from the entry price and track how far the intratrade high and low swung before the exit. You can express them in price units, pips or R-multiples, and you read them alongside the realized result to diagnose your exit rules.
Do the formulas differ for long and short trades?
The signs flip because the favorable direction is reversed. For a long, MFE = intratrade high minus entry and MAE = entry minus intratrade low. For a short, the favorable direction is downward, so MFE = entry minus intratrade low and MAE = intratrade high minus entry. If you mislabel direction, MFE and MAE swap, so always confirm the trade-direction column before you aggregate.
What data is required to compute MFE and MAE?
You need each trade’s entry and exit price plus the intratrade high and low. If your trade list does not already store the peak unrealized profit and loss, reconstruct them from a price series with enough granularity across the holding period. Coarse bars can miss the true extremes and understate both MFE and MAE, so check the input requirements of whichever analysis tool you use.
What does a large MFE but small realized profit suggest?
It suggests you may not be capturing enough of the open profit. Common causes are taking profit too early or giving back gains after the trade has run. One trade alone can be luck, so confirm with a scatter plot whether the same high-MFE, low-realized pattern repeats across many trades. It flags your trailing or take-profit placement for review, but decide with costs and sample size in mind rather than optimizing mechanically.
Can MAE determine a stop-loss distance?
It can inform the decision, but do not fix a stop-loss from the MAE distribution alone. Even if many past trades ended with only shallow adverse movement, there is no guarantee future trades stay within the same range. Tightening the stop can cut winning trades, while widening it increases risk. Re-test across out-of-sample periods, costs and regimes, and weigh the choice together with risk of ruin and drawdown.
How is exit efficiency calculated?
A common definition is realized result divided by MFE, the share of the open profit you actually captured. For a long that is (exit minus entry) divided by (high minus entry). When MFE is zero or negative the denominator is undefined, so exclude or handle those trades separately. Some implementations base the denominator on MAE instead, so confirm you are comparing the same definition.
Do MFE and MAE include trading costs?
Standard MFE and MAE are raw price excursions, so they exclude spread, commissions and slippage. When you evaluate exit efficiency or realized results, compare against cost-adjusted profit or you will overstate how much you captured. Cost modeling is covered in a separate lesson, and MFE/MAE analysis is most practical when read together with cost-sensitivity checks.
Is MFE/MAE analysis available on the free plan?
Exit diagnostics such as MFE/MAE, the exit-efficiency frontier and session optimization are Premium use cases. The free plan covers core analysis and visualization such as KPIs, equity, drawdown, Monte Carlo and risk of ruin, so start by importing your backtest to see the whole picture, then compare features on the plan page once you need to dig into exits.
Disclaimer: this article and the tool provide descriptive aggregation, diagnostics and visualization of backtest data you load, as educational and informational content. They are not investment advice, a buy or sell signal, a forecast of future prices, or a guarantee of profit. All numbers and figures shown are fictional, illustrative data for education and do not represent real performance or recommend any take-profit width, stop-loss width or parameter. Backtest results do not guarantee future performance and change with assumptions, data, costs and market regime. Final decisions are your own responsibility. TradingView interface names and specifications can change, so verify the latest details on the official pages. SG Group does not claim any partnership or endorsement with TradingView.