Skip to main content
All posts

What is a Detrended Price Oscillator? Definition, Formula, and Example

The Detrended Price Oscillator (DPO) is a technical analysis tool that removes long-term price trends from a chart to isolate short-term cycles and overbought/oversold extremes.

What is a Detrended Price Oscillator?

The Detrended Price Oscillator (DPO) is a technical analysis tool that removes long-term price trends from a chart to isolate short-term cycles and overbought/oversold extremes. By stripping out the broader directional bias, the DPO allows traders to identify the rhythmic peaks and troughs of an asset's price movement without being distracted by the overarching macro trend. The indicator oscillates above and below a zero line. Peaks in the DPO correspond to short-term price highs, while troughs correspond to short-term price lows. Because the DPO looks backward, it is displaced into the past, making it an analytical tool for cycle measurement rather than forward-looking trend generation.

How the Detrended Price Oscillator is Calculated

The DPO measures the distance between a past closing price and a moving average of that price, shifted forward by half the lookback period plus one bar. The standard lookback is 20 periods.

1. Lookback Period (N) = 20

2. Displacement = (N / 2) + 1 (which equals 11 periods for a 20-period DPO)

3. DPO = Close from (N/2 + 1) periods ago - Simple Moving Average (SMA) of N periods

By using the close from 11 periods ago, the indicator ignores the last 11 bars of price action. This displacement ensures the moving average aligns perfectly with the historical price cycle, effectively detrending the current price from the historical mean.

Worked Example

Consider MSFT using a 20-period DPO on a daily chart. The stock is in a strong uptrend, currently trading at $420. However, to calculate today's DPO, the indicator looks at the close from 11 days ago, which was $400. The 20-period SMA stretching back from 11 days ago was $395.

DPO = $400 - $395 = +$5.

The DPO prints at +$5. Despite MSFT currently trading at $420, the DPO indicates that 11 days ago, the price was $5 above its short-term mean. A trader analyzing this chart sees the cyclical rhythm of the stock, noting that every time the DPO hits +$5, MSFT enters a 3-day pullback.

When Traders Use It

Traders use the DPO to measure the length and amplitude of price cycles. By measuring the horizontal distance between consecutive DPO peaks, a trader determines the exact duration of the asset's cycle (e.g., a 14-day cycle). Once the cycle length is identified, traders project forward to anticipate future cyclical highs and lows. The DPO is also used to spot overbought and oversold extremes independent of the main trend, allowing swing traders to buy the dip in a bull market or sell the rip in a bear market.

Limitations and Common Misconceptions

The DPO is displaced into the past by design. It does not reach the right edge of the chart, meaning it cannot be used to generate real-time crossover signals. Traders using the DPO for live entries will execute late.

A common misconception is that the DPO predicts trend reversals. The DPO explicitly removes the trend; a DPO dropping below zero does not mean a bear market is starting, it merely indicates a short-term cyclical trough within the larger trend. The indicator must be paired with trend-following tools to establish directional bias.