indicator · own pane · open source
Choppiness Index
Running…
Loading chart…
About
Choppiness Index measures how trendless the market is on a 0-100 scale. Below 38.2 = directional; above 61.8 = choppy / ranging.
- Use as a filter: trend systems work below 38.2, range systems work above 61.8.
- Climbs back into the chop zone after a trend = take profits or tighten stops.
Source code
//@version=5
indicator("Choppiness Index", overlay=false)
len = input.int(14, "Length", minval=2)
ci = 100 * math.log10(math.sum(ta.atr(1), len) / (ta.highest(high, len) - ta.lowest(low, len))) / math.log10(len)
hline(38.2, "Trending", color=color.green, linestyle=hline.style_dashed)
hline(61.8, "Choppy", color=color.red, linestyle=hline.style_dashed)
p_CI = plot(ci, "CI", color=color.purple, linewidth=2)
alertcondition(ta.crossunder(ci, 38.2), "Choppiness exits down", "Choppiness dropped below 38.2 — market is trending")
alertcondition(ta.crossover(ci, 61.8), "Choppiness enters up", "Choppiness crossed 61.8 — market is choppy")
No comments yet.
Sign in to comment.