← Back to blog

Maximum Adverse Excursion: Calculate MAE Without Tick Data

October 16, 2026
Maximum Adverse Excursion: Calculate MAE Without Tick Data

Maximum adverse excursion (MAE) is the largest unrealized loss a trade experiences before it closes. Its counterpart, maximum favorable excursion (MFE), is the largest unrealized profit. You use MAE to size stop-losses, diagnose weak entries, and tune exit rules. John Sweeney, who developed the concept, argues MAE replaces intuition with quantitative analysis of loss points.


TL;DR:

  • Set stops just beyond a high percentile of winners’ MAE, then sweep several distances and include spread and slippage before choosing a level.
  • Use the finest price data that matches execution; bar highs and lows can overstate MAE because their price sequence within each bar is unknown.
  • Compare MAE with MFE: winners with deep adverse moves may have loose stops, while losing trades that reached profit may need trailing or partial exits.
  • For optimization, cap an MAE percentile at a tolerable live limit, then validate it on separate data because tuned stops can fail on new data.
  • For copy trading, calculate MAE from the follower’s executed fills, not the master’s signal, because latency and spread can deepen the follower’s adverse move.

Sonicaigold
Explore Automated Gold Trading
Sonic AI offers automated XAUUSD trade copying, giving investors a way to follow a managed gold strategy without extensive trading knowledge.
Visit Sonicaigold

Table of Contents

What MAE and MFE mean for a single trade

Every trade travels a path between entry and exit. MAE records the worst point on that path. MFE records the best. Neither depends on where you closed.

  • MAE: the largest move against your position from entry until exit. For a long, it is the lowest price reached below entry. For a short, it is the highest price reached above entry.
  • MFE: the largest move in your favor over the same window.
  • Units: record both in price points, ticks, account currency, or percent of entry. Pick one and keep it across the whole trade log.
  • Sign convention: store MAE as a positive distance (the size of the loss) so percentile math stays simple.

A quick example: you buy gold at 2,000.0 and it dips to 1,994.0 before rallying to 2,012.0, where you exit. MAE is 6.0 points and MFE is 12.0 points. The trade won, yet it carried a 6-point scare on the way.

How to calculate MAE step by step

You can compute MAE from tick data, one-minute bars, or any series that spans the trade. The steps are the same.

  1. Log each trade with an ID, direction, entry time and price, and exit time.
  2. Pull the price series between entry and exit. Use tick or bid/ask data if you have it. Otherwise use bar highs and lows.
  3. For longs, compute entry minus the lowest low. For shorts, compute the highest high minus entry. Floor the result at zero.
  4. Take that extreme value as the trade's MAE. Compute MFE the opposite way.
  5. Aggregate across trades: mean, median, and high percentiles.

In Excel, add helper columns for the window's minimum low and maximum high, using MINIFS and MAXIFS keyed to each trade's entry and exit timestamps. Then subtract from the entry price. In pandas, merge trade windows onto the price frame, group by trade ID, and take cummin of lows (or cummax of highs) relative to entry. The last value per group is your MAE.

Aggregation needs care when trades have uneven data density. Adverse-event researchers face a similar problem and recommend normalized summary metrics and time-aware measures so maximum values stay comparable. For trading, that means reporting MAE as a percent of entry or of average range, not only raw points.

Pro Tip: Store one row per trade with MAE, MFE, entry time, and exit time, and keep the raw price slices in a separate file keyed by trade ID so you can replay any outlier.

Turning MAE statistics into stops and exits

The core idea is simple: look at how far your winning trades went against you before they paid off. A stop placed inside that range would have killed trades that later won.

  • Stop sizing: take a high percentile of MAE among winners. A stop just beyond that level can keep many winners alive while cutting trades that behave unlike your winners.
  • Missed profits: check the MFE of your losers. If many reached a meaningful profit before reversing, a trailing stop or partial take-profit may help.
  • Trailing activation: set the activation level near the MFE where losers start to appear, so you protect gains without strangling normal swings.
  • Stop sweep: rerun the backtest across a grid of stop distances and record net profit, win rate, and average loss at each level. Look for the plateau, not the single best number.
  • Execution reality: add slippage and spread to the tested stop. A stop that works on bar data can behave differently when fills are worse than the signal price. Our own analysis of backtest versus live trading shows why matching signal to fill matters.

