Detrended price oscillator (DPO): isolating short-term cycles

Understand how the detrended price oscillator (DPO) filters out longer-term trends to highlight shorter-term price cycles, and how traders may use it to assess timing in ranging markets. This guide explains how the DPO works, how traders interpret its readings, and where the indicator may fit within a broader technical analysis approach.
Takeaways
- The DPO removes the long-term trend from price data to reveal shorter-term cyclical fluctuations around a smoothed baseline.
- It compares a displaced historical price with a moving average calculated at the current candle, making it a cycle-measurement tool rather than a real-time signal indicator.
- The default period is 20, with a displacement of 11 candles; shorter periods such as 14 may suit more active traders, while longer periods such as 40 may suit longer-term analysis.
- DPO peaks and troughs can help identify potential cyclical highs and lows, and are most useful in range-bound markets with consistent cyclical behaviour.
- The DPO is not suited to strongly trending markets; in a trend, oscillator peaks do not reliably indicate reversals.
- Combining the DPO with RSI, MACD, or Bollinger Bands® can add momentum and volatility context that the oscillator alone cannot provide.
What is the detrended price oscillator?
The detrended price oscillator (DPO) is a technical indicator designed to strip the long-term trend out of price data, leaving behind shorter-term cyclical fluctuations. Unlike most oscillators, which measure momentum or the rate of price change, the DPO isolates cycles: repeating periods of above-average and below-average price behaviour relative to a smoothed baseline. By removing the dominant trend, the DPO can help traders observe cyclical patterns that may otherwise be obscured by directional price movement.
The DPO emerged within the technical analysis community in the early-to-mid 1990s and sits within the broader family of cycle-based analytical tools. It does not attempt to predict where price will go next. Instead, it highlights where price sits relative to its recent average at a point displaced backward in time. This backward displacement is the defining feature of the indicator. Unlike a standard moving average crossover, which compares current price with a current average, the DPO compares a past closing price with the moving average calculated at the current candle. This produces an oscillator that is more closely aligned with the underlying price cycle rather than simply lagging current price action.
How is the detrended price oscillator calculated?
The DPO uses a straightforward formula, but its backward displacement sets it apart from standard oscillators. Understanding this displacement is important before applying the indicator.
The DPO formula
The DPO is calculated as follows:
Where:
- Close[(n/2 + 1) candles ago] is the closing price from (n/2 + 1) periods back
- SMA(n) is the simple moving average of the chosen period n, calculated up to the current candle
The displacement amount is n/2 + 1 periods
For the default period of 20, the displacement is 20/2 + 1 = 11. This means the DPO compares the price from 11 candles ago with the current 20-candle simple moving average, rather than comparing today’s price with today’s moving average.
Past performance is not a reliable indicator of future results.
Worked example
Assume a 20-period DPO on a daily chart. At any given candle, the calculation works like this: take the 20-day simple moving average of closing prices calculated up to the current candle, then subtract that moving average from the closing price that occurred 11 candles ago. If the current 20-day SMA is 152.40 and the closing price 11 candles ago was 148.20, the DPO value is 148.20 – 152.40 = –4.20. A negative DPO indicates that the price at that displaced candle was below the moving average; a positive DPO indicates it was above.
Past performance is not a reliable indicator of future results.
Interpreting the DPO value
The DPO oscillates above and below a zero line. A value above zero indicates that the price at the displaced candle was trading above the moving average, which is consistent with a cyclical peak at that point. A value below zero indicates price was below the moving average, which is consistent with a cyclical trough. Because the indicator looks back rather than at the current period, it does not produce real-time signals. Traders use it to identify the typical length and amplitude of historical price cycles, which can then inform timing decisions on current price action.
How the detrended price oscillator works in trading
The DPO works on the premise that prices in many instruments show recurring cyclical behaviour over time, alternating between periods where price tends to trade above its average and periods where it tends to trade below. By smoothing out the long-term trend, the DPO makes these cycles visible as positive and negative swings in the oscillator. A trader who can estimate the typical cycle length for a given instrument can use the DPO to assess where price could sit in the current cycle, and whether the market is approaching a potential cyclical turning point.
Reading DPO peaks and troughs
The main DPO readings are peaks, where the oscillator reaches a local maximum above zero, and troughs, where it reaches a local minimum below zero. A DPO peak that forms while price is near a recent high suggests that price is at or near a cyclical top relative to its recent average, and that a mean-reversion move lower may follow. A DPO trough forming while price is near a recent low suggests the opposite. These signals are most meaningful in instruments that show clear cyclical behaviour, such as range-bound equities, certain commodities with seasonal patterns, or instruments in a low-trend environment.
The zero line as a reference
The zero line on the DPO marks the point where the displaced price equals the moving average. Crossings from below zero indicate that price is moving from a below-average phase to an above-average phase in the cycle; crossings from above zero indicate the reverse. These crossings provide a simpler reading than waiting for a peak or trough to form, though they are less precise because they occur mid-cycle rather than at the turning point.
Estimating cycle length
One of the DPO’s most distinctive uses is measuring the average distance between successive peaks or successive troughs on the oscillator. This distance, measured in candles, gives an estimate of the average cycle length for the instrument being analysed. If the DPO consistently peaks every 18–22 candles, a trader can estimate that the current cycle may be of similar duration and use this as context when timing entries or exits. This cycle-length reading is applied prospectively to current price action, not to the historical DPO values themselves.
DPO settings for different trading styles
The DPO’s period setting directly determines the cycle length it is sensitive to, so choosing the right period for the instrument and timeframe in use is important for generating meaningful signals.
Period 14 – short-cycle identification
A 14-period DPO is sensitive enough to capture shorter price cycles and respond more quickly to recent price fluctuations. This setting may suit active traders using daily or intraday charts to identify short-term cyclical turning points. The trade-off is increased noise: a shorter period produces more frequent oscillator peaks and troughs, some of which may be false or low-significance signals. Confirmation with volume or a momentum indicator is particularly important at this setting.
Period 20 – standard cycle analysis
The 20-period DPO is the most commonly used setting and provides a reasonable balance between cycle sensitivity and noise reduction. It is commonly used by swing traders and position traders using daily charts to analyse cycles of approximately four weeks. This is the default setting in most charting platforms and provides a useful starting point for traders learning to apply the indicator.
Period 40 – longer cycle identification
A 40-period DPO smooths out shorter cycles and captures longer cyclical swings in price. This setting may suit longer-term traders who are less focused on intraday or multi-day noise and more interested in identifying broader cyclical turning points over one–two months. The DPO at this setting produces fewer signals, but those signals reflect the longer timeframe of the underlying cycle.
Core detrended price oscillator trading strategies
The DPO supports several practical trading approaches. It can be used as a direct entry signal, a timing tool for exits, a zero-line guide, or a cycle-measurement reference.
Cycle trough entry strategy
The most direct DPO strategy involves looking for a potential long setup when the oscillator has reached a clear trough below zero and is beginning to turn upward, suggesting that the cyclical low phase may be ending. Traders typically assess the entry on the price chart when price has also formed a recognisable reversal signal, such as a bullish candlestick pattern, a test of support, or a moving average bounce, rather than on the DPO reading alone. The DPO trough provides timing context; the price pattern provides the entry trigger. A trader may set the profit target at the estimated cycle peak, based on the amplitude of previous DPO peaks. They may place a stop-loss below the most recent price low. Stop-loss orders are not guaranteed. Guaranteed stop-loss orders incur a fee if activated.
Cycle peak exit strategy
The inverse of the trough entry, this strategy uses a DPO peak as context for exiting an existing long position or assessing a short entry. When the DPO reaches a level consistent with recent cyclical highs and begins to roll over, the cyclical upswing may be losing momentum. A trader holding a long position from the previous trough entry can use the DPO peak as an exit reference, subject to broader market context and confirmation. For potential short entries, the same caveats apply as for long entries: the DPO peak provides timing context, but the actual entry should be confirmed by a price reversal signal at a relevant level.
Zero-line crossover strategy
A simpler application of the DPO uses zero-line crossings as a timing guide. A crossover from below zero to above is interpreted as the start of a new above-average price phase; a crossover from above zero to below signals the start of a below-average phase. This strategy generates more frequent signals than the peak-and-trough approach and suits instruments where cyclical behaviour is consistent and clearly defined. The risk is that zero-line crossings occur in the middle of cycles rather than at turning points, meaning entries are less precisely timed than with the peak-trough method. False crossings in choppy or weakly cyclical markets are common.
Cycle length estimation and forward projection
Rather than using the DPO to generate entry signals directly, some traders use it purely as a cycle-measurement tool. By counting the average distance between successive DPO peaks or troughs over a historical sample, they estimate the typical cycle length and apply it prospectively to identify when the next turning point might be due on the current price chart. They combine this with a price-based entry method, such as a breakout, moving average signal, or candlestick pattern, timed to occur near the projected cyclical turning point. The DPO provides the timing context; price action provides the confirmation.
Combining the DPO with other indicators
Relative strength index
The RSI measures momentum and overbought and oversold conditions, while the DPO identifies cyclical position relative to the trend. When both align – for example, the DPO is at a trough below zero while the RSI is below 30 – the combined reading suggests that price is both near a cyclical low and stretched to the downside in momentum terms. This dual confirmation may help reduce false signals and provide additional context for a potential rebound setup. Conversely, a DPO peak above zero combined with an RSI reading above 70 may signal that price is at a cyclical high with overbought momentum, adding context for a potential pullback. The pairing works best in range-bound markets where both indicators suit the prevailing conditions.
MACD
The MACD measures momentum and trend direction through the relationship between two exponential moving averages. Pairing the MACD with the DPO allows traders to distinguish between cyclical moves that are occurring in line with the broader trend and those that are moving against it. When a DPO trough aligns with a MACD signal line crossover from below, both cyclical and momentum conditions may support a potential long setup. Conversely, a DPO peak aligning with a MACD crossover from above suggests that cyclical and momentum conditions are both pointing to a potential short entry or exit from a long position. This combination can be useful for identifying entries within an overall uptrend, provided the broader market context supports the signal.
Bollinger Bands®
Bollinger Bands® measure price volatility and identify conditions where price is trading at the extremes of its recent range. When a DPO trough coincides with price touching the lower Bollinger Band®, the cyclical low reading is reinforced by the bands’ indication that price is extended to the downside relative to its recent range. A subsequent close back inside the bands, combined with a DPO beginning to rise from the trough, provides additional context for a potential reversion-to-the-mean trade. Conversely, a DPO peak aligning with price touching the upper Bollinger Band® may indicate a cyclical high coinciding with a volatility extreme to the upside, strengthening the case for a potential mean-reversion move lower.
Volume analysis
Volume provides secondary confirmation for a DPO-derived cyclical signal. A DPO trough accompanied by declining volume suggests that selling pressure may be easing, consistent with a potential cyclical low. A DPO trough accompanied by expanding volume on down days suggests that selling is still active and the signal may be premature. Integrating volume analysis with DPO readings adds context that the oscillator alone cannot provide.
No single indicator is definitive. Combining the detrended price oscillator with a complementary tool may enhance context and signal reliability while reducing false positives. Discover more on our trading strategies page.
Common mistakes when using the detrended price oscillator
Many errors with the DPO arise from misunderstanding its fundamental design. It is a cycle-measurement tool, not a trend-following or real-time signal indicator. Applying it outside those parameters can lead to unreliable readings.
- Using it in strong trends: The DPO can move above and below zero during an ongoing trend. A peak in an uptrend doesn’t necessarily signal a reversal.
- Ignoring market context: The DPO is generally better suited to range-bound markets or instruments with clearer cyclical behaviour.
- Treating it as real-time: Because the DPO uses a displaced price, its readings reflect a past candle rather than current conditions.
- Using it in isolation: DPO readings can help assess cycle timing and size, but they shouldn’t be treated as standalone entry or exit signals.
- Over-optimising the period: A setting that fits past cycles may not work in live markets, where cycle lengths often vary.
- Ignoring amplitude: How far the DPO moves above or below zero matters. A shallow move may be weaker than one that reaches beyond recent typical ranges.
- Reacting to every zero-line move: Compare current readings with recent peaks and troughs before treating them as meaningful cycle signals.
FAQ
What does the detrended price oscillator measure?
The detrended price oscillator measures where price was at a point displaced backward in time relative to the current simple moving average. By subtracting the trend component from price, the DPO isolates shorter-term cyclical fluctuations – the alternating above-average and below-average phases that many instruments show over time. Peaks in the DPO can correspond to cyclical highs in price; troughs can correspond to cyclical lows.
How does the DPO differ from other oscillators like RSI or MACD?
The RSI and MACD measure momentum – the speed and direction of price change over a recent period. The DPO measures cyclical position, showing whether price at a past point in time was above or below its trend. It does not measure how fast price is moving, or whether it is overbought or oversold in the momentum sense. Instead, it shows where price sits within a recurring cycle, making it complementary to momentum oscillators rather than a substitute for them.
Is the detrended price oscillator suitable for day trading?
The DPO can be applied to intraday charts, but its usefulness depends on whether the underlying instrument shows clear short-term cyclical behaviour at the chosen timeframe. In highly liquid markets with consistent intraday patterns, such as certain equity futures or currency pairs during regular trading hours, the DPO on a short timeframe, such as a 5-minute or 15-minute chart, can identify intraday cyclical turning points. In less liquid or more erratically priced instruments, cycles are less consistent and the DPO produces noisier signals. Testing on a demo account before applying it to live intraday trading can be useful.
What is the best period setting for the DPO?
There is no universally best setting for the detrended price oscillator. The appropriate period depends on the instrument, the chart timeframe, and the typical cycle length of the market being traded. A period of 20 is the most common starting point on a daily chart and provides a reasonable baseline for analysis. If the DPO consistently peaks and troughs at shorter or longer intervals than the chosen period would suggest, adjusting the period to more closely match the observed cycle length may improve signal consistency.
Can the DPO predict future price movements?
The DPO does not predict future price movements directly. By identifying the historical cycle length of an instrument, it can inform a trader’s expectations about when the next cyclical turning point might be due, but this is a probabilistic estimate, not a prediction. Market cycles are irregular, and external events, trend changes, or regime shifts can disrupt previously consistent cyclical patterns. Past performance is not a reliable indicator of future results.
Does the DPO work in trending markets?
The DPO is designed to remove the trend from price data, which means it is not suited to trend-following applications. In a strongly trending market, the DPO will oscillate above and below zero, but the cyclical peaks and troughs it identifies do not necessarily correspond to meaningful reversal points in the underlying trend. The indicator is best applied in range-bound markets or instruments where cyclical behaviour is more dominant than directional trending behaviour.