Choppiness index
All indicators

LibraryVolatility

Indicator

Choppiness index

Whether the market is trending or moving sideways, on a scale from 0 to 100. High values mean choppy, sideways trade, low values a directional move. It says nothing about the direction itself.

VolatilityOwn pane1 inputCHOP

How it is calculated

The sum of the true ranges over the last length bars, divided by the highest high minus the lowest low of the same bars; the base 10 log of that ratio, divided by the base 10 log of the length, times 100. The first bar has no true range, so the first value comes one bar after the first full window. A window with no range has no value. After Dreiss 1993.

Reference: Dreiss 1993

How to read it

Above 61.8 the market is often called choppy and a trend unlikely to hold, below 38.2 trending. Long stretches of high values are often followed by a breakout, low values by a pause. The two levels are Fibonacci numbers by convention, not a law.

In a strategy

A regime filter: let a trend system trade only while ctx.ind("chop", length=14) is below 38.2, and a range system only while it is above 61.8.

Inputs

InputTypeDefaultRange or choices
LengthlengthWhole number14min 2, max 5000

What it draws

LineDrawn as
CHOPLine

Moves between 0 and 100. Guide lines at 38.2, 61.8.

Used in

No strategy template reads it yet.

OrionQuant