how to calculate BollingerBandWidth ?
- This topic has 4 replies, 3 voices, and was last updated 2 years ago by .
Viewing 5 posts - 1 through 5 (of 5 total)
Viewing 5 posts - 1 through 5 (of 5 total)
Forums › ProRealTime English forum › ProScreener support › how to calculate BollingerBandWidth ?
Tagged: Bollinger, bollinger bandwidth
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 ?
1 2 3 4 5 6 7 8 |
A = BollingerBandWidth[20](Close) BBUp = BollingerUp[20] BBDown = BollingerDown[20] D = BBUp - BBDown Return A, D |
Best Reguards
There you go:
1 2 3 4 5 6 7 8 9 10 |
// // 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
1 2 3 4 |
a = BollingerBandWidth[20](close) b = (BollingerUp[20](close)-BollingerDown[20](close))/average[20] return a , b |
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