Difference between BB and price

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #123571 quote
    segiesegie
    Participant
    Senior

    Hi,

    I’m looking for an indicator that displays the pips/points difference  between upper or lower Bollinger Bands and Price.

     

    Regards,

    Segie

    #123585 quote
    VonasiVonasi
    Moderator
    Master

    Something like this?

    p = 20
    
    upper = BollingerUp[p](close) - close
    lower = close - BollingerDown[p](close)
    
    return upper as "Upper Difference" coloured(0,128,0), lower as "Lower Difference" coloured(128,0,0)
    segie thanked this post
    #123594 quote
    segiesegie
    Participant
    Senior

    Receiving this error (attached)

    BB_diff.jpg BB_diff.jpg
    #123598 quote
    NicolasNicolas
    Keymaster
    Legend

    Coloured must be placed right after the variable name, the syntax should be:

    p = 20
    
    upper = BollingerUp[p](close) - close
    lower = close - BollingerDown[p](close)
    
    return upper coloured(0,128,0) as "Upper Difference" , lower coloured(128,0,0) as "Lower Difference"
    segie thanked this post
    #123607 quote
    VonasiVonasi
    Moderator
    Master

    Thanks Nicolas. Thrown together before I’d had a coffee and not tested!

    #123610 quote
    segiesegie
    Participant
    Senior

    thank you

Viewing 6 posts - 1 through 6 (of 6 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

Difference between BB and price


ProBuilder: Indicators & Custom Tools

New Reply
Author
author-avatar
segie @segie Participant
Summary

This topic contains 5 replies,
has 3 voices, and was last updated by segiesegie
6 years, 6 months ago.

Topic Details
Forum: ProBuilder: Indicators & Custom Tools
Language: English
Started: 03/27/2020
Status: Active
Attachments: 1 files
ProRealCode ProRealCode
Loading...