Skip to content

True Strength Index ​

Double-smoothed momentum with a signal line.

Kind indicator · Drawn in its own pane

Try it ​

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

Inputs ​

InputTypeDefault
Long lengthint25
Short lengthint13
Signal lengthint13
Sourcesource"close"
TSI colorcolor"#2962FF"
Signal colorcolor"#E91E63"

Source ​

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

js
indicator({ name: "True Strength Index", shortTitle: "TSI", overlay: false, precision: 2 });
const longLength = input.int("Long length", 25, { min: 1 }), shortLength = input.int("Short length", 13, { min: 1 });
const signalLength = input.int("Signal length", 13, { min: 1 });
const src = input.source("Source", "close");
const t = ta.calc([ta.tsi(src, shortLength, longLength)], (v) => 100 * v);
plot(t, { title: "True Strength Index", color: input.color("TSI color", "#2962FF", { group: "Style" }) });
plot(ta.ema(t, signalLength), { title: "Signal", color: input.color("Signal color", "#E91E63", { group: "Style" }) });
hline(0, { title: "Zero", color: "rgba(120,123,134,0.5)", style: "dashed" });

AlphaScript language v0.1 · runtime 0.2.0