Detrended price oscillator
Price compared with a moving average shifted back in time, to remove the trend and show the cycles.
What it shows
DPO compares the close with a simple moving average from half a period ago. For a 20-bar average, it uses the average shifted back by 11 bars. This lines up the average's center with the price.
The result is the price without the slope of the trend, so cycles are easier to see.
How we find it
The same code that draws it on your chart follows these steps, with the same result every time.
- N = 20. Shift = N ÷ 2 + 1 = 11.
- DPO = close − SMA(N), shifted back by 11 bars.
- Plot under the price.
- Mark zero.
Starting values: N 20; Shift 11 bars. These are proposed and will be tuned on real price data before launch.
How to read it
- The panel shows DPO.
- Peaks and troughs show swings around the average.
- The dashed line is zero.
Status labels you may see
| Label | What it means |
|---|---|
| Above zero | Close above the shifted average. |
| Below zero | Close below it. |
| Near zero | Within 1%. |
What cancels it
Nothing cancels it.
What traders check next
- Spacing between peaks.
- Price trend.
- Cycle length.
Limits
- The latest values are not available, because of the shift.
- Not for timing.
- Averages lag.
Try it in forecastviz
- Open any ticker and choose Relative strength, cycles and structure → Detrended price oscillator in the left menu.
- Switch between 6M, 1Y to see how the picture changes.
- Compare with Dominant cycle and Simple moving average on the same chart.
Questions
What does it remove?
The long-term slope.
Why shift?
To center the average on the price.
Related trends
Further reading
- O'Neil, How to Make Money in Stocks
- Levy, The Relative Strength Concept of Common Stock Forecasting
- Pring, Technical Analysis Explained
- Frost and Prechter, Elliott Wave Principle
- Hank Pruden, The Three Skills of Top Trading
- Hirsch, Stock Trader's Almanac
Educational only. Not financial advice, and not a price forecast. Charts are drawn by code from past price data, which may be delayed.