OPEN-SOURCE SCRIPT

Trend-Quality Indicator

BTCUSDT

Open source version of the Trend-Quality Indicator as described by David Sepiashvili in [Stocks & Commodities V. 22:4 (14-20)]

Q-Indicator and B-Indicator are available both separately or together


█ OVERVIEW

The Trend-Quality indicator is a trend detection and estimation tool that is based on a two-step filtering technique. It measures cumulative price changes over term-oriented semicycles and relates them to “noise”. The approach reveals congestion and trending periods of the price movement and focuses on the most important trends, evaluating their strength in the process. The indicator is presented in a centered oscillator (Q-Indicator) and banded oscillator format (B-Indicator).
  • Semicycles are determined by using a short term and a longer term EMAs. The starting points for the cycles are determined by the moving averages crossover.
  • Cumulative price change (CPC) indicator measures the amount that the price has changed from a fixed starting point within a given semicycle. The CPC indicator is calculated as a cumulative sum of differences between the current and previous prices over the period from the fixed starting point.
  • The trend within the given semicycle can be found by calculating the moving average of the cumulative price change.
  • The noise can be defined as the average deviation of the cumulative price change from the trend. To determine linear noise, we calculate the absolute value of the difference between CPC and trend, and then smooth it over the n-point period. The root mean square noise, similar to the conventional standard deviation, can be derived by summing the squares of the difference between CPC and trend over each of the preceding n-point periods, dividing the sum by n, and calculating the square root of the result.



█ Q-INDICATOR

The Q-Indicator is a centered oscillator that fluctuates around a zero line with no upper or lower limits, is calculated by dividing trend by noise.

The Q-Indicator is intended to measure trend activity. The further the Q is from 0, the less the risk of trading with a trend, and the more reliable the trading opportunity. Values exceeding +2 or -2 can be qualified as promising

Values:
  • in the -1 to +1 range (GRAY) indicate that the trend is buried beneath noise. It is preferable to stay out of this zone
  • in the +1 to +2 or -1 to -2 range (YELLOW) indicate weak trending
  • in the +2 to +5 range (BLUE) or -2 to -5 range (ORANGE) indicate moderate trending
  • above +5 range (GREEN) or below -5 (RED) indicate strong trending


Readings exceeding strong trending levels can indicate overbought or oversold conditions and signal that price action should be monitored closely.


█ B-INDICATOR

The B-Indicator is a banded oscillator that fluctuates between 0 and 100, is calculated by dividing the absolute value of trend by noise added to absolute value of trend, and scaling the result appropriately.

The B-indicator doesn’t show the direction of price movement, but only the existence of the trend and its strength. It requires additional tools for reversal manifestations.
The indicator’s interpretation is simple. The central line suggests that the trend and noise are in equilibrium (trend is equal to noise).

Values:
  • below 50 (GRAY) indicate ranging market
  • in the 50 to 65 range (YELLOW) indicate weak trending
  • in the 65 to 80 range (BLUE) indicate moderate trending
  • above 80 (GREEN) indicate strong trending


The 65 level can be thought of as the demarcation line of trending and ranging markets and can help determine which type of technical analysis indicator (lagging or leading) is better suited to current market conditions. Readings exceeding strong trending levels can indicate overbought or oversold conditions.
noisequalitytrendTrend Analysis

Open-source script

In true TradingView spirit, the author of this script has published it open-source, so traders can understand and verify it. Cheers to the author! You may use it for free, but reuse of this code in publication is governed by House rules. You can favorite it to use it on a chart.

Want to use this script on a chart?


Also on:

Disclaimer