Backgroundcolor Bollinger

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #84207 quote
    eisi
    Participant
    Average

    Hello!

    Maybe somebody can help me. I’d like to have an indicator which sets the backgroundcolor to green when there is a close above the upper bollinger band and stays green until there is a close below the lower bollinger band. And when there is a close under the lower BB the backgroundcolor turns red until there is a close above the upper BB and so on.

     

    Thanks In advance

    #84220 quote
    robertogozzi
    Moderator
    Master

    There you go:

    ONCE Red        = 0
    ONCE Green      = 0
    ONCE Blue       = 0
    ONCE Fade       = 0
    ONCE BBVal      = 20                                   //20   BB periods
    ONCE BBdev      = 2.0                                  //2.0  BB Deviation
    BBavg           = Average[BBval,0](close)              //BB mean (middle line)   0=sma
    BollUP          = BBavg + ((std[BBval](close)) * BBdev)//Bollinger Upper Band
    BollDN          = BBavg - ((std[BBval](close)) * BBdev)//Bollinger Lower Band
    IF close >= BollUP THEN
       Red   = 0
       Green = 255
       Blue  = 0
       Fade  = 32
    ELSIF close <= BollDN THEN
       Red   = 255
       Green = 0
       Blue  = 0
       Fade  = 32
    ENDIF
    BackgroundColor(Red,Green,Blue,Fade)
    RETURN
    Nicolas thanked this post
    #84229 quote
    eisi
    Participant
    Average

    Thank you so much Roberto!

    #84237 quote
    swapping
    Participant
    Master

    Simple but efficient, thank Roberto 🙂

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

Backgroundcolor Bollinger


ProBuilder: Indicators & Custom Tools

New Reply
Author
author-avatar
eisi @eisi Participant
Summary

This topic contains 3 replies,
has 3 voices, and was last updated by swapping
7 years, 3 months ago.

Topic Details
Forum: ProBuilder: Indicators & Custom Tools
Language: English
Started: 11/05/2018
Status: Active
Attachments: 1 files
Logo Logo
Loading...