Disclaimer: This article is for educational and informational purposes only. It does not constitute financial or investment advice. Trading forex and CFDs carries significant risk of loss. Past performance of any strategy — including backtests — does not guarantee future results. Never trade with money you cannot afford to lose.
What Is This Strategy?
Fractal Adaptive Trend Glide is a trend-following expert advisor (EA) built around John Ehlers' Fractal Adaptive Moving Average (FRAMA) — a moving average whose smoothing speed changes automatically based on how "trendy" or "choppy" recent price action has been. Instead of using a fixed period like a simple or exponential moving average, FRAMA measures the fractal dimension of the recent High/Low price path and uses that number to decide how quickly the line should react to price. This makes it an adaptive trend-following approach rather than a static one.
The core idea behind the fractal dimension is intuitive once you see it. A price path that moves in a straight, one-directional line barely fills the space around it, giving a dimension close to 1.0. A jagged, sideways market that zig-zags back and forth fills much more of that space, pushing the dimension toward 2.0. Fractal Adaptive Trend Glide uses this single measurement to do two jobs at once: it speeds the FRAMA line up during trends so it hugs price, and it slows the line down during chop so it flattens out and ignores noise. That flattening is important — it is precisely the ranging conditions where ordinary moving-average crossover systems tend to generate the most false signals.
As a learning tool, this strategy is well suited to traders who want to understand adaptive indicators, regime filtering, and how a single statistical measure can control both a signal line and a trade filter. It is designed for trending conditions on liquid instruments, and it is best studied on a demo account where you can watch the FRAMA line react to changing market behavior in real time. It is not a shortcut of any kind — it is a structured framework for exploring how fractal-geometry concepts can be applied to price data.
How It Works
The strategy processes only completed bars (it acts once per closed candle, never on the still-forming one), and it keeps a rolling history of highs, lows, closes, and FRAMA values to compute its signals incrementally.
Building the adaptive line:
- Over the last N bars (the
FramaPeriod, forced to an even number), the window is split into two equal halves — a recent half and an older half. - The strategy measures the High-to-Low range of the recent half, the older half, and the whole window, then combines them into a fractal dimension D between 1.0 (straight trend) and 2.0 (space-filling chop).
- That dimension is converted into an adaptive smoothing constant (
alpha). Low dimension means alpha approaches 1, so FRAMA snaps to price and rides the move; high dimension means alpha approaches 0, so FRAMA flattens and filters out the noise.
Entry conditions — the strategy signals a LONG when, on the just-closed bar:
- The close crossed up through the FRAMA line (the previous close was at or below FRAMA, and the current close is above it).
- FRAMA is rising when measured over the
SlopeLookbacknumber of bars, confirming an adaptive uptrend. - The fractal dimension D is at or below
MaxDimension, certifying that the market is in a trending regime rather than choppy, space-filling conditions.
A SHORT is the exact mirror: the close crosses down through FRAMA, FRAMA is falling over the slope window, and the same dimension gate must be satisfied.
Position and risk logic:
- Only one position per magic number is open at any time — no stacking or pyramiding.
- Risk is ATR-based and symmetric. The Average True Range (ATR), a common measure of recent volatility, sets both the stop-loss and take-profit distances.
- Stop-loss: entry price minus (for longs) or plus (for shorts)
ATR × AtrSlMult. - Take-profit: entry price plus (for longs) or minus (for shorts)
ATR × AtrTpMult. - With the default multipliers (stop at 2.0× ATR, target at 3.2× ATR), the reward-to-risk ratio is roughly 1.6 to 1. A trade with a degenerate or zero-distance stop is rejected outright.
Because stops scale with volatility, the strategy automatically gives trades more room in fast markets and tightens them in quiet ones, rather than using a fixed pip distance.

Strategy Parameters
| Parameter | Default | Min | Max | Description |
|---|---|---|---|---|
| FramaPeriod | 16 | 8 | 40 | Length of the FRAMA and fractal-dimension window (forced to an even number, minimum 4). Larger values smooth more slowly; smaller values react faster. |
| SlopeLookback | 3 | 1 | 10 | How many bars back the FRAMA slope is measured over to confirm the adaptive trend direction. |
| MaxDimension | 1.60 | 1.30 | 1.90 | The regime gate — trades are only allowed when the fractal dimension D is at or below this value (lower means a stricter "trending only" filter). |
| AtrPeriod | 14 | 7 | 28 | Number of bars used to calculate the ATR for the volatility-based risk model. |
| AtrSlMult | 2.0 | 1.0 | 4.0 | Stop-loss distance as a multiple of ATR. Higher values give trades more breathing room. |
| AtrTpMult | 3.2 | 1.0 | 6.0 | Take-profit distance as a multiple of ATR. Together with the stop multiplier this sets the reward-to-risk ratio. |
| Lots | 0.10 | 0.01 | 1.0 | Fixed trade size in lots. Should be adjusted to match your account size and risk tolerance. |

