True Strength Index TSI
The one-bar change of the price smoothed twice by exponential averages, divided by the same double smoothing of its absolute value, ×100: a momentum between −100 and 100 with little noise.
It measures momentum with the noise smoothed out.
01The study, live
Computed by Bentrix’s own code over the same synthetic bars on every page — an illustration of how the study behaves, not a market.
What this figure shows
The figure is computed over 300 sample bars. TSI has no value on the first 37 — the bars it needs before it can answer — and its first value stands on bar 38. Its line runs between -61.25 and 64.84 on these bars, and the last value is 18.61. Counting the conditions the study declares on these bars: crosses above -25 once; crosses below -25 once; crosses above 0 twice; crosses below 0 twice; crosses above 25 twice; crosses below 25 3 times. Press a condition under the figure to see each place marked. As states rather than moments: is above -25 on 169 bars; is below -25 on 94 bars; is above 0 on 126 bars; is below 0 on 137 bars; is above 25 on 88 bars; is below 25 on 175 bars.
02Its parts, named
03What you see
A smooth line in its own pane swinging around zero, usually between −100 and +100, with a signal line beside it.
04Where it comes from
William Blau introduced the TSI in Technical Analysis of Stocks & Commodities (1991) and developed it in Momentum, Direction, and Divergence (1995). He wanted a momentum measure smooth enough to read directly, without the lag of a long single average.
05The formula
Smooth the one-bar change twice, and divide it by its absolute value smoothed the same way (, are the common defaults):
TSI = 100 · (EMA(EMA(Δ P, r), s))/(EMA(EMA(| Δ P |, r), s))
The signal line is an EMA of the TSI. Because the numerator can never exceed the denominator, the TSI stays between −100 and +100.
06A worked example
Take the closes 20, 21, 23, 22, 24, 25, 24, 26. Their changes are +1, +2, -1, +2, +1, -1, +2.
Smooth the changes twice — an EMA of 3, then an EMA of 2 of the result (each started at the plain average of its first window): the double-smoothed change ends at 0.8364.
Do the same with the sizes of the changes (1, 2, 1, 2, 1, 1, 2): the double-smoothed size ends at 1.4691.
TSI = 100 × 0.8364 / 1.4691 = 56.93
If every change had been a rise the two figures would be equal and the TSI +100. The falls on two of the seven bars pull the numerator down while still adding to the denominator.
07Built in Assay
The same study written in Assay, Bentrix’s script language, and drawn by Bentrix itself as the script’s graph: each block is one step of the formula. On the ladder the steps stand in the script’s order, one a row; on the board each wire carries a value from the block that gives it to the block that reads it, left to right. The script computes exactly what the study computes — Bentrix checks the two against each other, candle by candle.
//@version=6 indicator("True Strength Index") firstLength = input.int(25, "First smoothing") secondLength = input.int(13, "Second smoothing") // The change from one close to the next, and its size whichever way it went. change = ta.change(close) // Both smoothed twice: first over `firstLength`, then over `secondLength`. smoothChange = ta.ema(ta.ema(change, firstLength), secondLength) smoothSize = ta.ema(ta.ema(math.abs(change), firstLength), secondLength) // The smoothed change as a percentage of the smoothed size: +100 if every move was up. tsi = na(smoothSize) ? na : smoothSize != 0 ? 100 * smoothChange / smoothSize : 0.0 plot(tsi, "TSI") hline(0)
Paste it into the Assay IDE to put it on a chart, or to change it. Looking at the graph is free in every package; editing it as blocks is Plus.
08Readings — what traders look for
Above or below zero. Read as the smoothed changes having been mostly up or mostly down.
Crossing its signal. Read as the smoothed momentum turning.
Divergence. A new price high with a lower TSI high is read as the move continuing with less one-sided momentum. See divergenceDivergencePrice makes a new high (or low) while an oscillator does not — the move is reaching further on less momentum..
How the zero line fails. Above zero, smoothed rises outweigh smoothed falls. After two smoothings the crossing is late, and in a range it recurs.
How the ±25 readings fail. Blau's levels for the default periods. In a strong trend the line stays at one end of its scale for a long time; a reading there describes the trend and does not mark its end.
09In different markets and timeframes
The True Strength Index is double-smoothed momentum as a share of double-smoothed movement: smooth, bounded and late. It suits trends on higher timeframes.
With 25 and 13 it settles after about 40 bars and turns after the move has shown itself: suited to H4, daily and weekly bars. In a trend it stays on one side of zero for the length of the trend, between about ±25 and ±50 on most markets; in a range it crosses zero at a slower rhythm than the swings. It is bounded between −100 and +100 and comparable between instruments. A gap enters as one large change and holds the reading for many bars.
10With other studies
Read with a signal line (7 to 12 bars), and beside the RSI, a single-smoothed relative.
11What it does not tell you
Two layers of smoothing make it smooth and late: by the time it turns, price has usually turned some bars earlier. A reading is about past changes only.
12Inputs and defaults
- 1First Smoothing Period — 25Period of the first smoothing, applied to the raw momentum
- 2Second Smoothing Period — 13Period of the second smoothing, applied to the first
- 3Applied price — CloseAny of the seven prices, and several at once, each its own line with its own look.
- 4Timeframe — ChartThe chart's own by default; any higher one, read on the last closed candle. A finer one is never offered.
- 5Wait for the candle to close — OnThe value of a higher timeframe is taken only from a candle that has finished.
What each input changes
- First Smoothing PeriodThe long EMA applied first (25). It sets how much of the recent past the index sums up.
- Second Smoothing PeriodThe short EMA applied to the result (13). It removes the jaggedness the first leaves.
- In use25 and 13 are Blau's.
13Limits and common misreadings
Its range is rarely reached. Values near ±100 need nearly every change in one direction for a long time; the useful range is usually much narrower.
Period choice. Short periods make it nearly as noisy as the raw momentum it was built to smooth.
14Conditions an alert or a strategy can watch
an event happens on one bar a state holds on every bar while it lasts
These are the conditions the study itself declares — the same rules the alert editor and the strategy engine read, and the ones the figure's chips show.
15Practise it in the laboratory
Attach TSI and MACD together. Step through a trend and its end, and note which turned first and by how many bars.
Open the laboratory17In Bentrix
- From the menu: a chart's Indicators button › Oscillators › TSI, or type TSI in its search.
- Its settings: the settings card opens when it is added; its legend's name opens it again.
18From an agent or a program
Two tools reach it. study_values computes it over a workbench’s candles up to the clock — no chart needed — and study_attach puts it on a chart, where it is drawn and saved with the chart ({"chart": "<chart uri>", "kind": "tsi"}).
The study, as a chart files it
This is a new TSI’s entry — its kind, its calculation, the price it reads and its settings. Change a setting here to read it with other inputs.
{
"applied": "close",
"convention": "talib",
"kind": "tsi",
"settings": {
"shape": "ta",
"values": {
"optInFirstPeriod": 25.0,
"optInSecondPeriod": 13.0
}
}
}An agent
An agent calls the MCP tool with it:
{
"name": "study_values",
"arguments": {
"bench": "bentrix://lab/\u2026/bench/\u2026",
"symbol": "EURUSD",
"timeframe": "H1",
"limit": 5,
"study": {
"applied": "close",
"convention": "talib",
"kind": "tsi",
"settings": {
"shape": "ta",
"values": {
"optInFirstPeriod": 25.0,
"optInSecondPeriod": 13.0
}
}
}
}
}A program
A program does the same in its language — bench and market as in the built-in indicators guide:
Python
values = client.study.values(bench, market, "H1", {"applied": "close", "convention": "talib", "kind": "tsi", "settings": {"shape": "ta", "values": {"optInFirstPeriod": 25.0, "optInSecondPeriod": 13.0}}}, limit=5)
print("times:", values["times"])
for line in values["lines"]:
print("line:", line["line"])
print(" newest values:", line["values"])JavaScript
const values = await client.study.values({ bench, symbol: market, timeframe: "H1", study: { "applied": "close", "convention": "talib", "kind": "tsi", "settings": { "shape": "ta", "values": { "optInFirstPeriod": 25.0, "optInSecondPeriod": 13.0 } } }, limit: 5 });
console.log("times:", values.times);
for (const line of values.lines) {
console.log("line:", line.line);
console.log(" newest values:", line.values);
}C#
var values = await client.Study.Values(bench, market, "H1", new Dictionary<string, object?> { ["applied"] = "close", ["convention"] = "talib", ["kind"] = "tsi", ["settings"] = new Dictionary<string, object?> { ["shape"] = "ta", ["values"] = new Dictionary<string, object?> { ["optInFirstPeriod"] = 25.0, ["optInSecondPeriod"] = 13.0 } } }, limit: 5);
Console.WriteLine($"times: {values!["times"]!}");
foreach (var line in values!["lines"]!.AsArray())
{
Console.WriteLine($"line: {line!["line"]!}");
Console.WriteLine($" newest values: {line!["values"]!}");
}Go
values := must(client.Study.Values(ctx, mcp.StudyValuesArgs{Bench: bench, Symbol: market, Timeframe: "H1", Study: map[string]any{"applied": "close", "convention": "talib", "kind": "tsi", "settings": map[string]any{"shape": "ta", "values": map[string]any{"optInFirstPeriod": 25.0, "optInSecondPeriod": 13.0}}}, Limit: mcp.Ptr[int64](5)}))
fmt.Println("times:", at(values, "times"))
for _, line := range at(values, "lines").([]any) {
fmt.Println("line:", at(line, "line"))
fmt.Println(" newest values:", at(line, "values"))
}Java
Object values = client.study.values(new Bentrix.StudyApi.ValuesArgs(bench, market, "H1", obj("applied", "close", "convention", "talib", "kind", "tsi", "settings", obj("shape", "ta", "values", obj("optInFirstPeriod", 25.0, "optInSecondPeriod", 13.0)))).limit(5L));
System.out.println("times:" + " " + at(values, "times"));
for (Object line : (List<Object>) at(values, "lines")) {
System.out.println("line:" + " " + at(line, "line"));
System.out.println(" newest values:" + " " + at(line, "values"));
}C++
auto values = client.study.values_(StudyApi::ValuesArgs(bench, market, "H1", Json::Object{{"applied", "close"}, {"convention", "talib"}, {"kind", "tsi"}, {"settings", Json::Object{{"shape", "ta"}, {"values", Json::Object{{"optInFirstPeriod", 25.0}, {"optInSecondPeriod", 13.0}}}}}}).limit(5));
std::cout << "times:" << " " << values["times"].dump() << std::endl;
for (const Json &line : values["lines"].arr()) {
std::cout << "line:" << " " << line["line"].dump() << std::endl;
std::cout << " newest values:" << " " << line["values"].dump() << std::endl;
}Julia
values = client.study.values(bench, market, "H1", Dict{String,Any}("applied" => "close", "convention" => "talib", "kind" => "tsi", "settings" => Dict{String,Any}("shape" => "ta", "values" => Dict{String,Any}("optInFirstPeriod" => 25.0, "optInSecondPeriod" => 13.0))); limit = 5)
println("times:", " ", values["times"])
for line in values["lines"]
println("line:", " ", line["line"])
println(" newest values:", " ", line["values"])
endR
values <- client$study$values(bench, market, "H1", list(applied = "close", convention = "talib", kind = "tsi", settings = list(shape = "ta", values = list(optInFirstPeriod = 25.0, optInSecondPeriod = 13.0))), limit = 5)
cat("times:", format(values$times), "\n")
for (line in values$lines) {
cat("line:", format(line$line), "\n")
cat(" newest values:", format(line$values), "\n")
}Rust
let values = client.study().values(mcp::StudyValuesArgs::new(bench.clone(), market.clone(), "H1", serde_json::json!({"applied": "close", "convention": "talib", "kind": "tsi", "settings": {"shape": "ta", "values": {"optInFirstPeriod": 25.0, "optInSecondPeriod": 13.0}}})).limit(5))?;
println!("times: {}", values["times"]);
for line in values["lines"].as_array().into_iter().flatten() {
println!("line: {}", line["line"]);
println!(" newest values: {}", line["values"]);
}Reading the answer
times— the candles’ open times, in milliseconds since 1970 (UTC), oldest first.lines— one entry per line, in this order, each with itslinename and itsvalues;values[i]belongs to the candle attimes[i].- The last value is the candle at the clock’s, which may still be forming: it changes until that candle closes, as on the chart. Nothing after the clock is ever computed.
nullis a candle with no value yet — the warm-up, about 1 × the period at the start of the history.- Its fixed levels, drawn on the chart:
[-25.0, 0.0, 25.0].
line | What it is |
|---|---|
Main | the indicator's own value |
In a strategy
Filed under a key of your choice in a strategy document’s studies — here tsi: {"tsi": {"applied": "close", "convention": "talib", "kind": "tsi", "settings": {"shape": "ta", "values": {"optInFirstPeriod": 25.0, "optInSecondPeriod": 13.0}}}} — its rules can name:
| Write | What it is |
|---|---|
tsi | its main line, as a value in a compare |
{"cond": "tsi:level.cross_up:-25"} | a condition it declares itself |
{"cond": "tsi:level.cross_down:-25"} | a condition it declares itself |
{"cond": "tsi:level.above:-25"} | a condition it declares itself |
{"cond": "tsi:level.below:-25"} | a condition it declares itself |
{"cond": "tsi:level.cross_up:0"} | a condition it declares itself |
{"cond": "tsi:level.cross_down:0"} | a condition it declares itself |
{"cond": "tsi:level.above:0"} | a condition it declares itself |
{"cond": "tsi:level.below:0"} | a condition it declares itself |
{"cond": "tsi:level.cross_up:25"} | a condition it declares itself |
{"cond": "tsi:level.cross_down:25"} | a condition it declares itself |
{"cond": "tsi:level.above:25"} | a condition it declares itself |
{"cond": "tsi:level.below:25"} | a condition it declares itself |
19Sources
- Blau, William. "True Strength Index." Technical Analysis of Stocks & Commodities, January 1991.
- Blau, William. Momentum, Direction, and Divergence. Wiley, 1995.
Bentrix 0.1.382Every number, name and default on these pages is read from the application itself.What is comingWhat changed