This indicator is based on a 2004 April issue of Technical Analysis of Stocks & Commodities article by David Sepiashvili.
The indicator estimates trends in terms of noise is the trend-noise balance indicator (B-indicator). This indicator 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 is a banded oscillator that fluctuates between zero and 100.
Another distinctive feature is that 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). Readings in the 50–65 range indicate weak trending; those in the 65–80 range indicate moderate trending; and ranges above 80 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.
//PRC_B-Trend quality | indicator
//22.03.2019
//Nicolas @ www.prorealcode.com
//Sharing ProRealTime knowledge
//converted from MT4 version from mladen
// --- settings
TrendPeriod = 4
NoisePeriod = 250
CorrectionFactor = 2
FastLength = 7
SlowLength = 15
SignalMultiplier = 15
LevelWeakStart = 50
LevelModerateStart = 65
LevelStrongStart = 80
// --- end of settings
Price = customclose
once alpha1 = 2.0 / (1.0+FastLength)
once alpha2 = 2.0 / (1.0+SlowLength)
once emaf=price
once emas=price
if barindex>NoisePeriod then
emaf = emaf[1]+alpha1*(price-emaf[1])
emas = emas[1]+alpha2*(price-emas[1])
imacd = emaf-emas
if imacd>0 then
sign = 1
endif
if imacd<0 then
sign = -1
endif
if (SignalMultiplier>0) then
trendQSign = sign*SignalMultiplier
endif
change = price-price[1]
if sign<>sign[1] then
cpc = 0
trend = 0
else
cpc = sign*change+cpc[1]
trend = cpc*(1.0/TrendPeriod)+trend[1]*(1.0-(1.0/TrendPeriod))
endif
dt = (cpc-trend)*(cpc-trend)
avgDt = 0
for k=0 to NoisePeriod-1 do
avgDt = avgDt+dt[k]
next
avgDt = avgDt/NoisePeriod
noise = CorrectionFactor*Sqrt(avgDt)
temp = 1
if((Abs(trend)+noise)<>0) then
temp = Abs(trend)+noise
endif
trendQ = 100.0*Abs(trend)/temp
endif
RETURN trendQSign coloured(255,105,180) style(line,2) as "trend sign", 0 coloured(168,168,168) style(dottedline) as "level 0", LevelWeakStart coloured(168,168,168) style(dottedline) as "weak level", LevelModerateStart coloured(168,168,168) style(dottedline) as "moderate level", LevelStrongStart coloured(168,168,168) style(dottedline) as "strong level", trendq coloured(0,191,255) style(line,2) as "trend quality"