VALYNOXSTRATEGY RESEARCH TECHNOLOGY
AlphaPrimeAlphaPrime
ACADEMY / Entries, exits and risk control

Maximum adverse excursion: how to read a stop from MAE and test it

Maximum adverse excursion is the deepest open loss a trade reaches before it closes. Plot each trade's MAE against its closed result, read the level that losers pass and winners rarely reach, and treat it as a stop hypothesis to test on trades that did not choose it.

By · Published · updated · Editorial policy

Contents
  1. What is maximum adverse excursion?
  2. What is the difference between MAE and MFE?
  3. Should MAE be measured in points or percent?
  4. How do you plot winners against losers by MAE?
  5. How do you pick a candidate stop from the MAE plot?
  6. Why can an MAE stop look better than it is?
  7. How does MAE connect to position size and leverage?
  8. Frequently asked questions
  9. References

What is maximum adverse excursion?

Maximum adverse excursion (MAE) is the largest open loss a trade reaches before it closes, measured from the entry price. Plot each trade's MAE against its closed result: a level that most winners never reach but most losers pass through is a stop candidate, and it must then be tested on trades that did not choose it.

Think of a hike that ends higher than it started. The route still passed through a valley on the way. MAE is the floor of that valley, not the height where the hike ended. A winning trade has an MAE as long as price moved against it at any point after entry, and a losing trade's MAE is at least as large as its closed loss, often larger.

Hypothetical example

A long ES trade enters at 5,000. The lowest price between entry and exit is 4,980, so the MAE is 20 points. The trade exits at 5,030, a closed result of +30 points. At $50 per ES point the trade was $1,000 under water at its worst and closed at +$1,500. The closed result alone would never tell you that this winner needed 20 points of room.

A hypothetical long ES trade falls 20 points below its entry price, an MAE of 20 points, and exits 30 points above entry for a closed result of +30 points, so a winning trade still has an MAE A winner still has an MAE One long ES trade, hypothetical Entry price MAE −20 pts Closed +30 pts Closed result hides the worst point. So: record MAE for every trade.
MAE is the deepest open loss during the trade. The closed result is a different number, and a winning trade still has an MAE.

A stop loss is a rule that closes a trade once its open loss reaches a set distance. If that distance sits beyond the MAE of most winners and inside the MAE of most losers, the stop removes losers while leaving winners mostly untouched. Kaminski and Lo (2014) show that whether a stop rule adds or subtracts value depends on how prices tend to move after a loss, which is why the level must be tested rather than assumed. The stop types you can test, fixed ticks, ATR-based, time-based or trailing, are compared in stop loss choices for a systematic futures strategy.

What is the difference between MAE and MFE?

MAE records the worst point of a trade and MFE records the best point, so MAE informs where a stop goes while MFE informs where a profit target or trailing exit goes. Maximum favorable excursion (MFE) is the largest open profit a trade reaches before it closes, measured from the entry price. Every trade has both numbers, and reading them together for the same trade shows how much of each move the exit rule actually kept.

QuestionMAE (maximum adverse excursion)MFE (maximum favorable excursion)
What it recordsDeepest open loss from entryHighest open profit from entry
For a long tradeEntry price minus the lowest low before exitHighest high before exit minus entry price
Exit rule it informsStop loss distanceProfit target or trailing exit distance
What a large value meansThe trade needed a lot of roomThe trade had more profit available than it kept
Typical readWhere do losers go that winners do not?How much of the best point did the exit keep?
Two trade paths, a winner and a loser, each with MFE marked as the best point above entry and MAE marked as the worst point below entry; MAE guides the stop and MFE guides the target or trailing exit Two extremes of one trade Dashed line = entry price Winner Loser MFE MAE MFE MAE MAE guides the stop, MFE the target. So: read both numbers per trade.
MAE and MFE are the two extremes of the same trade. One guides the stop, the other guides the target or trailing exit.

A practical read of MFE is to compare the closed result with the best open profit. A trade with an MFE of 40 points that closed at +10 kept a quarter of its best point. If most winners keep a small share of their MFE, a trailing exit or a target is worth a test. If most losers reached a meaningful MFE before turning into losses, the loss came from giving back profit, not from entering badly. Both are separate tests from the stop. This article stays with MAE and the stop; the same plotting method applies to MFE and the target.

Should MAE be measured in points or percent?

For a single futures contract over a few years, measure MAE in points or ticks, because the dollar value of a point is fixed by the contract specification. The point value is the dollar amount one full index point is worth per contract; for ES it is $50, and the exchange's contract page is the place to confirm it, since exchanges can change these values. The free futures contract calculator shows tick size, tick value and point value for the contract you test.

