Blog / Strategy
Strategy

Detrended Cycle Pullback

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 Detrended Cycle Pullback strategy is a pro-trend, cycle-timing pullback system built around the Detrended Price Oscillator (DPO) — a momentum tool that strips the underlying trend out of price so that its shorter-term rhythm becomes easier to read. Rather than trying to predict tops and bottoms in the raw price chart, this strategy uses the DPO to spot cyclical dips and rallies, then only acts on them when they line up with the direction of the larger trend. It is a trend-following approach with a timing filter, not a counter-trend or "reversal" system.

The DPO works by subtracting a horizontally displaced simple moving average (SMA) from the current closing price. Because the moving average is shifted back in time by roughly half its length, the calculation removes the slow drift of the market and leaves a cleaner oscillation that swings above and below a zero line. Deep negative swings tend to mark short-term troughs, while deep positive swings tend to mark short-term peaks. To decide how "deep" is deep enough to matter, the strategy scales its trigger band using the Average True Range (ATR), a common measure of volatility. This means the entry threshold adapts automatically to calm or fast markets instead of relying on a fixed distance.

As a learning tool, this strategy is well suited to traders who want to understand how oscillators, trend filters, and volatility-based risk controls can be combined into a single rules-based system. It is designed for trending market conditions, where pullbacks against the prevailing direction offer timing opportunities to rejoin the move. Think of this article as a strategy analysis — a way to study how the pieces fit together — rather than a shortcut to any particular outcome.

How It Works

The strategy evaluates its logic once per completed bar and holds at most one position at a time. Here is how the entry, exit, and risk logic works in plain English:

Because every calculation references the chart's active timeframe, the same logic runs consistently on whatever timeframe you attach it to.

Detrended Cycle Pullback MT5 EA
Illustrative example of the strategy’s entry and exit logic — not real trading results.

Strategy Parameters

Parameter Default Min Max Description
DpoPeriod 20 10 40 Length of the SMA used inside the Detrended Price Oscillator. Shorter values react faster to short cycles; longer values smooth them.
TrendEmaPeriod 100 40 200 Length of the slow trend EMA that defines whether only longs or only shorts are allowed.
AtrPeriod 14 7 28 Lookback for the ATR used to size the trigger band, stop, target, and trail.
BandAtrMult 0.75 0.20 2.0 Multiplier that sets how deep the DPO must swing (in ATRs) to count as a cyclical extreme.
SlAtrMult 1.5 0.8 3.0 Initial stop-loss distance, expressed as a multiple of ATR.
TpAtrMult 2.5 1.0 5.0 Take-profit distance, expressed as a multiple of ATR.
TrailAtrMult 2.0 1.0 4.0 Distance of the ATR trailing stop once the trade is in profit.
BreakevenR 1.0 0.5 2.0 Profit, in multiples of initial risk (R), at which the stop moves to breakeven.
Lots 0.10 0.01 1.0 Fixed position size in lots for each trade.
Detrended Cycle Pullback MT5 EA — MQL5 source code

Recommended Chart Settings

This strategy was designed to run on a single symbol and the chart's primary timeframe, with all indicator readings taken from that timeframe. A common starting point for studying oscillator-and-trend systems like this is a major forex pair (for example, EUR/USD) on an intraday timeframe such as H1 (1-hour), where trends are frequent enough to produce pullbacks yet noise is more manageable than on very low timeframes. That said, the DPO period, EMA period, and ATR-based multipliers all interact with the character of the instrument and timeframe you choose. Results will vary across different symbols, sessions, and market conditions, so treat any single configuration as a study baseline rather than a fixed recommendation.

How to Install on MetaTrader 5

What to Consider Before Using This EA

The main strength of the Detrended Cycle Pullback approach is discipline: it combines a clear trend filter, a volatility-adaptive timing trigger, and fully mechanical risk management. By only taking pullbacks in the direction of the trend, it avoids the common trap of fighting a strong move, and the ATR-scaled band means the same rules behave sensibly across calm and volatile periods. The breakeven-then-trail exit logic is a textbook way to cap losers while giving winners room to run.

There are also real limitations to understand. The DPO is a smoothed, displaced calculation, which means its signals can lag the actual turning point in price. In choppy or ranging markets, the trend EMA can flip direction repeatedly and pullback signals may resolve into false starts, producing a string of small losses. Strong trending markets that never pull back deeply enough to reach the band may generate few trades at all. Like any single-position, fixed-lot system, it does not adapt position size to account equity, and it does not include a news or session filter — so unexpected volatility events can still hit the stop. No indicator combination removes uncertainty; the DPO may indicate a cycle turn that price simply does not confirm.

Risk Management Tips

Sound risk management matters more than any single entry rule. As a general education-focused checklist:

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