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.
Скрипт с открытым кодом
В истинном духе TradingView, создатель этого скрипта сделал его открытым исходным кодом, чтобы трейдеры могли проверить и убедиться в его функциональности. Браво автору! Вы можете использовать его бесплатно, но помните, что перепубликация кода подчиняется нашим Правилам поведения.
Отказ от ответственности
Информация и публикации не предназначены для предоставления и не являются финансовыми, инвестиционными, торговыми или другими видами советов или рекомендаций, предоставленных или одобренных TradingView. Подробнее читайте в Условиях использования.
Скрипт с открытым кодом
В истинном духе TradingView, создатель этого скрипта сделал его открытым исходным кодом, чтобы трейдеры могли проверить и убедиться в его функциональности. Браво автору! Вы можете использовать его бесплатно, но помните, что перепубликация кода подчиняется нашим Правилам поведения.
Отказ от ответственности
Информация и публикации не предназначены для предоставления и не являются финансовыми, инвестиционными, торговыми или другими видами советов или рекомендаций, предоставленных или одобренных TradingView. Подробнее читайте в Условиях использования.