MAE and MFE in trading: how to set stops and targets from excursion
MAE is the largest open loss a trade showed before it closed; MFE is the largest open gain. Measure both in points on every closed trade, plot them against the final result, and place the stop where winners rarely went and the target where most winners had already peaked. Treat both cutoffs as candidates to validate, not as fitted rules.
By Soren Huang · Published · updated · Editorial policy
Contents
- What are maximum adverse excursion and maximum favorable excursion?
- How do you calculate MAE and MFE for one trade?
- How do you read an MAE and MFE scatter plot?
- Can MAE be used to set a stop loss?
- How do you use MFE to set a profit target?
- How does position size change what an MAE stop means in money?
- What goes wrong when the sample is small?
- Frequently asked questions
- References
What are maximum adverse excursion and maximum favorable excursion?
The maximum adverse excursion definition in trading is simple: MAE is the largest open loss a trade showed between entry and exit. MFE, maximum favorable excursion, is the largest open gain over the same time. Together they describe the path of a trade, not only its end, and the path shows where a stop or target would have changed the result.
Maximum adverse excursion (MAE) is the furthest the market moved against your position while the trade was open, measured from the entry price. Maximum favorable excursion (MFE) is the furthest the market moved in your favour while the trade was open, measured from the same entry price. MFE is the mirror image of MAE: for a long trade one looks down from the entry, the other looks up. A trade report normally shows only the third number, the final result. That number hides how much pain the trade went through and how much gain it gave back.
Think of a hike with a map that shows only the start and the finish. You know you ended 200 metres higher, but not that the trail first dropped into a valley and later climbed over a ridge before coming back down. MAE is the bottom of the valley, MFE is the top of the ridge, and the exit is wherever you stopped walking. A stop loss is a rule that says "turn back if the trail drops more than this", and a target says "stop at the ridge". You cannot set either sensibly without knowing where the valleys and ridges were.
How do you calculate MAE and MFE for one trade?
For a long trade, MAE is the entry price minus the lowest low while the trade was open, and MFE is the highest high minus the entry price; for a short trade the two directions swap. Measure both in points first, then convert to money per contract, so the numbers stay comparable when you change contract count later.
- Record the entry price. Use the price the backtest actually filled at, not the signal price. With next-bar execution that is usually the open of the bar after the signal.
- Track the lowest low and the highest high of every bar from the entry bar to the exit bar, including both. Use highs and lows, not closes. A stop order is triggered by the extreme, so a close-only excursion understates how far the market really went.
- Subtract to get points. Long: MAE = entry − lowest low, MFE = highest high − entry. Short: MAE = highest high − entry, MFE = entry − lowest low. Both numbers are zero or positive; a trade that never went against you has an MAE of zero.
- Multiply by the point value of the contract to get dollars per contract. For E-mini Nasdaq-100 futures (NQ) the contract is $20 × the index and the minimum tick is 0.25 index points, worth $5.00, according to the CME contract specifications. Exchanges can change these values, so confirm them on the exchange's contract page or with the free futures contract calculator before you convert.
The one formula to keep in mind is the long-trade version: MAE = entry price − lowest low while open. Here entry price is your fill, and lowest low while open is the lowest price any bar touched between the entry bar and the exit bar. Everything else in this article is this subtraction turned around or repeated over many trades.
Hypothetical example
A long NQ trade fills at 18,000. While it is open, the lowest low is 17,920 and the highest high is 18,150. It exits at 18,090. MAE is 18,000 − 17,920 = 80 points, or $1,600 per contract. MFE is 18,150 − 18,000 = 150 points, or $3,000. The final result is 90 points, or $1,800 before costs, so the trade gave back 60 of its 150 best points. A short trade that fills at 18,000, sees a high of 18,060 and a low of 17,850 and exits at 17,910 has an MAE of 60 points ($1,200), an MFE of 150 points ($3,000) and the same 90-point result.
How do you read an MAE and MFE scatter plot?
Plot each closed trade as one dot, with its excursion in points on the horizontal axis and its final result on the vertical axis, and the picture shows where losers cluster, where winners rarely went, and how much open gain was given back before the exit. Two plots are useful, one for MAE and one for MFE, and each answers a different question.
On the MAE plot, draw winners and losers with different markers. In most trade lists the winners sit packed near the left, because a trade that will end well usually does not first move far against you. The losers spread out to the right, because a trade that ends badly almost always went deep underwater on the way. The useful line is a vertical one: the MAE distance beyond which almost no winner sits. Everything to the right of that line is a loss you could have taken earlier and smaller.
On the MFE plot, draw a 45-degree diagonal. A dot on the line is a trade that closed at its best open gain and gave nothing back. A dot far below the line is a trade that was well in profit at some point and then shrank or turned into a loss before the exit. The vertical gap between a dot and the line is the give-back, and the give-back is what a profit target tries to collect.
| Question | MAE plot (horizontal axis: MAE) | MFE plot (horizontal axis: MFE) |
|---|---|---|
| Where do winners sit? | Packed near the left, small MAE | Spread along the horizontal axis, near or below the diagonal |
| Where do losers sit? | Spread to the right, large MAE | Mostly near the left; a loser that had a large MFE gave all of it back |
| What line do you draw? | Vertical: the distance past which almost no winner went | Diagonal: kept all of its best gain; vertical: where most winners peaked |
| What exit does it inform? | Stop loss | Profit target |
Can MAE be used to set a stop loss?
MAE can set a stop at the distance beyond which winners rarely went, so that the stop removes mostly losers and touches few winners. The method needs a real list of trade paths, and the one used in this article comes from a backtest run with no stop and no target, so every excursion is the full, uninterrupted path.
The run below is the example set of trade paths. AlphaPrime (Valynox) tested a stand-in rule built from standard indicators, an Effective Spread rule, as the only entry and exit on NQ daily bars from 2019-01-02 to 2025-06-30, long and short, one contract, with $20 commission and $10 slippage per trade. It is not an excursion rule itself; it stands in for any strategy whose trades you want to measure. The candidate shown is the one the search kept out of about a thousand it tried, chosen for its return against its drawdown. Picking the kept one after the fact flatters it, so read the figures as the properties of this trade list, not as what the rule earns or what a reader can expect.
Source: AlphaPrime product engine (CPU), run 2026-10-31. NQ daily bars, 2019-01-02 to 2025-06-30, long and short, 1 contract, $20 commission and $10 slippage per trade.
| Number | Result |
|---|---|
| Net profit (closed trades) | $146,230 |
| Max drawdown | $40,325 |
| Trades | 49 |
| Win rate | 61.22% |
| Profit factor | 2.37 |
| Average trade | $2,984.29 |
| Time in market | 23.29% |

