Color between bande de bollinger

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #237127 quote
    PRC_2021PRC_2021
    Participant
    Average

    Bonjour,

    Je souhaiterai avoir l’intérieur des bandes de bollinger qui se colorient suivant une condition.

    J’arrive à mettre de la colleur mais dès lors qu’une  condition existe cela ne fonctionne pas et cela me colorient tout.

    BB    = 20                               //20   periods
    BBdev  = 2                               //2.0  standard deviation
    BBavg  = average[BB,0](close)               //BB mean (middle line)
    BBsup = BBavg + ((std[BB](close)) * BBdev) //BB Upper Band
    BBinf = BBavg - ((std[BB](close)) * BBdev) //BB Lower Band
    
    BBbis    = 20                               //20   periods
    BBdevbis  = 2.5                               //2.0  standard deviation
    BBavgbis  = average[BBbis,0](close)               //BB mean (middle line)
    BBsupbis = BBavgbis + ((std[BBbis](close)) * BBdevbis) //BB Upper Band
    BBinfbis = BBavgbis - ((std[BBbis](close)) * BBdevbis) //BB Lower PRTBandsUp
    
    sma20 = Average[20](close) 
    sma50 = Average[50](close)
    
    cond = (sma20> sma50)
    
    if cond then
    COLORBETWEEN(BBsup,BBsupbis,160,160,160,100)
    COLORBETWEEN(BBinf,BBinfbis,160,160,160,100)
    //BACKGROUNDCOLOR(160,160,160,100)
    endif
    
    return

     

    Merci de votre aide.

    #237227 quote
    PRC_2021PRC_2021
    Participant
    Average

    Personne n’as d’idée ?

    #237228 quote
    fifi743fifi743
    Participant
    Master

    tu peux jouer avec la zone de couleur voir screen

    Capture-decran-2024-09-06-162524.png Capture-decran-2024-09-06-162524.png
    #237256 quote
    drubydruby
    Participant
    New

     

    BB    = 20                               //20   periods
    BBdev  = 2                               //2.0  standard deviation
    BBavg  = average[BB,0](close)               //BB mean (middle line)
    BBsup = BBavg + ((std[BB](close)) * BBdev) //BB Upper Band
    BBinf = BBavg - ((std[BB](close)) * BBdev) //BB Lower Band
    
    BBbis    = 20                               //20   periods
    BBdevbis  = 2.5                               //2.0  standard deviation
    BBavgbis  = average[BBbis,0](close)               //BB mean (middle line)
    BBsupbis = BBavgbis + ((std[BBbis](close)) * BBdevbis) //BB Upper Band
    BBinfbis = BBavgbis - ((std[BBbis](close)) * BBdevbis) //BB Lower PRTBandsUp
    
    sma20 = Average[20](close)
    sma50 = Average[50](close)
    
    cond = (sma20> sma50)
    
    if cond then
    r = 160
    g = 160
    b = 160
    a = 100
    else
    a = 0
    endif
    
    COLORBETWEEN(BBsup,BBsupbis,r,g,b,a)
    COLORBETWEEN(BBinf,BBinfbis,r,g,b,a)
    
    return
    PRC_2021 thanked this post
    Screenshot-2024-09-06-193706.png Screenshot-2024-09-06-193706.png
    #237322 quote
    PRC_2021PRC_2021
    Participant
    Average

    Cela fonctionne avec la 2ieme solution. Merci beaucoup

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

Color between bande de bollinger


ProBuilder : Indicateurs & Outils Personnalisés

New Reply
Author
author-avatar
PRC_2021 @manu35250 Participant
Summary

This topic contains 4 replies,
has 3 voices, and was last updated by PRC_2021PRC_2021
2 years ago.

Topic Details
Forum: ProBuilder : Indicateurs & Outils Personnalisés
Language: French
Started: 09/05/2024
Status: Active
Attachments: 2 files
ProRealCode ProRealCode
Loading...