Points stop working well in two cases. When the price level changed a lot across the history, a 20-point move at the start of the data is a much larger share of price than a 20-point move at the end, so a fixed-point stop is tight early and loose late. When you compare several markets, points mean different things in each. Then measure MAE as a percent of the entry price or in ATR multiples. Average true range (ATR) is the average size of a bar's range over a set number of bars, gaps included, so one ATR is roughly one normal bar of movement in that market at that time. How ATR-based stops and sizes are set up is covered in ATR trailing stop rules and parameters.

SituationPoints or ticksPercent of priceATR multiples
One market, short history, stable price levelFits: fixed dollar meaning, easy to readWorks, but adds a conversionWorks, but adds a parameter (ATR length)
One market whose price doubled across the historyMisleading: early stops too tight, late stops too looseFits: same share of price throughoutFits: follows the market's own range
Several markets comparedNot comparable across contractsComparable, but ignores each market's volatilityFits: normalises by each market's movement
A grid comparing points, percent of price and ATR multiples as the MAE unit: points fit a stable price but fail when price doubles or markets are mixed, percent fits a doubled price, and ATR fits a doubled price and mixed markets Pick the MAE unit by case Where each unit fits Points Percent ATR Stable price Price doubled Many markets Best OK OK No Best Best No OK Best Points fit only a stable price. So: switch to % or ATR otherwise.
The right MAE unit depends on how much the price level and the market mix change across the test.

One data check comes before any unit choice. On a continuous futures series that is not back-adjusted, the price jump on a roll day shows up as a false MAE spike for any trade open across the roll. The contract specs and rollover settings for futures backtests explain how to build the series so that MAE measures price movement and not the gap between two contract months.

How do you plot winners against losers by MAE?

Run the strategy with no stop first, so every trade shows its full MAE, then plot each trade's MAE against its closed result. A stop in the run would cut off exactly the information you want: every stopped trade would show an MAE equal to the stop distance, and you could not see where losers would have gone. The steps:

  1. Run the entry and exit rules with no stop. Keep commission and slippage in the run so the closed results are net.
  2. Record MAE per trade. For a long trade, entry price minus the lowest low between entry and exit. For a short trade, the highest high between entry and exit minus the entry price.
  3. Plot MAE on the horizontal axis and the closed result on the vertical axis. Mark winners and losers differently.
  4. Look for the level where winners stop appearing and losers continue. That gap, if there is one, is the candidate stop.
A hypothetical scatter of MAE in points against closed result: winners, as filled dots, all sit under about 25 points of MAE, losers, as hollow dots, spread from 10 to 80 points, and a dashed line at 30 points marks the candidate stop beyond which only losers appear Beyond 30 points, only losers Hypothetical stop-free run Winners Losers Stop at 30 pts MAE, pts 30 80 Winners rarely need over 30 points. So: test a 30-point stop on new data.
Hypothetical winners-versus-losers MAE plot. Winners cluster at small MAE, losers spread wide, and the dashed line marks the level beyond which only losers appear.

A good plot shows a clear gap: winners bunched at small MAE, losers continuing far to the right. A bad plot shows winners and losers mixed along the whole axis, which means a stop at any distance removes about as many winners as losers and the exit should be improved some other way. The trade list in the performance report of AlphaPrime (Valynox) gives each closed trade's entry, exit and net result from such a stop-free run, which is the list an MAE study starts from.

The run below is the stop-free trade list behind this article. It tested an ADX rule, a trend-strength indicator used as the only entry and exit, with no stop, no target and no filters, on ES daily bars from 2019-01-02 to 2025-06-30, long and short, one contract, with $20 commission and $25 slippage per trade. The ADX rule is a stand-in for any stop-free strategy; it is not MAE itself. It is the one candidate the search kept out of the 1,024 it tried, chosen for its return against its drawdown, and picking the kept one after the fact flatters it. The numbers are not something the rule earned or that a reader can expect.

Source: AlphaPrime product engine (CPU), run 2026-10-31. ES daily bars, 2019-01-02 to 2025-06-30, long and short, 1 contract, $20 commission and $25 slippage per trade.

NumberResult
Net profit (closed trades)$99,702.5
Max drawdown$60,102.5
Trades43
Win rate53.49%
Profit factor1.643
Average trade$2,318.66
Time in market88.68%
The stop-free ES run that supplies the trade list. Look at the number of trades and at how net profit relates to max drawdown; both matter for whether an MAE plot from this list can be read at all.
The stop-free ES run that supplies the trade list. Look at the number of trades and at how net profit relates to max drawdown; both matter for whether an MAE plot from this list can be read at all. ES · daily · 2019-01-02 to 2025-06-30 · CPU engine backtest

With 43 trades, a plot from this list is a hint, not a result. A gap between winners and losers can appear by chance in a sample this small. An MAE study that you intend to act on needs hundreds of trades, which on a daily-bar strategy means a longer history or more markets, and on an intraday strategy a few years is usually enough.

