Appearance
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
| Input | Type | Default |
|---|---|---|
| Long length | int | 25 |
| Short length | int | 13 |
| Signal length | int | 13 |
| Source | source | "close" |
| TSI color | color | "#2962FF" |
| Signal color | color | "#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" });