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

Maximum favorable excursion: how to set profit targets from MFE

Maximum favorable excursion (MFE) is the largest open profit a trade reached before it closed. The spread of MFE values across all backtest trades shows where a profit target would have been reached often and how much open profit the current exit gives back. Read it on in-sample trades, pick a coarse level, and judge it out-of-sample.

By · Published · updated · Editorial policy

Contents
  1. How does maximum favorable excursion help you choose a profit target?
  2. How is maximum favorable excursion calculated?
  3. How much profit do trades give back?
  4. What is the difference between MFE and MAE?
  5. Should you set a fixed target or use a trailing exit?
  6. How do you avoid a fitted target?
  7. Does position size change what MFE tells you?
  8. Frequently asked questions
  9. References

How does maximum favorable excursion help you choose a profit target?

Maximum favorable excursion (MFE) is the largest open profit a trade reached before it closed. Record it for every backtest trade: the spread of values shows how far trades usually run before turning back, so you can place a profit target where most trades have already arrived and see how much your current exit gives back.

Think of a hiker who notes the highest point reached on each day's walk before coming back down to camp. One day's peak says little. A hundred days of peaks tell you where to build a hut: high enough to be worth the climb, low enough that most walks actually get there. MFE works the same way. Each trade's MFE is one peak, and the whole list is the map you read before writing an exit rule.

Used for a profit target, MFE answers two questions at once. First, at which distance from entry have most trades already been in profit? A target placed there is reached often. A target placed where only a handful of trades ever went is reached rarely and leaves the rest to find their own way out. Second, how much of the open profit does the exit you use today hand back before the trade closes? That gap, trade by trade, is the first thing to measure before deciding whether a target or a trailing exit is worth adding.

How is maximum favorable excursion calculated?

MFE is the best price a trade reached relative to its entry while it was open, converted to points, ticks or dollars with the contract's point value. For a long trade it is the highest high reached between entry and exit minus the entry price. For a short trade it is the entry price minus the lowest low reached while the trade was open. A trade that never moved in your favor has an MFE of zero, never a negative number.

  1. Write down the entry price and the bar of entry.
  2. Follow every bar until the exit. For a long trade keep the highest high seen so far; for a short trade keep the lowest low.
  3. Subtract. The distance between entry and that extreme is MFE in points.
  4. Convert to dollars with the point value, so MFE sits on the same scale as the closed result in your report.
  5. Keep the same cost settings as the rest of the backtest. A target level is only useful after the round-trip commission and slippage that every closed trade in the report already pays.

The one formula worth knowing is dollar MFE = MFE in points × point value × number of contracts. Point value is the dollar change in one contract when the price moves one full point. On E-mini Nasdaq-100 futures (NQ) the point value is $20 and the minimum tick is 0.25 points, worth $5.00, according to the CME contract specifications. Exchanges can change contract values, so check the exchange's contract page before you convert; the free futures contract calculator shows the current tick and point values and turns a point distance into dollars.

Hypothetical example

A long NQ trade enters at 100 (example price). The highest high while the trade is open is 112, and it exits at 104. MFE is 12 points, or 48 ticks, which is 12 × $20 = $240 with one contract. The closed profit is 4 points, or $80 before costs. With a $30 round-trip cost the closed trade nets $50. The give-back is 12 − 4 = 8 points, or $160.

One hypothetical long trade enters at 100, peaks at 112 and exits at 104: MFE is 12 points from entry to peak, the closed profit is 4 points, and the 8 points between them are the give-back MFE is the peak, not the exit Example: entry 100, peak 112, exit 104 Entry Peak Exit MFE 12 pts Give-back 8 pts Closed 4 pts The close is not the peak. So: measure give-back on every trade.
MFE is the distance from entry to the best price reached while the trade was open, not the closed profit. The difference between the two brackets is the give-back.

Two details decide whether the number is honest. Using bar highs and lows assumes you could have exited at the very extreme of a bar, which no exit rule does, so MFE from highs is an upper bound; some traders measure it from closing prices instead to get a figure a close-based exit could actually have taken. And a roll gap inside an open trade on an unadjusted continuous series adds or removes a jump that no trade ever experienced, which is why the series choice in futures backtesting with contract specs and rollover has to be settled before MFE means anything.

How much profit do trades give back?

