Page 1 of 3
Using MAE to Test Whether Your Stop Is the Right Size
Posted: Tue Oct 06, 2026 8:29 am
by Fairman
Using MAE to Test Whether Your Stop Is the Right Size
Your stop distance is one of the most important parameters in your strategy, and most traders choose it by feel. MAE data lets you test it.
Take your winning trades and look at their MAE values, how far each moved against you before winning. Plot them or list them from smallest to largest. You may see that most winners dip only a short distance, with only a few going deeper.
Suppose your stop is 20 pips, and 90 percent of your winners had an MAE below 12 pips. The distance between 12 and 20 pips is mostly used by trades that go on to lose. A stop at 14 or 15 pips might have lost very few winners while reducing losses on the rest, allowing larger position size for the same risk.
The reverse can also appear. If many winners had an MAE of 17 or 18 pips, close to your stop, a slightly tighter stop would have turned many of them into losers. That suggests your stop is already near the edge.
Remember that results depend on your entries and the market conditions of the sample. Do not tune the stop to a perfect fit of past data, which risks overfitting.
Use round numbers and a logical level, such as beyond a swing point, and validate on new trades.
Practical step: list the MAE of your last thirty winners and check what share would have survived a stop that was 20 percent tighter.
Re: Using MAE to Test Whether Your Stop Is the Right Size
Posted: Tue Oct 06, 2026 8:54 am
by Fairman
I'd add a check by session. Winners in a quiet Asian session might dip much less than winners at the London open, so one stop size for both can be too wide for one and too tight for the other. If your journal has a session field, split the MAE list by it and compare. On EURUSD it's common to see London open trades needing noticeably more room because the first move after the open often sweeps one side before going the other way. If that shows up in your numbers, you could use a slightly wider stop for London open entries and smaller size to match, while keeping tighter stops for calmer periods.
Re: Using MAE to Test Whether Your Stop Is the Right Size
Posted: Tue Oct 06, 2026 9:26 am
by Fairman
Keep the stop beyond a real level even if the MAE says you could go tighter. A stop in the middle of nowhere just because the numbers liked it tends to get picked off. The MAE data tells you how your past winners behaved, but price doesn't know your statistics. It reacts to visible highs, lows and zones. So I use MAE to decide between sensible choices, for example whether to place the stop just beyond the wick or beyond the whole zone, not to invent a new level. If the data says your stop is too wide, the better fix may be a more precise entry rather than a stop placed somewhere arbitrary.
Re: Using MAE to Test Whether Your Stop Is the Right Size
Posted: Tue Oct 06, 2026 11:18 am
by PTScalper
Fairman wrote: Tue Oct 06, 2026 8:29 am
Using MAE to Test Whether Your Stop Is the Right Size
Your stop distance is one of the most important parameters in your strategy, and most traders choose it by feel. MAE data lets you test it.
Take your winning trades and look at their MAE values, how far each moved against you before winning. Plot them or list them from smallest to largest. You may see that most winners dip only a short distance, with only a few going deeper.
Suppose your stop is 20 pips, and 90 percent of your winners had an MAE below 12 pips. The distance between 12 and 20 pips is mostly used by trades that go on to lose. A stop at 14 or 15 pips might have lost very few winners while reducing losses on the rest, allowing larger position size for the same risk.
The reverse can also appear. If many winners had an MAE of 17 or 18 pips, close to your stop, a slightly tighter stop would have turned many of them into losers. That suggests your stop is already near the edge.
Remember that results depend on your entries and the market conditions of the sample. Do not tune the stop to a perfect fit of past data, which risks overfitting.
Use round numbers and a logical level, such as beyond a swing point, and validate on new trades.
Practical step: list the MAE of your last thirty winners and check what share would have survived a stop that was 20 percent tighter.
Hi Fairman,
Using Maximum Adverse Excursion (MAE) shifts stop-loss placement from a psychological guessing game into a quantifiable, data-driven edge. By measuring the deepest point a trade moves against your entry before ultimately hitting its take-profit target, you can identify exactly how much "breathing room" your specific setups actually require to play out.
Re: Using MAE to Test Whether Your Stop Is the Right Size
Posted: Tue Oct 06, 2026 11:19 am
by PTScalper
The Mechanics of MAE Optimization
When you place a stop loss entirely by "feel" or by a fixed arbitrary distance, you are likely either subsidizing unnecessary losses or prematurely choking out valid setups. MAE forces you to look at the historical structural tolerance of your winning trades.
To extract value from this metric, you map the MAE of a statistically significant sample of winning trades (e.g., your last 30 to 50 setups) on a scatter plot or distribution curve.
The "Fat" Stop (Excessive Risk): If you typically use a 20-pip stop, but a plot of your last 30 winners reveals that 90% of them never experienced an MAE greater than 12 pips, the 12-to-20 pip zone is functionally dead space. Trades that breach 12 pips in adverse excursion are statistically on their way to hitting the full 20-pip stop anyway.
The Position Sizing Advantage: By tightening the stop to 14 or 15 pips, you barely impact your win rate but significantly reduce the monetary risk per trade. Because risk per trade dictates lot size, a tighter stop allows you to increase your position size while risking the exact same percentage of your account capital, instantly boosting your net Risk-to-Reward (R:R) ratio.
The "Razor" Stop (Over-Tightening): Conversely, if your MAE distribution shows that many winners regularly dip 17 or 18 pips against you before reversing, your 20-pip stop is operating right on the edge of market noise. Tightening it even by 10% would drastically convert winning trades into full losses, eroding your strategy's expectancy.
Re: Using MAE to Test Whether Your Stop Is the Right Size
Posted: Tue Oct 06, 2026 11:19 am
by PTScalper
Merging Quantitative Data with Qualitative Price Action
While MAE provides the statistical baseline, it cannot operate in a vacuum. A 14-pip optimized stop is useless if it frequently lands in the middle of a high-liquidity zone rather than safely behind structural protection.
Since raw price action on timeframes like the M15 or Daily chart relies heavily on candlestick structure and liquidity sweeps, your optimized MAE distance should be used as a filter, not a rigid rule.
Identify the logical level first: Look for the swing point or liquidity pool that fundamentally invalidates your trade thesis.
Cross-reference with MAE: Measure the distance to that logical level. If the structural stop requires 25 pips but your MAE data strictly dictates that winners rarely exceed 15 pips of drawdown, the setup itself might be structurally flawed or mistimed. You either skip the trade entirely or refine the entry on a lower timeframe to bring the structural stop within your historical MAE tolerance.
Re: Using MAE to Test Whether Your Stop Is the Right Size
Posted: Tue Oct 06, 2026 11:20 am
by PTScalper
The Overfitting Trap
The greatest risk in MAE optimization is curve-fitting—adjusting the stop to perfectly accommodate a specific historical data sample so that the past looks flawless, only for the strategy to fail in live conditions as market volatility expands and contracts.
Avoid exact limits: Do not set the stop to the exact maximum MAE of your sample. Leave a buffer (e.g., the 90th percentile of your winners plus a few points of spread/noise allowance).
Out-of-sample testing: Once you determine a tighter stop size based on past data, forward-test it or script a backtest (using tools like MQL or Pine Script) on an entirely different time horizon to ensure the optimized distance holds up across changing market structures.
Re: Using MAE to Test Whether Your Stop Is the Right Size
Posted: Tue Oct 06, 2026 11:20 am
by PTScalper
Practical Implementation
To execute this audit on your own setups:
Extract the Data: Pull the entry, exit, and lowest/highest price reached during the lifespan of your last 30 winning setups. Programmatically, you are looking for the lowest Low during a long trade's lifespan, or the highest High for a short.
Calculate Survival Rate: Apply a hypothetical stop that is 20% tighter than your current baseline.
Analyze the Trade-Off: Count exactly how many of those 30 winners would have been prematurely stopped out. Compare the capital saved on your historical losing trades against the profits lost from those clipped winners. If the net expectancy goes up, the tighter stop is mathematically justified.
Re: Using MAE to Test Whether Your Stop Is the Right Size
Posted: Tue Oct 06, 2026 11:21 am
by PTScalper
Assuming you are looking to script a raw price action concept, here is a Pine Script (v5) indicator that detects liquidity sweeps at recent structural swing highs and lows.
This is particularly effective on 15-minute and daily charts for identifying points where the market grabs liquidity before reversing.
Code: Select all
//@version=5
indicator("Liquidity Sweep Detector", overlay=true, max_bars_back=500)
// --- Inputs ---
leftBars = input.int(5, title="Pivot Left Bars", tooltip="Number of bars to the left to define a swing point")
rightBars = input.int(5, title="Pivot Right Bars", tooltip="Number of bars to the right to define a swing point")
// --- Calculate Pivots ---
// We use ta.pivothigh and ta.pivotlow to establish structural levels
ph = ta.pivothigh(high, leftBars, rightBars)
pl = ta.pivotlow(low, leftBars, rightBars)
// Variables to store the most recent validated pivot levels
var float lastHigh = na
var float lastLow = na
if not na(ph)
lastHigh := ph
if not na(pl)
lastLow := pl
// --- Sweep Detection Logic ---
// Bearish Sweep: Price wicks above the last known swing high, but the candle closes below it.
bearishSweep = not na(lastHigh) and high > lastHigh and close < lastHigh
// Bullish Sweep: Price wicks below the last known swing low, but the candle closes above it.
bullishSweep = not na(lastLow) and low < lastLow and close > lastLow
// --- Plotting ---
// Mark the underlying structural pivots (offset backwards to align with the actual pivot bar)
plotshape(not na(ph), title="Swing High", style=shape.triangledown, location=location.abovebar, color=color.new(color.gray, 50), size=size.tiny, offset=-rightBars)
plotshape(not na(pl), title="Swing Low", style=shape.triangleup, location=location.belowbar, color=color.new(color.gray, 50), size=size.tiny, offset=-rightBars)
// Highlight the actual liquidity sweeps in real-time
plotshape(bearishSweep, title="Bearish Sweep", text="Sweep", style=shape.labeldown, location=location.abovebar, color=color.new(color.red, 0), textcolor=color.white, size=size.small)
plotshape(bullishSweep, title="Bullish Sweep", text="Sweep", style=shape.labelup, location=location.belowbar, color=color.new(color.green, 0), textcolor=color.white, size=size.small)
// Draw lines projecting the last pivot levels
var line highLine = na
var line lowLine = na
if not na(ph)
line.delete(highLine)
highLine := line.new(bar_index[rightBars], ph, bar_index, ph, color=color.red, style=line.style_dashed)
if not na(pl)
line.delete(lowLine)
lowLine := line.new(bar_index[rightBars], pl, bar_index, pl, color=color.green, style=line.style_dashed)
// Extend lines dynamically
if na(ph) and not na(highLine)
line.set_x2(highLine, bar_index)
if na(pl) and not na(lowLine)
line.set_x2(lowLine, bar_index)
Re: Using MAE to Test Whether Your Stop Is the Right Size
Posted: Tue Oct 06, 2026 11:21 am
by PTScalper
How it works:
Structural Framing: It identifies swing highs and lows based on a 5-bar lookback and lookforward (adjustable in the settings).
Sweep Trigger: It waits for a live candle to pierce the most recent swing level. If the candle is rejected and closes back inside the structural bound, it prints a visual "Sweep" label.
Level Projection: It draws dashed lines extending from the most recent structural highs and lows so you can visually track the liquidity pools the market is targeting.