Detrended Price Oscillator (DPO)
Unlike other oscillators, such as the stochastic or moving average convergence divergence (MACD), the DPO is not a momentum indicator. It instead highlights peaks and troughs in price, which are used to estimate buy and sell points in line with the historical cycle.The detrended price oscillator seeks to help a trader identify an asset’s price cycle. It does this by comparing an SMA to a historical price that is near the middle of the look-back period.
How to Calculate the Detrended Price Oscillator (DPO)
- Determine a lookback period, such as 20 periods.
- Find the closing price from x/2 +1 periods ago. If using 20 periods, this is the price from 11 periods ago.
- Calculate the SMA for the last x periods. In this case, 20.
- Subtract the SMA value (step 3) from the closing price x/2 +1 periods ago (step 2) to get the DPO value.
We have added these conditions:
- DPO is above/below level
- DPO crosses above/below level
You can easily do your conditions in Custom blocks. More informations you can find here:
How to import custom indicators to SQX: https://strategyquant.com/doc/programming-for-sq/import-export-custom-indicators-and-other-snippets/