Detrended Price Oscillator is calculated according to the following formula: DPO(i) = Close(i) - SMA(i, N) where N is the moving average period.