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.
Script open-source
Dans l'esprit TradingView, le créateur de ce script l'a rendu open source afin que les traders puissent examiner et vérifier ses fonctionnalités. Bravo à l'auteur! Bien que vous puissiez l'utiliser gratuitement, n'oubliez pas que la republication du code est soumise à nos Règles.
Clause de non-responsabilité
Les informations et publications ne sont pas destinées à être, et ne constituent pas, des conseils ou recommandations financiers, d'investissement, de trading ou autres fournis ou approuvés par TradingView. Pour en savoir plus, consultez les Conditions d'utilisation.
Script open-source
Dans l'esprit TradingView, le créateur de ce script l'a rendu open source afin que les traders puissent examiner et vérifier ses fonctionnalités. Bravo à l'auteur! Bien que vous puissiez l'utiliser gratuitement, n'oubliez pas que la republication du code est soumise à nos Règles.
Clause de non-responsabilité
Les informations et publications ne sont pas destinées à être, et ne constituent pas, des conseils ou recommandations financiers, d'investissement, de trading ou autres fournis ou approuvés par TradingView. Pour en savoir plus, consultez les Conditions d'utilisation.