With 49 trades in this list, each one has a measured MAE. The procedure is the same for any list: sort the winners by MAE, find the distance that only a small share of winners ever exceeded, and test a stop at that distance and at one step tighter and one step wider. The three rows should be read as a trade-off, not as a ranking where the tightest stop wins. A tighter stop always cuts more losers, but it also stops out winners that would have turned, and those lost winners are the cost that a backtest without excursion data never shows you. The choice between a fixed-tick, an ATR-based or a time stop is covered in stop loss in a futures strategy: fixed ticks, ATR, time or trailing; how the order itself is filled is explained in what a stop loss order is and how it works on futures.
Hypothetical example
A trade list of 200 trades on NQ. Among the winners, 9 out of 10 have an MAE under 70 points; among the losers, 6 out of 10 have an MAE above 70 points. Three stops are tested:
| Stop distance | Losers cut short | Winners stopped out before they turned | Average trade after costs |
|---|---|---|---|
| Tight (40 points) | Most losers | About 3 in 10 winners | Falls, because lost winners outweigh smaller losses |
| Medium (70 points) | 6 in 10 losers | About 1 in 10 winners | Rises modestly; maximum loss per trade falls |
| Wide (120 points) | Few losers | Almost none | Nearly unchanged from no stop |
The medium row is the balanced choice in this example: it caps the worst losses while giving up few winners.
Whether a stop helps at all depends on how prices behave after a loss. Kaminski and Lo (2014) show that stop-loss rules can add or remove value depending on whether losses tend to continue or to reverse, which is why the stop must be tested on the strategy's own trade paths rather than copied from another system.
How do you use MFE to set a profit target?
MFE shows how far trades typically ran in your favour before they closed, so a target placed where most winners already reached their best point collects gains that the plain exit gave back, at the price of capping the few trades that ran much further. The question is whether the give-back collected on many trades is worth more than the extra gain surrendered on a few.
Start with the give-back of each winner: divide its final result by its MFE. A winner that closed at 60 points with an MFE of 150 kept 40 percent of its best gain. If most winners keep less than half, the exit is leaving a lot on the table and a target is worth testing. Then look at where the winners' MFE values bunch. A shaded band on the plot where many dots sit is the natural candidate distance; place the target at the lower edge of that band, not at its centre, because a target that most trades never reach is the same as no target.
- Compute MFE and give-back for every winner on the same cost settings as the backtest.
- Find the band where most winners reached their best point.
- Test a target at the lower edge of the band and compare the average trade and the largest winner with and without it.
- Count the capped trades. If a handful of very large winners make up most of the profit, a target that caps them can remove the whole edge. The MFE plot shows this before you run the test: look for dots far to the right along the diagonal.
Hypothetical example
In a list of 120 winners, most reached their best point between 120 and 160 points of MFE but closed around 60 points on average. A target at 120 points would have turned about 70 of them into 120-point trades. The cost: 8 trades that ran past 300 points are capped at 120. Whether the 70 improved trades outweigh the 8 capped ones is a sum you make on this list, and then check on trades the list did not contain.
How does position size change what an MAE stop means in money?
The MAE distance is fixed in points, but the loss it represents scales with contract count, so a stop must be judged together with sizing. The same 80-point stop is a small dent at one contract and a serious hit at ten, and the drawdown of the whole strategy moves with it even when no entry or exit changes.
Once the stop distance is fixed in points, the contract count decides the loss in money. Keep the two decisions separate: the MAE plot answers "how far", the account answers "how many". A trader who raises the contract count after a good run has not changed one signal, yet every stop now costs more in dollars and every losing streak digs a deeper hole in the equity curve. The hypothetical below shows the same 80-point stop at one, three and ten contracts.
Hypothetical example
An MAE stop of 80 points on NQ is $1,600 per contract. At one contract it is 1.6 percent of a $100,000 account; at three contracts, $4,800 or 4.8 percent; at ten contracts, $16,000 or 16 percent. The stop distance never changed. Four such losses in a row at ten contracts would remove more than half the account.
This is where MAE and sizing meet. Once you know the stop distance in points, the free position size calculator turns it into a contract count for a chosen account risk, and the result is usually smaller than the count a trader picks by feel. Why the drawdown grows faster than the position when leverage is added is explained in how margin changes backtest drawdown under futures leverage, and what a forced liquidation does to a stop that was never hit is covered in margin calls and backtest risk in margin trading.
What goes wrong when the sample is small?
An MAE or MFE cutoff drawn from a few dozen trades moves a lot when a handful of trades change, so treat it as a candidate setting to validate on unseen data rather than a fitted rule, and widen it rather than tighten it when in doubt. The 49-trade list above is exactly such a sample: remove the five trades with the largest MAE and the "distance past which almost no winner went" can shift by a wide margin, because that distance is decided by a few dots at the edge of the plot.
The reason is that both cutoffs live in the tails. The stop is set where winners stop appearing, and the target is set where winners stop peaking. The tail of a distribution is the part with the fewest observations, so it is the part that changes most when a few trades are added or removed. A median barely moves when five trades change; the position of the last winner on the right of the plot can move by half the axis. With a few hundred trades the edge of the cloud is drawn by many dots and stays roughly in place.
There is a second trap. If you test ten stop distances on the same trade list and keep the one with the best average trade, you have optimized on that list, and the chosen distance now carries a selection bonus. Bailey, Borwein, López de Prado and Zhu (2014) show that the best of many tries on one data set is inflated by the number of tries, and the inflation is worst when the sample is small. The remedy is the same one that applies to every other setting: fix the candidate stop and target on the in-sample trades, then run them unchanged on trades the search never saw, as described in how to split in-sample and out-of-sample data and how much is enough. When a stop or target distance has been chosen from an MAE plot, AlphaPrime's strategy validation is where that distance meets data it has not seen, under thresholds written down before the plot was drawn.
- Count the winners, not the trades. The stop cutoff depends on the winners' MAE and the target on the winners' MFE, so a list of 200 trades with 80 winners has 80 observations for each cutoff, not 200.
- Round the cutoff outward. If the plot suggests 70 points, test 70 and 90, not 70 and 50. A stop that is too wide costs a little on a few losers; a stop that is too tight costs the winners.
- Re-draw the plot without the five most extreme trades. If the cutoff moves by more than a quarter of its value, the sample is too small to set it and you should carry the wider value forward.
- Check the cutoff on the next block of data before trading it. If the winners there sit beyond the stop, the stop was fitted to the first block.
A practical next step: take the trade list of one strategy you already have, compute MAE and MFE for each trade in points using the four steps above, and draw the two plots. Before you test any stop, write down the distance past which fewer than one winner in ten went, remove the five largest MAE trades and draw it again. The size of that move tells you whether your list is large enough to set a stop from it at all.
Frequently asked questions
How do you calculate MAE for a trade?
For a long trade, subtract the lowest low reached while the trade was open from the entry price. For a short trade, subtract the entry price from the highest high. Use the highs and lows of the bars, not the closes, because a stop order is triggered by the extreme. Measure in points first, then multiply by the contract's point value to get dollars per contract.
What is maximum favorable excursion in trading?
Maximum favorable excursion (MFE) is the largest open gain a trade showed between entry and exit, measured from the entry price. For a long trade it is the highest high minus the entry; for a short trade it is the entry minus the lowest low. Comparing MFE with the final result shows how much of the best open gain the trade gave back before it closed, which is the figure a profit target tries to collect.
Is MAE the same as drawdown?
No. MAE belongs to one trade and measures how far that trade went against you before it closed. Drawdown belongs to the account or equity curve and measures how far it fell from a previous peak, usually across many trades. A strategy can have small MAE on every trade and still show a large drawdown from a long run of small losers.
How many trades do you need before an MAE stop is reliable?
Enough winners that the edge of the MAE plot does not move much when a few trades are removed. The cutoff is decided by the winners with the largest MAE, which are few, so a list of a few dozen trades gives an unstable line. Many systematic traders want a few hundred trades, and at least a hundred winners, before they treat an MAE cutoff as more than a candidate to validate on unseen data.
Should the MAE stop be measured in points or in dollars?
Measure it in points per contract first, because the distance in points describes the market's behaviour and does not depend on your account. Convert to dollars afterwards with the contract's point value and your contract count. Keeping the two steps separate lets you see whether a drawdown problem comes from the stop distance or from the position size.
References
- CME Group. E-mini Nasdaq-100 Futures contract specifications (contract size $20 × index, minimum tick 0.25 index points = $5.00). cmegroup.com/markets/equities/nasdaq/e-mini-nasdaq-100.contractSpecs.html
- 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.