Give-back is MFE minus the closed result of the same trade, and in a rule with no target and no stop it is usually a large share of the open profit. A trade that was once 30 points ahead and closed 10 points ahead gave back 20. A losing trade that was once 6 points ahead and closed 15 points behind gave back 21. Summed over all trades, give-back is the pool of open profit an exit rule could try to keep, and its size tells you how much a target or trailing exit is worth testing.

Hypothetical example

Ten trades, in points. MFE and closed result: 30/10, 18/12, 45/5, 6/−15, 3/−20, 22/8, 15/15, 60/20, 12/4, 25/6. The average MFE is 23.6 points; the average closed result is 4.5 points; the average give-back is 19.1 points. If a 15-point target had closed every trade whose MFE reached 15, seven trades would have closed at +15 and the other three unchanged, for an average of 7.4 points. Two cautions are built into that number: it assumes a limit order filled the moment the high touched the target, and the level 15 was chosen after looking at these ten trades, which is the fit the later section shows how to avoid.

Ten hypothetical trades shown as paired bars, MFE in grey and the closed result in colour: the average MFE is 23.6 points, the average closed result is 4.5 points, so most of the open profit is given back Most open profit is given back Ten hypothetical trades: grey = MFE Avg MFE 23.6 Avg closed 4.5 Avg give-back: 19.1 of 23.6 points. So: test an exit that keeps more.
Across many trades the closed results sit well below the MFE values. The gap between the two average lines is the profit the exit rule gives back.

To see the full size of give-back on real bars, run a rule with no target and no stop and read its trade list. The trade list in the Performance Report of AlphaPrime (Valynox) gives each trade's entry date, exit date and closed result; set the bar data between those two dates beside each row and the MFE and give-back of every trade fall out. We did this with the run below. It tested a stand-in rule, not MFE itself: a Standard Deviation rule as its only entry and exit, no stop, no target and no filters, 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 the one candidate the search kept out of just over a thousand it tried, kept for its return against its drawdown. Picking the kept candidate after the fact flatters it, so the figures describe this run and nothing more.

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.

NumberResult
Net profit (closed trades)$267,055
Max drawdown$90,210
Trades135
Win rate60.74%
Profit factor1.686
Average trade$1,978.19
Time in market86.03%

Two rows matter for give-back. Time in market of 86.03% means the rule held a position almost all the time, so each of the 135 trades stayed open through many daily bars and its open profit had room to rise and fall before the reverse signal closed it. The average trade of $1,978.19 is the closed side only; the MFE side of every one of those trades sat at or above it, and the difference is what a target or trailing exit would be trying to keep. The equity curve shows this directly: every dip inside an open trade is open profit being handed back.

The equity curve of the stand-in rule with no stop or target. Look at the dips that happen while a trade is still open: each one is give-back. The marked out-of-sample stretch shows the same behaviour on bars the search never used.
The equity curve of the stand-in rule with no stop or target. Look at the dips that happen while a trade is still open: each one is give-back. The marked out-of-sample stretch shows the same behaviour on bars the search never used. NQ · daily · 2019-01-02 to 2025-06-30 · CPU engine backtest

What is the difference between MFE and MAE?

MFE measures the best point of a trade and informs targets; maximum adverse excursion (MAE) measures the worst point and informs stops. Maximum adverse excursion is the largest open loss a trade reached while it was open: for a long trade, the entry price minus the lowest low; for a short trade, the highest high minus the entry price. Every trade has both numbers, and the two are read together on the same trade list before any exit rule is written.

QuestionMFEMAE
What it measuresBest open profit reachedWorst open loss reached
DirectionFrom entry towards the favorable extremeFrom entry towards the adverse extreme
Which exit it informsFixed target or trailing exitStop loss distance
What a large value meansThe trade ran far before closing; a target may cut it shortThe trade went deep under water; a stop there would have closed it
Typical readingWhere do most winners stop running?Beyond what loss do trades rarely recover?
One trade path measured from the same entry: MFE runs up to the best point and feeds a target or trailing exit, MAE runs down to the worst point and feeds the stop Two extremes of one trade Both measured from the same entry Entry MFE: best point Feeds target or trail MAE: worst point Feeds the stop MFE sets targets; MAE sets stops. So: read both on one trade list.
MFE and MAE are the two extremes of the same trade. One feeds the target or trailing exit, the other feeds the stop.

