Blog / Strategy
Strategy

Compression Ledge Continuation

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?

The Compression Ledge Continuation strategy is a trend-following continuation system built around a slow Simple Moving Average (SMA) baseline, an Average True Range (ATR) volatility filter, and a price-action pattern the strategy calls a compression ledge. A Simple Moving Average is the running average of recent closing prices, used here as the trend backbone. Average True Range measures how far price typically moves in one bar, giving every threshold in the system a volatility-scaled — rather than fixed — value. Together they let the strategy read the market in "ATR units" instead of raw pips, so the same logic behaves consistently across calm and volatile conditions.

The core idea is that trends rarely travel in a straight line. Instead, they tend to climb a staircase: a drive higher (or lower), then a short shelf where price pauses, coils and consolidates, then another drive. Each shelf is a brief compression pause resting on top of the trend baseline. The strategy is designed to identify one of these shelves and enter only when price closes decisively beyond it in the direction of the established trend. It is deliberately not a range-breakout system and not a mean-reversion fade — it only ever trades with the prevailing drift, treating the break of a compression shelf as the ignition of the next step up (or down).

As a learning tool, this strategy is well suited to traders who want to study trend continuation and structure-based risk placement. Because the stop-loss is anchored to the opposite edge of a tightly compressed shelf, the strategy demonstrates how a well-defined pause can produce a naturally tight, structurally-justified stop. It is best viewed as a study in combining a trend gate, a compression filter, and a "no-chase" entry rule — not as a shortcut to any particular outcome.

How It Works

The strategy evaluates its rules once per completed bar (it ignores the still-forming bar to avoid acting on incomplete data), while trade management runs on every tick. All comparisons are made in ATR units so the logic scales with volatility.

Trend gate (the direction filter):

Ledge gate (the compression filter):

Ignition (the entry trigger):

Stop-loss, take-profit, and breakeven:

compression ledge continuation MT5 EA
Illustrative example of the strategy’s entry and exit logic — not real trading results.

Strategy Parameters

Parameter Default Min Max Description
Lots 0.10 0.01 1.00 Fixed trade size in lots for each position.
SlowSma 50 20 150 Period of the slow SMA that defines the trend baseline.
SlopeBars 10 3 40 Lookback (in bars) used to measure the baseline's slope.
MinSlopeAtr 0.25 0.00 2.00 Minimum baseline slope, in ATR units, required to confirm a trend.
LedgeBars 5 3 15 Number of bars that form the compression shelf (ledge).
LedgeMaxAtr 1.20 0.40 3.00 Maximum shelf range, in ATR units, for a valid compression pause.
ShelfDipAtr 0.75 0.00 2.50 How far the shelf may dip past the baseline and still count as a pullback step (ATR units).
AtrPeriod 14 7 28 Period of the ATR used for all volatility-scaled thresholds.
MaxChaseAtr 0.50 0.10 2.00 No-chase filter: maximum distance the close may be beyond the shelf (ATR units).
RiskReward 1.6 0.8 4.0 Take-profit distance as a multiple of the initial risk (R multiple).
BreakevenR 1.0 0.0 3.0 Move the stop to breakeven after price travels this many R in profit.
BufferAtr 0.10 0.00 0.50 Extra cushion beyond the shelf edge for the stop-loss (ATR units).
compression ledge continuation MT5 EA — MQL5 source code

Recommended Chart Settings

The strategy was designed for trending majors and metals — for example EUR/USD, USD/JPY, and XAU/USD (gold) — on intraday-to-swing timeframes from M15 through H4. Because it reads only the primary chart timeframe, it will run on whichever timeframe you attach it to, but its logic is tuned around the pace and volatility typical of that M15–H4 band.

Keep in mind that market character changes over time. A symbol that trends cleanly in one period may chop sideways in another, and results will vary across different market conditions, sessions, and brokers. Testing on your own data and spreads is essential before drawing any conclusions.

How to Install on MetaTrader 5

What to Consider Before Using This EA

Strengths of the approach. The strategy's design places its stop where the market structure justifies it — just past a tightly compressed shelf — rather than at an arbitrary fixed distance. This tends to produce compact, well-defined risk on each trade. The trend gate keeps it aligned with the prevailing drift, and the no-chase filter is an explicit attempt to avoid the common continuation pitfall of entering breaks that have already run too far. The breakeven mechanism further reduces exposure on trades that advance and then stall.

Known limitations. Every filter that improves entry quality also reduces trade frequency. Requiring a sloping baseline, a genuinely compressed shelf resting on that baseline, a decisive closing break, and a not-yet-extended price all at once means qualifying setups can be relatively rare — the strategy may sit idle for long stretches. Moving-average trend gates are also lagging by nature: they confirm a trend only after it is underway, and they can whipsaw in ranging markets where the SMA slope hovers near the MinSlopeAtr threshold.

Where it may underperform. The system is built for trending conditions. In choppy, sideways, or sharply mean-reverting markets, apparent "shelves" may resolve against the trend, producing with-trend pullback losses. Sudden volatility spikes — around news releases, for instance — can blow through the tight structural stop before the breakeven logic engages. Because only one position runs at a time, the strategy also forgoes setups that appear while a trade is already open. None of these traits are flaws to be "fixed"; they are trade-offs to understand before deploying.

Risk Management Tips

Sound risk management matters more than any single entry rule. Consider these general principles:

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

← Back to Blog