How do you pick a candidate stop from the MAE plot?

Read the candidate stop from the gap in the plot, count the winners and losers that sit beyond it, and work out the net effect with costs before deciding whether the level is worth testing. The gap gives the distance; the counts tell you what the stop would have removed in the sample it was read from.

Five numbered steps: run with no stop, record each MAE, plot winners against losers, read the level and count trades beyond it, test it out-of-sample; an arrow from the last step back to the first is labelled new candidate From plot to tested stop Five steps, then a loop 1 2 3 4 5 Run with no stop Record each MAE Plot winners, losers Read level, count Test out-of-sample New candidate The plot gives a guess, not a stop. So: test every level on new trades.
From a stop-free run to a candidate stop handed on for testing. A failed test sends the next idea back to the start.

Three costs change the arithmetic. A stop order usually fills worse than its trigger price, so add stop slippage to every stopped trade. A stopped trade that the rules re-enter on the next bar adds a round trip of commission and slippage that the stop-free run did not pay. And a winner that the stop cuts does not just lose its profit; it becomes a loser of the stop distance plus slippage.

Hypothetical example

A stop-free intraday ES run shows 200 trades: 110 winners and 90 losers. The plot shows a gap near 30 points of MAE. Beyond 30 points sit 50 losers and 6 winners. The 50 losers lost 55 points on average; a stop at 30 points with 1 point of stop slippage would have closed each at a 31-point loss, saving 24 points, or $1,200 per trade at $50 per point, which is $60,000 across the 50 trades. The 6 winners beyond the line averaged +$1,800; each becomes a loss of $1,550, a swing of $3,350 per trade, or $20,100 in total. The in-sample net effect is about $40,000 better, before any re-entry costs. That number describes the sample the level was read from. It is the hypothesis for the next section, not a setting to keep.

Two readings of the counts help. If more than a handful of winners sit beyond the line, the gap is not clean and the stop will cost real profit. If the losers beyond the line are few, the stop changes little and a tighter exit rule, not a stop, is the thing to test.

Why can an MAE stop look better than it is?

The stop level was read from the same trades it is now applied to, so part of the improvement is selection, not edge. You looked at every trade's MAE, found the one distance that separated winners from losers in that sample, and then measured how well that distance separates them. Of course it separates them; it was chosen to. On new trades, some winners will dip past the line and some losers will stay inside it, and the gain shrinks.

Two hypothetical scatter panels with the same dashed 30-point stop: in-sample no winners sit beyond the line, out-of-sample five winners sit beyond it and losers fall on both sides The clean gap blurs on new data Filled: winner · Hollow: loser In-sample Out-of-sample Winners cut: 0 Winners cut: 5 The 30-point stop fit its own sample. So: keep it only if new data agrees.
The same 30-point stop on the trades that chose it and on trades that did not. The clean gap in-sample becomes a blurred one out-of-sample.

Bailey, Borwein, López de Prado and Zhu (2014) show that the best of many variants tried on one data set is almost always inflated, and reading a stop from a plot is a search through every possible distance at once. The remedy is the same as for any tuned setting:

  1. Read the level only from the in-sample part of the history. How to split the data, and how many out-of-sample trades count as enough, is covered in in-sample versus out-of-sample splits.
  2. Apply the stop unchanged to the out-of-sample block, or roll it through walk-forward windows. Pardo (2008) describes walk-forward analysis as the way to judge a setting on data that came after the data that chose it.
  3. Check the neighbours. Stops at 25, 30 and 35 points should give similar results. If only 30 works, the gap was a feature of those particular trades.
  4. Write down in advance how much of the in-sample gain may disappear before you reject the stop. Half surviving is a common working threshold; a sign change is a failure.

How does MAE connect to position size and leverage?

The stop distance that MAE suggests fixes the dollar risk per contract, and together with the risk you accept per trade it fixes the contract count, so the stop and the size should be decided together. The free position size calculator does this arithmetic for a given account risk and stop distance. There is one formula to know here:

contracts = risk per trade ÷ (stop distance × point value)

Here risk per trade is the dollar amount you accept losing when the stop is hit, stop distance is the MAE-based level in points, and point value is the dollar value of one point per contract. A wider stop means fewer contracts for the same dollar risk.

Hypothetical example

Risk per trade $2,000, ES point value $50. A 20-point stop risks $1,000 per contract, so the count is 2 contracts. A 40-point stop risks $2,000 per contract, so the count is 1 contract. The wider stop halves the size, and the dollar loss when the stop is hit stays the same.

