how to calculate BollingerBandWidth ?

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #204961 quote
    ZeroCafeineZeroCafeine
    Participant
    Senior

    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

    #204964 quote
    robertogozzirobertogozzi
    Moderator
    Legend

    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"
    #204988 quote
    NicolasNicolas
    Keymaster
    Legend

    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
    ZeroCafeine thanked this post
    #205009 quote
    robertogozzirobertogozzi
    Moderator
    Legend

    I misunderstood the text. Sorry.

    ZeroCafeine thanked this post
    #205276 quote
    ZeroCafeineZeroCafeine
    Participant
    Senior

    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

Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.
ProRealAI ProRealAI New

Stuck on this ProBuilder code?

Describe what this topic is trying to build, in plain English, and ProRealAI writes the ProRealTime™ indicator, screener or system for you.

Available in 7 languages
Try ProRealAI

how to calculate BollingerBandWidth ?


ProScreener: Market Scanners & Detection

New Reply
Author
Summary

This topic contains 4 replies,
has 3 voices, and was last updated by ZeroCafeineZeroCafeine
3 years, 9 months ago.

Topic Details
Forum: ProScreener: Market Scanners & Detection
Language: English
Started: 11/28/2022
Status: Active
Attachments: No files
ProRealCode ProRealCode
Loading...