What Does DPO Measure?
The difference between a previous price and a moving average is measured by the Detrended Price Oscillator (DPO). Remember that DPO is also shifted to the left. The indicator oscillates above/below zero as prices move above/below the displaced moving average. Chart 2 shows the S&P 500 ETF (SPY) with a 20-day moving average displaced -11 days. 20-day DPO is shown in the indicator window. Notice how DPO is positive when price is above the displaced moving average and negative when price is below the displaced moving average.

Chart 2
Using DPO
This indicator is not made for momentum signals, while having the appearance of a traditional oscillator. The DPO is displayed in the past because the displaced moving average is set in the past. Cycle length can still be estimated using DPO peaks and troughs despite this displacement. To concentrate on shorter cycles, DPO eliminates the longer trends.
The DPO (20) is shown in the indicator pane of the chart below. A 20-day cycle can be seen when examining the highs and lows, with the lowest points occurring in early September, early October, early November, and early December. The interval between these lows is about 20 days. In early January, the cycle was missed.

Chart 3
To Shift or Not to Shift
It is possible to displace the Detrended Price Oscillator (DPO) with a horizontal shift to the right. If DPO is set at 20, then an 11-period shift is needed to place it in line with the most recent price. This displacement number comes from the formula at the top (20/2 + 1) = 11. While shifting may seem like a good idea, it really defeats the purpose of this indicator, which is to identify cycles.

Chart 4
Prices do not correspond well with DPO movements, even when there is a positive displacement. The last value for DPO (20,11) in the example below is still determined by the moving average value and the closing 11 days ago. As you can see from the orange box, the DPO went negative eleven days ago when the price fell below the centered moving average. DPO just doesn’t reflect the state of the market. Unlike DPO, the price has spent the last 12 days below the 20-day EMA. For determining overbought and oversold levels, the Percentage Price Oscillator (PPO) is a more appropriate tool. The percentage difference between the current price and the typical 20-day exponential moving average is displayed as PPO(1,20,1). Prices that deviate significantly from their 20-day EMA are said to be overbought or oversold.

Chart 5
The Bottom Line
The Detrended Price Oscillator shows the difference between a past price and a simple moving average. In contrast to other price oscillators, DPO is not a momentum indicator. Instead, it is simply designed to identify cycles with its peaks and troughs. Cycles can be estimated by counting the periods between peaks or troughs. Users can experiment with shorter and longer DPO settings to find the best fit.
What is the Contrast Between Favored Stock and Normal Stock?
Day Trading Guide for August 7, 2024: Intraday supports, resistances for Nifty50 stocks