With the same hypothetical dollar risk per trade and 50 dollars per ES point, a 20-point stop uses half of that risk per contract and allows 2 contracts, while a 40-point stop uses all of it per contract and allows 1 contract Wider stop, fewer contracts Same risk per trade, $50 per point Contracts = risk ÷ (stop × $50) 20 pts Half 2 contracts 40 pts Full 1 contract Same dollar risk, half the size. So: choose stop and size together.
Same dollar risk per trade, two stop distances, two contract counts. A wider MAE-based stop means fewer contracts.

Size changes the drawdown even when nothing else changes. The second run below takes the same 43 ES trades from the box above, the same entries and exits, and applies nine money-management methods with capital of 100,000 and at most 10 contracts, each with its report default settings. Only the size changes, so every difference between the rows comes from sizing. Max drawdown runs from $69,313 under the Kelly method, which held 1.09 contracts on average, to $437,965 under percent of equity, more than four times the starting capital, with 3.86 contracts on average. Fixed dollar risk and volatility target produced the same $110,325 drawdown on this list. The methods that grow size after wins carry the widest drawdowns, because the larger positions arrive just before the losing stretch.

Source: AlphaPrime product engine (CPU), run 2026-10-31. Same trades as the box above, capital $100,000, at most 10 contracts.

MethodNet profitMax drawdownAverage contracts
Fixed contracts$300,828$180,2283
Fixed notional$251,928$120,1652.51
Percent of equity$74,628$437,9653.86
Fixed dollar risk$218,340$110,3252.67
Fixed fractional risk$81,390$376,8284.44
Volatility target$218,340$110,3252.67
Fixed ratio$183,928$339,1283.14
Equity curve trading$154,703$112,3532.21
Kelly$93,840$69,3131.09
Max drawdown of the same 43 ES trades under nine sizing methods, as a multiple of the starting capital: percent of equity 4.4 times, fixed fractional risk 3.8, fixed ratio 3.4, fixed contracts 1.8, fixed notional 1.2, equity curve trading 1.1, fixed dollar risk 1.1, volatility target 1.1, Kelly 0.7 Same trades, nine drawdowns Max drawdown ÷ starting capital % of equity Fixed fractional Fixed ratio Fixed contracts Fixed notional Equity curve Fixed $ risk Vol. target Kelly 4.4× 3.8× 3.4× 1.8× 1.2× 1.1× 1.1× 1.1× 0.7×
Max drawdown of the same 43 ES trades under nine sizing methods. The entries and exits are identical; only the contract count differs.

Several of those drawdowns are larger than the 100,000 of starting capital, which in a real account means a margin call long before the end of the test. How margin requirements turn a backtest drawdown into a forced exit is worked through in futures leverage and backtest drawdown. The next thing to do with your own strategy: run it with no stop on the in-sample part of your history, record each trade's MAE, and count how many winners sit beyond the level you would have guessed. If that count is more than a handful, the guess was costing you winners, and the plot has already paid for itself.

Frequently asked questions

How do you use MAE to set a stop loss?

Run the strategy without a stop on the in-sample part of your history and record the deepest open loss of every trade. Plot that MAE against each trade's closed result and look for the distance beyond which winners stop appearing while losers continue. Treat that distance as a candidate, apply it unchanged to out-of-sample trades, and keep it only if the gain holds and nearby distances behave alike.

What is MAE MFE analysis?

MAE MFE analysis records two numbers for every trade: the worst open loss (maximum adverse excursion) and the best open profit (maximum favorable excursion). The MAE side tells you how much room winners needed and where losers went, which guides the stop. The MFE side tells you how much of the best point each trade kept, which guides profit targets and trailing exits.

How many trades do you need for an MAE plot?

Enough that a gap between winners and losers is unlikely to be chance, which in practice means a few hundred trades. A plot from a few dozen trades, like the 43-trade ES run in this article, is a hint only. If your strategy trades rarely, add history or markets before reading a stop from the plot, and measure MAE in percent or ATR multiples when you combine markets.

Should the backtest be run without a stop to measure MAE?

Yes. A stop in the run cuts every stopped trade at the stop distance, so you cannot see how far losers would have gone or whether winners would have recovered. Run the entries and exits alone first, with costs included, read the MAE plot from that run, and only then add the stop as a separate test on trades that did not choose it.

References

  • Kaminski, K. M., & Lo, A. W. (2014). When Do Stop-Loss Rules Stop Losses? Journal of Financial Markets, 18, 234–254.
  • Bailey, D. H., Borwein, J., López de Prado, M., & Zhu, Q. J. (2014). Pseudo-Mathematics and Financial Charlatanism: The Effects of Backtest Overfitting on Out-of-Sample Performance. Notices of the American Mathematical Society, 61(5), 458–471.
  • Pardo, R. (2008). The Evaluation and Optimization of Trading Strategies (2nd ed.). John Wiley & Sons.