Reading them together is what makes the list useful. Sort trades by closed result and look at the MAE column: if winners cluster at small MAE values and losers at large ones, a stop placed just beyond the winners' MAE range removes mostly losers, which is the logic behind the choice between fixed ticks, ATR, time and trailing in stop loss rules for systematic futures strategies. Then look at the MFE column of the same losers: a losing trade that was once far in profit is a give-back problem that a target would fix, while a losing trade whose MFE is near zero is an entry problem that no exit rule fixes. Measuring both in volatility units rather than fixed points, the way ATR trailing stops and position sizing do, keeps the readings comparable across quiet and volatile years.

Should you set a fixed target or use a trailing exit?

If most trades reach a similar MFE and then fall back, a fixed target fits; if MFE values are spread wide with a few very large ones, a trailing exit keeps the large trades that a fixed target would cut. A fixed profit target is an exit at a set distance above the entry price, placed as a limit order. A trailing exit is an exit that follows price at a set distance behind its best level and closes the trade when price falls back by that distance.

The shape of the MFE distribution makes the decision. Plot MFE values of all in-sample trades as a histogram. A narrow hump, say most winners peaking between 20 and 30 points and almost none above 40, says trades run about the same distance and then turn: a fixed target near the front of the hump collects most of that run with no give-back. A wide, lopsided spread, with many small values and a long tail of trades that ran 100 points or more, says the result depends on a few large trades: a fixed target would close them at 20 and throw away the tail that pays for the losers. A trailing exit holds those trades and gives back only the trailing distance at the end.

QuestionFixed targetTrailing exit
MFE distribution that fitsNarrow cluster, few large valuesWide spread, long right tail
What you keepThe common run, with no give-back on trades that reach itThe rare large trade, minus the trailing distance
What you give upEverything above the targetThe trailing distance on every trade, and small trades stopped early
Fill assumptionLimit order filled when price trades through the level, usually by at least one tickStop order filled at or worse than the trigger; slippage applies
Parameter to testDistance in ticks or ATR multiplesTrailing distance in ticks or ATR multiples
Two illustrative MFE histograms: a narrow cluster around 20 to 30 points suits a fixed target near 20 points, while a wide spread with a long right tail up to 150 points suits a trailing exit that keeps the tail The shape decides the exit MFE of in-sample trades, illustration Target 20 Fixed target fits Tail Trailing exit fits Narrow cluster: target. Tail: trail. So: plot MFE before picking an exit.
The shape of the MFE distribution decides the exit. A narrow cluster suits a fixed target; a long right tail suits a trailing exit.

Two practical points. A target placed exactly at a level the bar high touched does not count as filled in a careful backtest; require price to trade one tick through it, and test the target one tick inside the MFE level you read. And both exit types are parameters, so the next section applies to the trailing distance as much as to the target distance.

How do you avoid a fitted target?

A target chosen at the exact MFE level that maximised one backtest is a form of curve fitting, so measure MFE on in-sample trades, choose a coarse level, check that neighbouring levels behave alike, and judge the rule on out-of-sample trades. Curve fitting is tuning a rule so closely to one stretch of history that it describes the noise in that stretch rather than a repeatable pattern. Scanning fifty target levels and keeping the best is exactly this: Bailey, Borwein, López de Prado and Zhu (2014) show that the best result from many tries is inflated by selection, and the more levels you tried the larger the inflation.

  1. Record MFE for every in-sample trade. Use the data split described in in-sample vs out-of-sample: how to split and how much is enough, and do not look at the later block.
  2. Read the distribution and pick a coarse level. A round number of ticks or a whole ATR multiple near the front of the hump, not the single value that would have scored best.
  3. Test the neighbouring levels. If 20, 25 and 30 points all give a similar result, the level sits on a plateau. If 25 is good and 20 and 30 are poor, the level is a spike that one history carved out. Pardo (2008) describes this reading of the parameter surface in detail: a robust setting lives in a flat region, not on a peak.
  4. Run the fixed rule unchanged on the out-of-sample trades. No adjustment after seeing the result.
  5. Accept or reject by a threshold you wrote before step 4, for example a minimum share of in-sample average trade that must survive out-of-sample.
A timeline of the data split: the round target level is picked on in-sample trades, the acceptance threshold is written at the boundary, and the out-of-sample block is then run once with the rule unchanged, never adjusted after the result Fix the level before testing Where the threshold sits in time In-sample Out-of-sample Pick round level Run unchanged Threshold written here Never moved after the run Fix the rule before judging it. So: write the threshold before OOS.
The order of steps that keeps a target from being tuned to one history. The threshold is written before the out-of-sample run, never after.