Illustrative example, not market data: say your winners show a 95th percentile MAE of 8 points and your current stop sits at 5 points. Roughly one winner in twenty would be stopped out at 8 points, but at 5 points a much larger share would be cut. Widening the stop to 9 points keeps nearly all winners while the average loss grows by 4 points. Whether that trade-off pays depends on how many losers you now hold longer, which is exactly what the sweep measures.

Sweeney's premise is that you set protective stops before the trade, using measured loss points, rather than deciding under pressure while it runs.

Reading the MAE vs MFE scatter plot

Plot MAE on the X axis and MFE on the Y axis, one dot per trade. Color winners and losers differently. Together the two measures define the "trade space," and patterns on this scatter show whether exits are efficient and where stop or take-profit rules need work.

  • Losers sitting high on the Y axis: these trades had real unrealized profit and gave it back. Add a trailing stop, a partial exit, or a take-profit near that MFE.
  • Winners far right on the X axis: they survived deep drawdowns. Your stops may be too loose, or the entry timing is poor even though the outcome was good.
  • Winners clustered near zero MAE: entries are clean. Tight stops are probably safe here.
  • Dots above the MAE = MFE line: trades moved more in your favor than against you. Dots below it spent more time hurting than helping.

Quadrants around that diagonal sort behavior quickly. Low MAE with high MFE is the ideal. High MAE with low MFE is a signal to review entries, since those trades rarely gave a chance to profit. Fix entries first, then stops, then exits, and retest after each change.

Common calculation choices that keep MAE reliable

Small methodology choices can shift your numbers more than the strategy itself.

  • Match data to execution. Use the finest series you actually trade on. If you use bar highs and lows, document that the true intra-bar path is unknown and the MAE may be overstated.
  • Report percentiles. A mean hides the tail. Use high percentiles for stop rules.
  • Avoid lookahead. When rebuilding the intra-trade series, only use data available between entry and exit, and never let the exit decision see a later low.
  • Make MAE a standard column. Log it with every trade and schedule a periodic check of the distribution.
  • Label consistently. A maximum metric is only useful when its format is uniform. Even a structured maximum-severity data dictionary from clinical reporting stresses consistent labels and formats, and the same discipline applies to trade logs.

Pro Tip: Keep serialized snapshots of the price data around your worst MAE trades so you can reproduce and inspect them after any code change.

How MAE relates to exit strategies in automated systems

In an automated system, the exit logic is code, so MAE becomes a direct input to parameters. A fixed stop, an ATR-based stop, a time stop, and a trailing stop each leave a different fingerprint on the MAE distribution. A fixed stop caps MAE at a hard ceiling, so your observed MAE never exceeds it. A time stop lets MAE drift but limits how long a trade can sit underwater.

The useful test is correlation. Compare MAE against trade duration and against final profit. If longer trades show larger MAE and weaker results, a time stop or tighter volatility filter may help. If MAE barely correlates with outcome, your stop is probably doing little work and could be loosened to cut whipsaws.

Exits also interact with MFE. A trailing rule that activates too early shrinks MFE on winners, which shows up as winners clustered at low Y values. A rule that activates too late leaves losers with large unrealized gains. Reviewing both metrics after each parameter change shows whether the rule shifts trades toward efficient behavior or just moves the loss somewhere else.

For gold (XAUUSD), volatility regimes change fast, so stops sized from one quiet month can fail in a news-driven one. Recompute the MAE percentiles over rolling windows and compare them. If a high percentile climbs steadily, your fixed stop is aging. For related reading, see our guide to a low drawdown strategy.

