Skip to content

Connors RSI ​

Average of a short RSI, a streak RSI and a 100-bar percent rank.

Kind indicator · Drawn in its own pane

Try it ​

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

Inputs ​

InputTypeDefault
Sourcesource"close"
RSI lengthint3
UpDown lengthint2
ROC lengthint100
Colorcolor"#2962FF"

Source ​

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

js
indicator({ name: "Connors RSI", shortTitle: "CRSI", overlay: false, precision: 2 });
const src = input.source("Source", "close");
const rsiLength = input.int("RSI length", 3, { min: 1 }), streakLength = input.int("UpDown length", 2, { min: 1 }), rocLength = input.int("ROC length", 100, { min: 1 });
const streak = ta.recur([ta.change(src, 1)], { u: 0 }, (s, d) => (s.u = d === 0 ? 0 : d > 0 ? (s.u <= 0 ? 1 : s.u + 1) : s.u >= 0 ? -1 : s.u - 1));
const crsi = ta.calc([ta.rsi(src, rsiLength), ta.rsi(streak, streakLength), ta.percentrank(ta.roc(src, 1), rocLength)], (a, b, c) => (a + b + c) / 3);
plot(crsi, { title: "CRSI", color: input.color("Color", "#2962FF", { group: "Style" }) });
hline(70, { title: "Upper band", color: "#787B86", style: "dashed" });
hline(30, { title: "Lower band", color: "#787B86", style: "dashed" });
fill(70, 30, { title: "Background", color: "rgba(126,87,194,0.1)" });

AlphaScript language v0.1 · runtime 0.2.0