Choppiness Index Indicator for MT4 and MT5

Written by Dominic Walsh · Published · Last updated

Here is the question this answers: did the market travel in a line or wander? The choppiness index indicator compares how far price moved bar by bar against how far it actually got, and turns the difference into a score from zero to a hundred that says nothing whatever about direction.

This build ships as a compiled .ex4 for MT4 and .ex5 for MT5; the screenshots below come from EURUSD H1.

Platforms MT4 (.ex4) + MT5 (.ex5)
Chart window Separate window (levels 38.2 / 50 / 61.8)
Plots 4: Choppiness Index, Trending regime, Transition, Choppy regime
Alerts popup, push notification, email, sound
Inputs 18

What the build actually draws

Four line plots, in a pane below price.

`Choppiness Index` traces dim gray at width 1.

`Trending regime` overlays aqua at width 3.

`Transition` overlays gold at the same width.

`Choppy regime` overlays tomato at width 3.

Reference lines sit at 38.2, 50 and 61.8.

  • Choppiness Index: line, dim gray, width 1
  • Trending regime: line, aqua, width 3
  • Transition: line, gold, width 3
  • Choppy regime: line, tomato, width 3
choppiness index indicator: The score crossing into the choppy band, EURUSD H1.
The score crossing into the choppy band, EURUSD H1.

What the build works out

Two measurements

The code sums each bar’s true range across the window. The highest high and lowest low over that same window give the distance price actually covered.

Turning the ratio into a score

`InpPeriod` `14` is Dreiss’s own figure. The ratio between those two numbers goes through a logarithm and gets scaled, which bounds the result between zero and a hundred.

Colouring the regime

`InpTrendLevel` `38.2` and `InpChopLevel` `61.8` split the scale into three. Whichever band the score sits in decides which of the three heavy overlays carries the value.

What the states mean

A low score means price travelled efficiently.

A high score means it covered ground and came back.

Aqua marks the trending band.

Tomato marks the choppy one.

Gold covers everything in between.

The score never says which way price went.

Alert channels in this build: popup, push notification, email and sound, one message per closed bar.

The score moving from one band to another is what reports. `EnableAlerts` decides whether it speaks and it appears as a terminal box already. A mobile, mail and the desktop route playing `SoundFile` all begin closed.

Every Choppiness Index Indicator input

Core settings

Setting What it does Default
InpPeriod Choppiness period n (Dreiss default 14). Bars in the comparison, `14`. 14
InpTrendLevel Trending boundary (CI at or below). Score at or under which it calls a trend, `38.2`. 38.2
InpChopLevel Choppy boundary (CI at or above). Score at or over which it calls chop, `61.8`. 61.8
InpX Panel X offset (px). 14
InpY Panel Y offset (px) – clears one-click panel. 120

Display settings

Setting What it does Default
InpShowPanel Show the regime panel. Show the regime panel, `true`. on
InpCorner Panel corner (0=UL 1=UR 2=LL 3=LR). Which corner it sits in, `0`. 0
InpFontSize Panel font size. 9
InpFont Panel font. Consolas
InpPanelBg Panel background. RGB 10,16,24
InpBorderColor Panel border. slate gray
InpTextColor Panel text. gainsboro

Alert settings

Setting What it does Default
EnableAlerts Whether a regime change speaks, `true`. on
EnablePopup It appears as a terminal box, `true`. on
EnablePushNotify A mobile can receive it, `false`. off
EnableEmail Mail can receive it, `false`. off
EnableSound (see inputs panel) off
SoundFile What the desktop route plays, `”alert.wav”`. alert.wav
choppiness index indicator: Inputs panel, the period above the two boundaries.
Inputs panel, the period above the two boundaries.

Chart and timeframe notes

A regime read helps most when you are deciding whether to trade at all. EURUSD H1 is the reference chart, where the score swings between bands a few times a week. On M5 chop dominates. On D1 the bands change slowly.

What this one cannot tell you

A low score says nothing about direction.

The score names a regime after the fact.

Both boundaries come from convention, not the maths.

Fourteen bars can call a regime that lasts three.

Copy the compiled Choppiness Index Indicator file into your MQL4/Indicators folder, and the MT5 build into MQL5/Indicators, then restart the terminal and drag it onto a chart. The step-by-step guide with screenshots is at how to install MT4 and MT5 indicators.

Background reading on the method behind the Choppiness Index Indicator: Market trend on Wikipedia, Average Directional Index at StockCharts ChartSchool.

Download the Choppiness Index Indicator for MT4 and MT5

The zip holds the compiled Choppiness Index Indicator build for MT4 and MT5, plus a short README. Compiled files only, no source. Enter your email below and the download link arrives in your inbox.

Download this indicator free

Enter your email and the file is yours. You also get the full MT4 and MT5 library.

  • 1,380+ indicators
  • MT4 and MT5 files
  • No spam, unsubscribe any time

FAQ

What does a Choppiness Index near 100 mean?

Price covered a great deal of bar-by-bar distance while ending up roughly where it started. That is the signature of a range, and it says the market wandered rather than travelling anywhere.

Why is InpTrendLevel set to 38.2?

It comes from the retracement ratios rather than from the calculation itself. Dreiss used those figures as the conventional boundaries, and most versions of the tool have kept them since.

What do the three coloured overlays add?

They carry the same score in a heavier line, coloured by which band it currently sits in. The dim gray curve runs underneath continuously, so you can read the value and the regime at a glance.

Does a low Choppiness Index mean buy?

No, and this is the common misreading. The calculation discards direction entirely, so a score of twenty says a strong move is under way without a word about which way it went.

Are results guaranteed?

No. Trading involves risk. Results are not guaranteed; past performance is not indicative of future results. Use the Choppiness Index Indicator as one input. Always backtest before trading live.

External references

Dominic Walsh - Forex trader and MT4/MT5 developer

About the author

Written by Dominic Walsh, a Forex trader and MT4/MT5 indicator, Expert Advisor and script developer. Every tool on forexmt4systems.com is tested on live charts before release and ships with ready-to-use compiled MT4 (.ex4) and MT5 (.ex5) files. Learn more about the trader and developer behind this site.

How we build, test and correct every tool: Editorial & Testing Policy. Trading carries risk; see the disclaimer.

Leave a Comment