MOMENTUM & OSCILLATORS

Detrended price

Price with the trend stripped out, so only the shorter cycles remain.

spec id: dpolength (default 20)

What does Detrended price measure?

Price with the trend stripped out, so only the shorter cycles remain. It is used to spot the rhythm of a stock, not its direction.

How is Detrended price calculated?

Take the closing price from a little over half the window ago and subtract the 20-candle average. We use the BACKWARD-shifted form on purpose — the textbook version shifts the average forward, which would mean reading a candle that has not happened yet.

Written by reading the engine’s real computation, not a textbook — where the two differ, the page describes what actually runs.

How do I use Detrended price in a bot?

In the builder, add an indicator of type dpo (parameters: length, default 20). Its value becomes an operand you can compare in any entry or exit rule. The engine grades the whole rule honestly: real fills, no look-ahead, half the history held back.

Related indicators

Or browse all 158 indicators in the full library.

Build a bot that trades on Detrended price — the first backtest is free.

Run a free backtest