Backtesting guide

Maximum Adverse Excursion (MAE) & MFE in Trading

Maximum Adverse Excursion (MAE) is a quantitative trading metric that measures the greatest peak unrealized loss experienced by a trade from its entry price before the position is closed, while Maximum Favorable Excursion (MFE) measures the peak unrealized profit reached during the life of the trade.

Read the practical guide

Key Takeaways

  • Introduced by John Sweeney in 1992, MAE analysis provides an objective method to set optimal stop-loss levels based on empirical trade excursion data.
  • MFE (Maximum Favorable Excursion) measures whether a trading strategy effectively captures price trends or gives back significant open profit before exiting.
  • Plotting MAE on a scatter plot against final trade profit reveals the natural threshold where winning trades rarely travel into deep drawdown.
  • Setting a stop-loss just beyond the cluster of winning trade MAE cuts losing trades without prematurely exiting winning trades.

What is Maximum Adverse Excursion (MAE) and MFE in trading

When evaluating trading strategies, looking only at the final closed trade profit or loss misses intra-trade price dynamics. A winning trade that gained $500 might have experienced an intra-trade drawdown of $1,200 before recovering. Maximum Adverse Excursion (MAE) quantifies this maximum open loss during each trade lifecycle. Maximum Favorable Excursion (MFE) measures the maximum open profit achieved before closing.

  • MAE Definition: The worst unrealized loss (peak adverse price movement) between trade entry and trade exit.
  • MFE Definition: The best unrealized gain (peak favorable price movement) between trade entry and trade exit.
  • Trade Efficiency: The ratio of realized profit to MFE indicates how effectively a strategy captures available market moves.

How to use MAE scatter plots to optimize stop-loss placement

The primary practical application of MAE analysis is scientific stop-loss calibration. By plotting every trade on a two-dimensional graph where the X-axis is MAE (expressed in dollars, points, or percentage) and the Y-axis is final realized P&L, clear patterns emerge:

  • Winning Trade Cluster: Observe where the vast majority (such as 90% or 95%) of profitable trades congregate on the MAE axis.
  • Optimal Stop Threshold: Place your stop-loss order just outside the winning trade MAE boundary.
  • Eliminating Bad Losses: Trades that experience adverse excursion beyond this boundary rarely recover to become winners, meaning tight stops cut losses without harming win rate.
  • Edge Preservation: Avoid arbitrarily tight stops that choke winning trades in normal market noise.

How to use MFE analysis to optimize take-profit targets

Maximum Favorable Excursion analysis reveals whether your exit rules leave money on the table or hold positions too long. If MFE data shows that winning trades routinely reach +4R in open profit but exit at only +1R due to lagging trailing stops, the strategy suffers from poor exit efficiency.

  • Profit Target Optimization: Identify clustering in MFE to establish fixed profit targets at empirical resistance levels.
  • Trailing Stop Tuning: Determine when to tighten trailing stops once a trade reaches a specific MFE milestone.
  • Loser Analysis: Identify trades that reached significant positive MFE but ultimately closed as losses, signaling a need for breakeven stop rules.

Calculating MAE and MFE from TradingView backtests

TradingView strategy tester logs intra-bar highs and lows for open positions. Reviewing individual trade excursions helps distinguish between robust entries and lucky recoveries that survived deep drawdowns only because no stop was in place.

  • Step 1: Export closed trade history containing entry price, exit price, intra-trade highest price, and lowest price.
  • Step 2: For Long trades: MAE = Entry Price - Lowest Low; MFE = Highest High - Entry Price.
  • Step 3: For Short trades: MAE = Highest High - Entry Price; MFE = Entry Price - Lowest Low.
  • Step 4: Generate MAE/MFE scatter plots to audit entry timing precision and stop efficiency.

Direct Pineify workflow

Plot MAE vs MFE scatter distributions from backtest trades

Pineify Backtest Deep Report automatically visualizes trade-by-trade Maximum Adverse Excursion (MAE) and Maximum Favorable Excursion (MFE) scatter charts from your TradingView trade CSV export.

Backtest Deep Report

Upload your TradingView CSV export to generate MAE vs MFE scatter plots and optimize stop-loss placement.

Analyze MAE / MFE

Boundary: Backtest Deep Report computes excursion statistics from historical trade logs; live market gap events and slippage must be accounted for independently.

This page is educational and does not provide investment advice. Backtests are hypothetical, depend on their data and assumptions, and do not guarantee future results. Trading can result in substantial loss.

Frequently Asked Questions