Detrended Price Oscillator — identifies cycles by comparing price with a lagged SMA.
Detrended Price Oscillator (DPO) compares price with its historical moving-average value, shifted back by half the period plus one bar. Unlike MACD and RSI, DPO is not a leading indicator and is not intended for real-time use — it helps identify past price cycles.
Formula:
DPO = Close - SMA(Close, period)[shifted back by 'Shift' bars]
Parameter Type Default Range / Values Periodint 20 1-200
Trigger Direction Condition Description Level cross up 🟢 Buy The indicator value crossed the specified level from below to above. The DPO line crosses the configurable level Level from below to above. Level is set in the trigger parameters. Level cross down 🔴 Sell The indicator value crossed the specified level from above to below. The DPO line crosses the Level from above to below. Level is set in the trigger parameters. Value above level by N 🟢 Buy The indicator value rose above the level by the specified distance. The DPO line crosses the Level + Distance mark, moving up. The distance delays entry until a confirmed breakout of the level. Value below level by N 🔴 Sell The indicator value dropped below the level by the specified distance. The DPO line crosses the Level − Distance mark, moving down. Value rising 🟢 Buy The indicator value is rising relative to the previous bar. The DPO line is higher on the current bar than on the previous one — upward momentum. Value falling 🔴 Sell The indicator value is falling relative to the previous bar. The DPO line is lower on the current bar than on the previous one — downward momentum. Fires on every declining bar. Slope turns positive 🟢 Buy The indicator slope turned positive — an upward reversal. The DPO line changes its slope from descending to ascending — the indicator stopped falling and started rising. Slope turns negative 🔴 Sell The indicator slope turned negative — a downward reversal. The DPO line changes its slope from ascending to descending — the indicator stopped rising and started falling. Zero cross up 🟢 Buy The indicator line crossed zero from below to above — a buy signal. The DPO line crosses the zero level from below to above. Zero cross down 🔴 Sell The indicator line crossed zero from above to below — a sell signal. The DPO line crosses the zero level from above to below.
Parameter Type Default Range / Values Level (Value above level by N, Value below level by N, Level cross up, Level cross down)float 0 Distance (Value above level by N, Value below level by N)float 0 0>