Skip to content

Woodies CCI ​

CCI 14 histogram with a fast turbo CCI.

Kind indicator · Drawn in its own pane

Try it ​

On the chart, press / and choose Woodies CCI under Oscillators. To change it, copy the source below into the AlphaScript editor.

Inputs ​

InputTypeDefault
CCI Turbo lengthint6
CCI 14 lengthint14
Turbo colorcolor"#2962FF"
CCI 14 colorcolor"#FF6D00"

Source ​

From packages/alphascript/indicators/woodiescci.as.js.

js
indicator({ name: "Woodies CCI", shortTitle: "Woodies CCI", overlay: false, precision: 2 });
const turboLength = input.int("CCI Turbo length", 6, { min: 3, max: 14 }), length = input.int("CCI 14 length", 14, { min: 7, max: 20 });
const hlc3 = ta.calc([candle.high, candle.low, candle.close], (h, l, c) => (h + l + c) / 3);
const turbo = ta.cci(hlc3, turboLength), cci = ta.cci(hlc3, length);
/** @param {number} k @param {1 | -1} sign */
const all = (k, sign) => { for (let i = 0; i < k; i++) if (!(sign * cci.at(i) > 0)) return false; return true; };
plot(cci, { title: "CCI Turbo Histogram", style: "histogram", palette: ["#26A69A", "#EF5350", "#787B86"],
  colorIndex: ta.calc([cci], () => (all(6, 1) ? 0 : all(6, -1) ? 1 : 2)) });
plot(turbo, { title: "CCI Turbo", color: input.color("Turbo color", "#2962FF", { group: "Style" }) });
plot(cci, { title: "CCI 14", color: input.color("CCI 14 color", "#FF6D00", { group: "Style" }) });
hline(0, { title: "Zero", color: "#787B86", style: "solid" });
hline(100, { title: "100", color: "#787B86", style: "dashed" });
hline(-100, { title: "-100", color: "#787B86", style: "dashed" });
hline(200, { title: "200", color: "rgba(120,123,134,0.5)", style: "dotted" });
hline(-200, { title: "-200", color: "rgba(120,123,134,0.5)", style: "dotted" });

AlphaScript language v0.1 · runtime 0.2.0