Open-source scriptindicator/v1
Commodity Channel Index
Measure how far typical price deviates from its rolling statistical average.
#cci#momentum#oscillator
Description
The Commodity Channel Index compares typical price with its moving average and mean deviation. Although originally designed for commodities, it is widely used across markets to study momentum, cyclical movement, and unusually strong deviations.
Open-source script. Everyone can inspect the source code, use the script on a chart, and save an editable copy.
Release notes
Version history · 1 published version
Version 1CurrentChart updatedCommodity Channel Index · Aug 31, 2026
Source codempl-2.0View sourceHide source
indicator("Commodity Channel Index", { overlay: false });
const length = input.int("Length", 20, { min: 2, max: 500 });
const source = input.source("Source", "hlc3");
plot(cci(source, length), { title: "CCI", color: "#2962ff", lineWidth: 2 });
hline(100, { title: "+100", color: "#ef5350", style: "dashed" });
hline(0, { title: "Zero", color: "#78909c", style: "dotted" });
hline(-100, { title: "-100", color: "#26a69a", style: "dashed" });
Community discussion
0 comments
No comments yet. Start the discussion.