Recommended Chart Settings
Fractal Adaptive Trend Glide was conceived for trending FX pairs, metals, and index charts on intermediate timeframes — roughly M15 through H4. The M15–H4 range tends to offer a balance between having enough directional movement for the FRAMA line to lock onto and avoiding the noise-heavy behavior of very fast charts.
Importantly, the strategy is single-timeframe and never hardcodes a timeframe — it runs on whatever timeframe the chart or backtest selects. This makes it a flexible platform for experimentation: you can test the same logic across several timeframes and symbols to see how the fractal dimension and adaptive smoothing respond to different market characters. Keep in mind that results will vary considerably across different instruments and market conditions, and a setting that behaves well on one symbol may behave very differently on another.
How to Install on MetaTrader 5
- Download the .ex5 file from the link below.
- Copy it to your MT5
MQL5\Expertsfolder. - Restart MetaTrader 5 or refresh the Navigator panel.
- Drag the EA onto a chart matching the recommended symbol and timeframe.
- Configure the input parameters and enable Algo Trading.
What to Consider Before Using This EA
Every strategy has a shape — conditions it is built for and conditions it struggles in. Understanding both is part of using any tool responsibly.
Strengths of this approach:
- The adaptive smoothing means the FRAMA line reacts quickly in trends but flattens in ranges, which historically helps a trend system avoid some of the whipsaws that plague fixed-period moving averages.
- The fractal-dimension regime gate adds a second, independent filter: even if a crossover occurs, no trade is taken unless the market is statistically classified as trending. This is a thoughtful design choice that targets the exact weakness of MA-cross systems.
- Volatility-scaled stops adapt the risk model to current conditions instead of relying on a fixed distance.
Known limitations:
- Like all trend-following methods, this strategy can underperform in prolonged sideways or news-driven markets, where crossovers may still occur near the dimension threshold and produce losing trades before the filter fully rejects them.
- FRAMA, while adaptive, still lags at major turning points — it is a smoothed line, not a leading indicator, so entries occur after a move has begun.
- The fixed reward-to-risk ratio means the strategy relies on trends running far enough to reach the take-profit; in markets that reverse before hitting the target, winners can be cut short by the stop.
- A single fixed lot size does not scale risk to account equity, so position sizing must be managed carefully by the user.
This is a framework for study and refinement, not a finished, hands-off system. Its behavior should be observed and understood before any consideration of live use.
Risk Management Tips
Sound risk management matters far more than any single indicator setting. Whatever strategy you study, these principles apply:
- Risk only a small fraction per trade. A common guideline is to risk no more than 1–2% of account equity on any single position. Size your lots so that the ATR-based stop distance stays within that limit.
- Always test on a demo account first. Run the EA in simulation for an extended period across different market conditions before considering real capital.
- Understand drawdown. Even a well-designed trend system will experience losing streaks. Know the largest peak-to-trough decline you are willing to tolerate, and stop to reassess if it is reached.
- Use a position size you can hold through volatility. Oversized positions force emotional decisions; conservative sizing lets the strategy's logic play out.
- Never trade money you cannot afford to lose, and treat every parameter as something to be validated, not trusted blindly.
Risk Warning
Trading foreign exchange, CFDs, and other leveraged financial instruments involves substantial risk of loss and is not suitable for all investors. The strategies and tools discussed on this page are provided for educational purposes only and do not constitute financial advice, investment recommendations, or solicitation to trade. Always consult a qualified financial adviser before making trading decisions. Past backtest performance is not indicative of future results.
Downloads
- Expert Advisor: FractalAdaptiveTrendGlide.ex5 (34 downloads)
- Source Code: FractalAdaptiveTrendGlide.mq5 (36 downloads)
- Documentation: FractalAdaptiveTrendGlide.pdf (39 downloads)