TSI (Function)
The TSI series function calculates returns a double value between -100 and 100, regardless of the asset it is applied to.
Syntax
TSI(Price, SmoothingLength1, SmoothingLength2)
Returns (Double)
A numeric value containing TSI for the current bar.
Parameters
Name |
Type |
Description |
Price |
Numeric |
Price value or EasyLanguage expression to use in calculation of the True Strength Index. |
SmoothingLength1 |
Numeric |
Number of bars used in the calculation of the first smoothing factor used in the calculation of the True Strength Index |
SmoothingLength2 |
Numeric |
Number of bars used in the calculation of the second smoothing factor used in the calculation of the True Strength Index |
Remarks
The equation for the True Strength Index, TSI is:
1. Calculate the price difference from the prior bar to the current bar: Price – Price[1]
2. Double-smooth the price difference using an exponential smoothing
3. Double-smooth the absolute value of the price difference using an exponential smoothing.
4. Divide the value from step 2 by the value from step 3
5. Multiply the result by 100
The input Price is usually hard coded with some bar attribute such as Close, Open, High, Low, and Volume or is replaced with a numeric series type input. However, it can be replaced with a valid EasyLanguage expression. For example: Close + Open or Average(Close, 10).
Examples
Plot1( TSI( Close, 25, 13 ) );