Backgroundcolor Bollinger

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #84207 quote
    eisieisi
    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
    robertogozzirobertogozzi
    Moderator
    Legend

    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
    x.jpg x.jpg
    #84229 quote
    eisieisi
    Participant
    Average

    Thank you so much Roberto!

    #84237 quote
    swappingswapping
    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.
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

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 swappingswapping
7 years, 10 months ago.

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