Adding MAE to performance evaluation and optimization

Profit factor and win rate say what happened. MAE says how uncomfortable the ride was and how much room the strategy needs. Add it to your scorecard alongside drawdown and expectancy.

Useful summary figures include median MAE and the ratio of average MFE to average MAE, alongside a high percentile of MAE. A rising ratio suggests entries are improving. Pair these with maximum drawdown: MAE is per trade, while drawdown is cumulative, and the two together show whether risk comes from one deep trade or many shallow ones. Our explainer on max drawdown for gold copy traders covers the recovery math, and the drawdown analysis guide goes deeper for engineers.

Per-trade MAE separated from cumulative drawdown

During optimization, treat MAE as a constraint, not only a score. Instead of picking the parameter set with the highest profit, require that a high percentile of MAE stay under a limit you can tolerate in live trading. This filters out sets that look strong only because they survive extreme excursions that real accounts could not hold.

Guard against overfitting. A stop tuned to a sample's exact MAE percentile may drift out of sample. Split your data, fit the percentile on one portion, and check that the next portion's MAE distribution looks similar. Wide gaps mean the rule rests on noise.

MAE in manual trading versus automated and copy trading

A manual trader feels MAE. Watching a position move against you invites early exits, moved stops, and hesitation, so the recorded MAE often reflects behavior as much as the strategy. That makes manual MAE noisy but informative about discipline: a stop pulled wider mid-trade shows up as an MAE larger than the plan allowed.

An automated system removes that variable. MAE then reflects the rules and the market, which makes the distribution cleaner and easier to compare across periods. A sudden shift in MAE with unchanged rules points to a regime change, slippage, or a data issue.

Copy trading adds a layer. The follower's fills differ from the master's, so follower MAE can exceed the master's once latency and spread enter. When you copy across accounts, measure MAE on the executed trade, not on the signal. Tools that handle multi-account execution matter here, and this piece on risk management in trading is a useful companion if you run your own copier.

Copied trade fills change measured MAE

If you want to see how this plays out on a live gold strategy, we publish results you can inspect on Sonic AI, where our team runs an automated XAUUSD approach through COPYX. Reading MAE on copied trades is easier when the strategy and its history are transparent.

Why we watch MAE on live copied gold strategies

Our view is that MAE belongs in a monitoring routine, not just a backtest report. For a copied strategy, it works best as one signal among several: drawdown tells you the cumulative cost, expectancy tells you whether the edge persists, and MAE tells you how much pain individual trades take to deliver it.

Check the distribution on a schedule, weekly for active systems, and compare it with the backtest. A drifting high percentile is often a sign a regime has shifted, sometimes before the equity curve shows damage. We would rather catch that early than explain it later.

Do not treat any one metric as proof of safety. A calm MAE profile can still precede a bad stretch, which is why the combination matters. We encourage you to run the same checks on any account you follow.

— Paulo

This article is general information, not a substitute for advice from a qualified financial advisor. Consult a qualified financial professional about your own circumstances before acting on anything here.

FAQ

How is mean reversion used in trading?

Mean reversion traders bet that price returns toward an average after stretching away from it. MAE helps here because these entries often sit against the move, so stop sizing depends on how far price typically extends before reverting.

What is the maximum favorable excursion?

Maximum favorable excursion (MFE) is the largest unrealized profit a trade reaches before it closes. Compare it with MAE on a scatter plot to judge exit efficiency and spot trades that gave back gains.

How do I use MAE to place a stop-loss?

Look at the MAE of your winning trades and take a high percentile. A stop just beyond that level keeps most winners alive while cutting trades that behave unlike them. Test it with a backtest sweep and add slippage.

Should I calculate MAE from tick data or bars?

Use the finest data that matches how you execute. Bar highs and lows work, but they can overstate MAE because the intra-bar order of moves is unknown, so document that limit.

Sources