On this page
DPO: Strip Out the Trend to See the Cycle
The **detrended price oscillator DPO** subtracts a displaced moving average from past price so that the longer trend cancels out and shorter cycles become visible. Unlike RSI or stochastic oscillators, DPO is not a momentum tool; it is a cycle detector.
Key Takeaways
- DPO equals price `(N/2 + 1)` bars ago minus the `N`-period simple moving average plotted at the same bar.
- The displacement aligns the SMA with the middle of its lookback window, so DPO measures price's distance from its own trend.
- Investors who treat DPO as a real-time signal misuse it because the displacement uses recent bars only as offset, not for forecasting.
- A 20-period DPO highlights cycles of about 10 to 20 days; longer settings highlight longer cycles.
Key Takeaways
- DPO equals price
(N/2 + 1)bars ago minus theN-period simple moving average plotted at the same bar. - The displacement aligns the SMA with the middle of its lookback window, so DPO measures price's distance from its own trend.
- Investors who treat DPO as a real-time signal misuse it because the displacement uses recent bars only as offset, not for forecasting.
- A 20-period DPO highlights cycles of about 10 to 20 days; longer settings highlight longer cycles.
What It Is
DPO is a two-step indicator. First, take a simple moving average over N bars. Second, subtract that SMA from the price observed (N/2 + 1) bars ago. The result oscillates around zero. Positive values mean price was above its trend at the time; negative values mean price was below.
By construction, DPO removes the long-term drift and exposes shorter swings. It is most useful when you want to estimate the period of a recurring cycle, not when you want a directional trade signal.
The Intuition
A 20-day SMA on a steady uptrend climbs alongside price. Subtracting the SMA from current price would mostly produce zero, because both move in lockstep. The information about the cycle below the trend would be lost.
DPO solves that by shifting the SMA into the middle of its own lookback window. The SMA at bar t summarizes the prior 20 bars; placing it at bar t - 11 puts it under the data it represents. Subtract that anchored trend from the original price and the remainder is the cyclical wiggle around the trend.
How It Works
The formula is:
DPO = Price(t - shift) - SMA_N(t)
where shift = N/2 + 1
For N = 20: shift = 11. DPO at the current bar uses today's 20-period SMA and price from 11 bars ago.
Note carefully: DPO is plotted on the bar (t - shift), the same bar whose price feeds the calculation. The line therefore appears 11 bars in the past on a chart. That makes DPO a backward-looking cycle measurement rather than a leading or coincident signal.
Common settings:
N = 20for short-term cycles of 10 to 20 barsN = 30for medium-term swingsN = 60to expose multi-month cycles
Some platforms offer a "no-displacement" DPO variant that plots on the current bar using forecasted SMA values. That version is not Lane's or the standard ChartSchool definition; use it knowingly.
Worked Example
Take a 20-period DPO on daily data. On Day 50:
- Day 50 close: 105 dollars
- 20-period SMA at Day 50: 100 dollars (covering Days 31 to 50)
- Day 39 close (11 bars before Day 50): 102 dollars
DPO at Day 39 equals 102 - 100 = +2. The chart plots +2 on Day 39.
The reading says that on Day 39, price was 2 dollars above its surrounding trend. If you scan past values, you might see DPO swing between roughly minus 3 and plus 3 with peaks every 12 to 15 bars. That regularity suggests a short-cycle behavior at roughly 12 to 15 bars, useful for setting expectations about timing of swings.
A trader cannot use DPO as a real-time trigger on Day 50 because the most recent DPO point is plotted on Day 39, eleven bars behind. The information is about cycle length and amplitude, not about today's entry.
Common Mistakes
- Using DPO for momentum signals. It is not a momentum tool. Centered detrending removes both momentum and trend. Use RSI or stochastic for momentum.
- Forgetting the lag. The DPO line lags by
shiftbars on a standard chart. Many users mistake the rightmost plotted point for a current bar. - Picking
Narbitrarily. ChooseNbased on the cycle length you want to expose, roughly twice the suspected cycle. A 20-period DPO highlights cycles of 10 to 20 bars. - Reading peak height as a percentage. DPO is in price units. A peak of
+2means 2 dollars, not 2 percent. Compare across stocks only after scaling by price. - Confusing standard DPO with no-displacement variants. A platform's "DPO" without displacement is a different indicator. Verify which formula your tool uses before backtesting.
Frequently Asked Questions
What is detrended price oscillator DPO in simple terms? DPO is an indicator that strips the underlying trend out of price so that the shorter cycles around the trend become easy to see. It plots positive when price was above its centered moving average and negative when below.
How does detrended price oscillator DPO affect investment decisions? DPO does not give direct buy or sell signals because it is lagged by half its period on the chart. Investors use it to estimate cycle length and amplitude, then time other signals such as moving average crossovers against the expected cycle phase.
What is a real-world example of DPO? On a stock that trends up while swinging in roughly 14-day cycles, a 20-period DPO oscillates between about plus 3 and minus 3 with peaks every 12 to 15 bars. The cycle length is much clearer than on the raw price chart, where the trend dominates.
How can investors use DPO effectively?
Pick N at roughly twice the cycle you suspect. Use DPO to confirm the cycle exists and to measure its amplitude. Combine with other indicators that give real-time signals, since DPO itself plots in the past.
How is DPO different from MACD? MACD measures the difference between two exponential moving averages and is a real-time momentum tool. DPO subtracts a displaced single SMA from past price and is a backward-looking cycle tool. The two answer different questions.
Sources
- StockCharts ChartSchool. Detrended Price Oscillator (DPO). https://chartschool.stockcharts.com/table-of-contents/technical-indicators-and-overlays/technical-indicators/detrended-price-oscillator-dpo
- Fidelity Learning Center. Detrended Price Oscillator (DPO). https://www.fidelity.com/learning-center/trading-investing/technical-analysis/technical-indicator-guide/dpo
- TradingView. Detrended Price Oscillator (DPO). https://www.tradingview.com/support/solutions/43000502246-detrended-price-oscillator-dpo/
- Incredible Charts. Detrended Price Oscillator (DPO). https://www.incrediblecharts.com/indicators/detrended_price_oscillator.php
Disclaimer
This article is educational content only and is not financial advice. Nothing here is a recommendation to buy, sell, or hold any security. Consult a licensed advisor before making investment decisions.