OPEN-SOURCE SCRIPT
Trend Quality Score (TQS)

Trend Quality Score (TQS) is a composite indicator designed to evaluate the strength, direction, and consistency of a trend in a single normalized signal.
The indicator combines three core components derived from price action and directional movement:
These components are weighted and combined into a single score (TQS), which fluctuates around zero:
A configurable moving average can be applied to TQS to help identify shifts in trend quality and improve signal clarity.
Key Features
How to Use
Use TQS above zero to confirm bullish conditions and below zero for bearish conditions
Look for crossovers between TQS and its moving average as potential shifts in trend quality
Avoid trading when TQS is near zero, as this indicates low-quality or sideways markets
This indicator is designed as a confirmation and filtering tool and works best when combined with a broader trading strategy.
The indicator combines three core components derived from price action and directional movement:
- Directional Strength – Measures the relative dominance of buyers vs. sellers using the difference between +DI and -DI.
- Trend Strength (DX) – Captures the magnitude of directional movement, smoothed to reduce noise.
- Trend Persistence – Evaluates how consistently price has been moving in one direction over a defined lookback period.
These components are weighted and combined into a single score (TQS), which fluctuates around zero:
- Positive values indicate upward trend conditions
- Negative values indicate downward trend conditions
- Values near zero suggest weak or non-trending markets
A configurable moving average can be applied to TQS to help identify shifts in trend quality and improve signal clarity.
Key Features
- Combines strength, direction, and persistence into one metric
- Helps distinguish strong trends from choppy conditions
- Customizable smoothing and moving average type (SMA, EMA, WMA, RMA)
- Suitable for trend confirmation, filtering trades, or regime detection
How to Use
Use TQS above zero to confirm bullish conditions and below zero for bearish conditions
Look for crossovers between TQS and its moving average as potential shifts in trend quality
Avoid trading when TQS is near zero, as this indicates low-quality or sideways markets
This indicator is designed as a confirmation and filtering tool and works best when combined with a broader trading strategy.
Açık kaynak kodlu komut dosyası
Gerçek TradingView ruhuyla, bu komut dosyasının mimarı, yatırımcıların işlevselliğini inceleyip doğrulayabilmesi için onu açık kaynaklı hale getirdi. Yazarı tebrik ederiz! Ücretsiz olarak kullanabilseniz de, kodu yeniden yayınlamanın Topluluk Kurallarımıza tabi olduğunu unutmayın.
Feragatname
Bilgiler ve yayınlar, TradingView tarafından sağlanan veya onaylanan finansal, yatırım, alım satım veya diğer türden tavsiye veya öneriler anlamına gelmez ve teşkil etmez. Kullanım Koşulları bölümünde daha fazlasını okuyun.
Açık kaynak kodlu komut dosyası
Gerçek TradingView ruhuyla, bu komut dosyasının mimarı, yatırımcıların işlevselliğini inceleyip doğrulayabilmesi için onu açık kaynaklı hale getirdi. Yazarı tebrik ederiz! Ücretsiz olarak kullanabilseniz de, kodu yeniden yayınlamanın Topluluk Kurallarımıza tabi olduğunu unutmayın.
Feragatname
Bilgiler ve yayınlar, TradingView tarafından sağlanan veya onaylanan finansal, yatırım, alım satım veya diğer türden tavsiye veya öneriler anlamına gelmez ve teşkil etmez. Kullanım Koşulları bölümünde daha fazlasını okuyun.