Step 2 is where most fitted targets are born. The MFE distribution of a hundred trades has bumps that mean nothing, and the single best level almost always sits on one of them. Choosing a round level loses a little in-sample result and gains a rule that has a chance of behaving the same way on prices it has never seen.

Does position size change what MFE tells you?

MFE in points does not change with contract count, but the dollar MFE, the give-back and the drawdown all scale with size. A trade that peaked 12 points above entry peaked 12 points above entry whether you held one contract or ten. The target decision therefore belongs in points or ATR units, made before sizing; sizing then multiplies whatever that decision keeps or gives back. Once the exit distances are fixed, the free position size calculator turns a stop distance in ticks and the share of the account you accept losing on one trade into a contract count, so the dollar give-back you read next is attached to a size you would actually trade.

The same hypothetical trade path with an MFE of 12 points at 20 dollars per point: with 1 contract the MFE bar is 240 dollars with 160 dollars given back, with 3 contracts the bar is three times as long, 720 dollars with 480 dollars given back, while the MFE stays 12 points in both rows Size scales dollars, not points Bar = MFE in dollars, hypothetical 1 contract MFE 12 pts $160 $240 3 contracts MFE 12 pts $480 $720 Kept Given back The path stays 12 points. So: set exits in points, then size.
MFE in points is a property of the trade path. Dollar MFE, give-back and drawdown are that property multiplied by the contract count.

The second box shows the scaling on real bars. It takes the same 135 NQ trades as the run above, with the same entries and exits, and sizes them nine different ways from $100,000 of capital with at most 10 contracts, each method at its report defaults. Because the trades do not change, every difference between the rows comes from sizing alone.

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$806,565$270,5503
Fixed notional$658,395$203,4152.55
Percent of equity$533,735$677,4903.4
Fixed dollar risk$693,480$225,7002.58
Fixed fractional risk$1,822,785$901,7406.55
Volatility target$693,480$225,7002.58
Fixed ratio$1,162,375$620,6753.59
Equity curve trading$452,030$270,5502.14
Kelly$452,030$215,1451.18

Read the drawdown column against the one-contract figure of $90,210. Fixed contracts at an average of 3 reports a max drawdown of $270,550; fixed fractional risk at an average of 6.55 contracts reports $901,740, a figure larger than the starting capital, which only works on paper because equity had already grown before that stretch arrived. The points given back inside each trade were the same in every row; only the dollars attached to them changed. That is why futures leverage and backtest drawdown is settled after the exit rules, with the drawdown in dollars compared with the capital you will actually start with.

The next step is one afternoon's work. Take the trade list of your last backtest, compute MFE for each trade from the bars between entry and exit, and plot the values as a histogram. Then write down three numbers before you touch any exit setting: the average give-back in points, the level that most winners reached, and the level that only a few reached. Those three numbers tell you whether a target, a trailing exit or neither is worth testing, and which coarse level to test first.

Frequently asked questions

Can MFE be used to set a profit target?

Yes, as long as the level comes from the shape of the MFE distribution and not from the single value that scored best. Measure MFE on in-sample trades, pick a round number of ticks or an ATR multiple near where most winners peaked, check that neighbouring levels behave alike, and judge the rule unchanged on out-of-sample trades. A level tuned to one backtest describes that history, not the market.

Does MFE include commission and slippage?

MFE is a price distance, so costs are not inside it. When you compare a target level with the closed results in a report, convert MFE to dollars with the point value and subtract the same round-trip cost the report charges on every trade. A target that only clears costs by a tick is not a target worth testing.

Should MFE be measured from bar highs or from closing prices?

Highs and lows give the true extreme and therefore an upper bound that no real exit reaches, because nobody exits at the exact high of a bar. Closing prices give a smaller figure that a close-based exit could actually have taken. Use the version that matches the exit you plan to test, and state which one you used so the numbers stay comparable across runs.

What is MAE in trading?

Maximum adverse excursion (MAE) is the largest open loss a trade reached while it was open, measured from the entry price to the worst price against the position. It is the mirror of MFE. Traders read MAE to place stops: if winning trades rarely went beyond a certain adverse distance, a stop just past that distance removes mostly losers. MFE and MAE are read together on the same trade list.

References

  • 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.
  • 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