What Is the Detrend Price Oscillator (DPO)?
An indicator called the Detrended Price Oscillator (DPO) was created to separate price trend and facilitate cycle identification. Since DPO is based on a displaced moving average, it does not extend to the latest date. However, since DPO is not a momentum oscillator, alignment with the most recent date is not a problem. Rather, cycle length is estimated and cycle highs and lows are identified using DPO.
Calculation
Copy
Price {X/2 + 1} periods ago less the X-period simple moving average.
X refers to the number of periods used to calculate the Detrended Price Oscillator. A 20-day DPO would use a 20-day SMA that is displaced by 11 periods {20/2 + 1 = 11}. This displacement shifts the 20-day SMA 11 days to the left, which actually puts it in the middle of the look-back period. The value of the 20-day SMA is then subtracted from the price in the middle of this look-back period. In short, DPO(20) equals price 11 days ago less the 20-day SMA.
Displaced Moving Average
The moving average is actually centered by the displacement of the moving average. Examine a simple moving average of 20 days that is 11 days to the left. Nine days are behind the moving average, ten days are ahead of it, and one day is near the moving average. This moving average is actually halfway through its look-back period. About half of the prices that were utilized in the computation are on the left, while the other half are on the right. The S&P 500 ETF (SPY) is displayed in Chart 1 together with a 20-day SMA offset of 11 days (pink line) and a 20-day SMA (green dotted line).. The ending values are the same (106.84), but the pink moving average ends on October 27th and the green moving average ends on November 11th, which is the last date on the chart. Also, notice how the “centered” moving average (pink) more closely follows the actual price plot.

What is the Contrast Between Favored Stock and Normal Stock?
Day Trading Guide for August 7, 2024: Intraday supports, resistances for Nifty50 stocks
