OPEN-SOURCE SCRIPT
TPI | TRW

⯁ OVERVIEW
The TPI | TRW indicator is a custom momentum and trend strength tool designed to assess the prevailing market trend by averaging price data over a flexible period. It generates a score based on how the current price compares to a range of moving averages (SMAs, WMAs), and it normalizes this score to highlight the strength and direction of the trend.
◆ KEY FEATURES
◆ USAGE
⯁ CONCLUSION
The TPI | TRW indicator offers traders a versatile tool for assessing market momentum and trend strength. By leveraging a custom scoring system that compares the current price to a series of MAs, it provides valuable insights into market dynamics, helping traders make more informed decisions.
The TPI | TRW indicator is a custom momentum and trend strength tool designed to assess the prevailing market trend by averaging price data over a flexible period. It generates a score based on how the current price compares to a range of moving averages (SMAs, WMAs), and it normalizes this score to highlight the strength and direction of the trend.
◆ KEY FEATURES
- Trend Strength Scoring: Calculates a score by comparing the current price to multiple SMAs, providing a quantitative measure of trend strength.
Pine Script® array<float> values = array.new<float>() float score = 0. for i = 0 to period by 1 float ma = switch i_maType "SMA" => ta.sma(close, period+i) "WMA" => ta.wma(close, period+i) values.push(ma) for s in values if close > s score += 1 for s in values if close < s score -= 1 - Dynamic Range Normalization: Normalizes the trend score to a range between -1 and 1, simplifying the interpretation of trend strength.
- Visual Trend Gradient: Utilizes a color gradient to represent the trend direction and intensity, offering an intuitive visual cue for trend analysis.
- Customizable Lookback Period: Allows users to adjust the lookback period, enabling the indicator to be tailored to different market conditions and trading styles.
◆ USAGE
- Trend Confirmation: Use the score to confirm the direction and strength of the current market trend.
- Reversal Detection: Monitor changes in the score and color gradient for potential trend reversals or weakening momentum. (Green - uptrend, Yellow - ranging, Red - downtrend)
⯁ CONCLUSION
The TPI | TRW indicator offers traders a versatile tool for assessing market momentum and trend strength. By leveraging a custom scoring system that compares the current price to a series of MAs, it provides valuable insights into market dynamics, helping traders make more informed decisions.
Script open-source
In pieno spirito TradingView, il creatore di questo script lo ha reso open-source, in modo che i trader possano esaminarlo e verificarne la funzionalità. Complimenti all'autore! Sebbene sia possibile utilizzarlo gratuitamente, ricorda che la ripubblicazione del codice è soggetta al nostro Regolamento.
Declinazione di responsabilità
Le informazioni ed i contenuti pubblicati non costituiscono in alcun modo una sollecitazione ad investire o ad operare nei mercati finanziari. Non sono inoltre fornite o supportate da TradingView. Maggiori dettagli nelle Condizioni d'uso.
Script open-source
In pieno spirito TradingView, il creatore di questo script lo ha reso open-source, in modo che i trader possano esaminarlo e verificarne la funzionalità. Complimenti all'autore! Sebbene sia possibile utilizzarlo gratuitamente, ricorda che la ripubblicazione del codice è soggetta al nostro Regolamento.
Declinazione di responsabilità
Le informazioni ed i contenuti pubblicati non costituiscono in alcun modo una sollecitazione ad investire o ad operare nei mercati finanziari. Non sono inoltre fornite o supportate da TradingView. Maggiori dettagli nelle Condizioni d'uso.