The True Strength Index (TSI) is a momentum oscillator that helps traders identify trends and potential reversal points in the market. Here’s how it works:
1. **Price Change Calculation**: - **`pc = ta.change(price)`**: This calculates the change in price (current price minus the previous price).
2. **Double Smoothing**: - **`double_smooth(src, long, short)`**: This function smooths the price change data twice using two Exponential Moving Averages (EMAs): - The first EMA smooths the raw data. - The second EMA smooths the result of the first EMA. - **`double_smoothed_pc`**: The double-smoothed price change. - **`double_smoothed_abs_pc`**: The double-smoothed absolute price change, which helps normalize the TSI value.
3. **TSI Calculation**: - **`tsi_value = 100 * (double_smoothed_pc / double_smoothed_abs_pc)`**: This calculates the TSI by dividing the double-smoothed price change by the double-smoothed absolute price change, then multiplying by 100 to scale the value. - The TSI oscillates around the zero line, indicating momentum. Positive values suggest bullish momentum, while negative values suggest bearish momentum.
4. **Signal Line**: - **`signal_line = ta.ema(tsi_value, signal)`**: This creates a signal line by applying another EMA to the TSI value. The signal line is typically used to identify entry and exit points.
5. **Buy and Sell Signals**: - **Buy Signal**: Occurs when the TSI crosses above the signal line (`ta.crossover(tsi_value, signal_line)`), indicating that bullish momentum is strengthening, which might suggest a buying opportunity. - **Sell Signal**: Occurs when the TSI crosses below the signal line (`ta.crossunder(tsi_value, signal_line)`), indicating that bearish momentum is strengthening, which might suggest a selling opportunity.
6. **Visual Representation**: - The TSI line and the signal line are plotted on the chart. - Buy signals are marked with green "BUY" labels below the bars, and sell signals are marked with red "SELL" labels above the bars.
**How to Use It**: - **Trend Identification**: When the TSI is above zero, it suggests an uptrend; when it's below zero, it suggests a downtrend. - **Buy/Sell Signals**: Traders often enter a buy trade when the TSI crosses above the signal line and enter a sell trade when the TSI crosses below the signal line. - **Divergences**: TSI can also be used to spot divergences between the indicator and price action, which can signal potential reversals.
The TSI is particularly useful in identifying the strength of a trend and the potential turning points, making it valuable for trend-following and swing trading strategies.
No verdadeiro espírito do TradingView, o autor desse script o publicou como código aberto, para que os traders possam compreendê-lo e analisá-lo. Parabéns ao autor! Você pode usá-lo gratuitamente, mas a reutilização desse código em publicações é regida pelas Regras da Casa. Você pode favoritá-lo para usá-lo em um gráfico.
As informações e publicações não devem ser e não constituem conselhos ou recomendações financeiras, de investimento, de negociação ou de qualquer outro tipo, fornecidas ou endossadas pela TradingView. Leia mais em Termos de uso.