Detrended Price Oscillator: stripping the trend to find the cycle
How the DPO removes the trend by subtracting a displaced moving average, why it is shifted backward, and what it is genuinely for.
Detrended Price Oscillator is free on Basis — the button opens a live crypto chart with it already applied. No account, no trial and no limit on how many indicators you add.
Open the chartWhat it measures
The DPO subtracts a moving average from price, but the average is taken from a point in the past rather than from the current bar. That displacement is what removes the trend instead of merely lagging it.
What is left is the cyclical component: how price oscillates around its own trend, with the trend itself taken out.
It is a cycle-measuring tool, not a momentum one, and using it as a momentum oscillator misses its entire purpose.
How it is calculated
These are the steps Basis performs, verified against the published definition.
- 1
Compute a simple moving average over the period.
- 2
Shift that average backward by half the period plus one bar.
- 3
Subtract the shifted average from the current price.
- 4
Plot the result around a zero line.
Settings
| Setting | Default | Range |
|---|---|---|
| Length | 21 | 1 – 500 |
The period should be set to roughly the cycle you are trying to isolate. Twenty is a common default and is arbitrary; measuring the actual peak spacing and setting the period from that is the intended workflow.
How to read it
- Peaks and troughs mark where price sat furthest from its own trend, and the spacing between them is the dominant cycle length.
- Once you know the cycle length, you know roughly how long a typical swing lasts — which is a scheduling fact, not a signal.
- Zero crossings are not entries. The line crosses zero every cycle by construction.
- The amplitude tells you how far price typically travels from trend, which is useful for setting expectations on a swing.
- The practical payoff is planning rather than entry. If the DPO shows a twenty-bar dominant cycle, you know roughly how long to give a swing before concluding it has failed, and roughly how far from trend to expect price to travel — both of which are decisions people usually make by feel.
Where it misleads
The backward shift means the most recent half-period plus one bars have no value at all, and the indicator simply stops short of the current bar. That is correct behaviour — the displaced average for those bars does not exist yet — but it means the DPO can never comment on right now, and any strategy triggering on its latest value is either using a broken implementation or reading a value that will not exist until later.
Plot Detrended Price Oscillator on a live chart
Basis is free. Every indicator, every chart type, order flow, derivatives, screening and backtesting — no paid tier and no account needed to open a chart.
Open a chart with DPORelated indicators
Updated 2026-08-22 · Educational reference, not financial advice.