What is maximum favorable excursion? MFE and MAE, explained

Maximum favorable excursion (MFE) and its mirror, maximum adverse excursion (MAE), are two of the most practical and least-known tools for improving a strategy’s exits. MFE measures the best unrealised profit a trade ever showed before you closed it; MAE measures the worst unrealised loss it dipped to. Together they answer questions a simple win/loss record cannot: are you leaving profit on the table, are your stops too tight, are your targets too greedy? This guide explains both metrics, what their patterns reveal, and how to compute them with code.

On this page
  1. What MFE and MAE are
  2. Why they matter
  3. What MFE reveals
  4. What MAE reveals
  5. Computing them in code
  6. Improving your exits
  7. FAQ

What MFE and MAE are

Maximum favorable excursion (MFE) is the largest unrealised profit a trade reached at any point while it was open. Maximum adverse excursion (MAE) is the largest unrealised loss it reached. Your final P&L is just one point on the path between them — MFE and MAE describe the whole journey of each trade, not only its destination.

Why they matter

Two trades can both close for +1%, but one calmly drifted up to +1% while the other first plunged to −4% and clawed back. The win/loss record treats them identically; MFE and MAE expose that the second was a near-disaster. This is the detail your trading journal should capture for every trade.

entry MFE (best) MAE (worst) exit
The exit is only one point; MFE and MAE capture the best and worst the trade ever showed.

What MFE reveals

If your winning trades routinely reach a high MFE but you exit far below it, your take-profit is too tight — you are leaving money on the table and could use a trailing stop. If MFE is barely above your exit, your targets are well-tuned.

What MAE reveals

MAE sizes your stop

Plot MAE across your winning trades. If winners rarely dip below, say, −1.5% before recovering, a −1.5% stop will not cut them short — but a tighter −0.8% stop would have killed many eventual winners. MAE tells you the smallest stop that survives your strategy’s normal noise, directly informing position sizing.

Computing MFE and MAE in code

python · excursion.pydef excursions(entry, highs, lows, side='long'):
    if side == 'long':
        mfe = (max(highs) - entry) / entry
        mae = (min(lows) - entry) / entry
    else:
        mfe = (entry - min(lows)) / entry
        mae = (entry - max(highs)) / entry
    return mfe, mae        # mfe >= 0, mae <= 0

mfe, mae = excursions(60000, trade_highs, trade_lows)
print(f'MFE {mfe:.2%}  MAE {mae:.2%}')

Improving your exits

Log MFE and MAE for every trade in your backtest, then aggregate them: tune your stop to the MAE of your winners and your target (or trailing logic) to the MFE distribution. It is a disciplined, data-driven way to refine exits without overfitting — run it on the backtester first.

Not financial advice. This content is educational. Automated and algorithmic trading carries a real risk of financial loss. Never trade money you cannot afford to lose. Review the SEC investor.gov and CFTC resources before trading.

Frequently asked questions

What is maximum favorable excursion?

Maximum favorable excursion (MFE) is the largest unrealised profit a trade reached at any point while it was open, before you closed it. It describes the best the trade ever looked, regardless of where it actually exited. Paired with maximum adverse excursion, it reveals the full path of each trade rather than just its final result.

What is the difference between MFE and MAE?

MFE is the largest unrealised profit a trade reached; MAE, maximum adverse excursion, is the largest unrealised loss it reached. MFE shows how far a trade moved in your favour and MAE how far it moved against you. The final P&L is one point on the path between them, so both together describe the whole trade.

How does MFE help improve exits?

If winning trades routinely reach a high MFE but you exit far below it, your take-profit is too tight and you are leaving money on the table — a trailing stop may capture more. If MFE is only just above your exit, your targets are well-tuned. Aggregating MFE across trades guides how greedy or conservative your exit should be.

How does MAE help set stop-losses?

Plot MAE across your winning trades to see how far they normally dip before recovering. If winners rarely fall below a certain level before turning around, a stop just beyond that level avoids cutting them short, while a tighter stop would have killed many eventual winners. MAE tells you the smallest stop that survives your strategy’s normal noise.

MB

Mustafa Bilgic

Algorithmic trading practitioner · Founder, AITradingBot.us

Mustafa builds and backtests automated trading systems and writes about them without the hype. Every tool on this site is free and runs entirely in your browser.