Hi everyone,
someone can tell me how this variable “BollingerBandWidth” is calculated please, because I don’t find the same result with a manual calculation, maybe it’s not the same standard deviations or something is missing, I get A different of D ?
A = BollingerBandWidth[20](Close)
BBUp = BollingerUp[20]
BBDown = BollingerDown[20]
D = BBUp - BBDown
Return A, D
Best Reguards
There you go:
//
// Bollinger BB%
//
DEFPARAM CalculateOnLastBars = 1000
p = 20
dev = 2.0
BollInf = Average[p,0](close) - (dev * std[p](close))
BollSup = Average[p,0](close) + (dev * std[p](close))
pB = ((close - BollInf) / (BollSup - BollInf)) * 100
return pB AS "Boll BB %",80 AS "Ob",20 AS "Os"
Bollinger B% is not the same as Bollinger BandWidth, as per our documentation: https://www.prorealcode.com/documentation/bollingerbandwidth/
Calculation :
Indicator = ((Boll+) – (Boll-)) / moving average
a = BollingerBandWidth[20](close)
b = (BollingerUp[20](close)-BollingerDown[20](close))/average[20]
return a , b
I misunderstood the text. Sorry.
tks you all,
so when I red the fonction’s name of : “BollingerBandWidth” I understood it’s the difference betwen the 2 bollinger band like : BB Up – BB Down, but this is not the case,
tks again,
Best Reguards