Skip to content

Chande Kroll Stop ​

Stops from the N-bar extreme minus ATR, for longs and shorts.

Kind indicator · Drawn on the price pane

Try it ​

On the chart, press / and choose Chande Kroll Stop under Trend. To change it, copy the source below into the AlphaScript editor.

Inputs ​

InputTypeDefault
ATR lengthint10
ATR coefficientfloat1
Stop lengthint9
Stop short colorcolor"#FF6D00"
Stop long colorcolor"#2962FF"

Source ​

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

js
indicator({ name: "Chande Kroll Stop", shortTitle: "CKS", overlay: true });
const p = input.int("ATR length", 10, { min: 1 }), x = input.float("ATR coefficient", 1, { step: 0.1 }), q = input.int("Stop length", 9, { min: 1 });
const atr = ta.atr(p);
const highStop = ta.calc([ta.highest(candle.high, p), atr], (h, a) => h - x * a), lowStop = ta.calc([ta.lowest(candle.low, p), atr], (l, a) => l + x * a);
plot(ta.highest(highStop, q), { title: "Stop Short", color: input.color("Stop short color", "#FF6D00", { group: "Style" }) });
plot(ta.lowest(lowStop, q), { title: "Stop Long", color: input.color("Stop long color", "#2962FF", { group: "Style" }) });

AlphaScript language v0.1 · runtime 0.2.0