How to display candles (or bars) in an indicator instead of close only?

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #183837 quote
    Lighthouse
    Participant
    Master

    I’d like to draw “full” candles (or bars) in this indicator

    Real Motion Indicator

    I mean that I’d like to see not only the data related to the Close (as a line), but also Open High Low … al shown as bars… daily bars

    Is it possible?

    #183838 quote
    JC_Bywan
    Moderator
    Master

    Hello, you can try this, additions to the code are lines 34 to 37:

    // Real Motion indicator (a Market Gauge indicator)
    //ported to Prorealtime by ciccio
    //
    //Default Values:
    PrimaryAverage=200
    RealMotionAverageSlow=200
    RealMotionAverageFast=50
    NumDevsUp=2
    NumDevsDn=2
    //
    //BaseLine represents 200 days SMA of price closes
    BaseLine=0
    
    //RealMotion indicator as explained by Market Gauge
    //"The brown dots are a dot plot of the individual values of the RealMotion variable.
    //Essentially, they divide the equity price by the moving average of that price (here 200 period).
    //We then subtract one and multiply that value by 100.
    //This centers the indicator at zero (when price = moving average then RealMotion will equal zero).
    //Furthermore, by multiplying by 100 we make it so that when RealMotion = 5.0
    //we can say that the price is 5% greater than the reference moving average."
    PrimaryAveragePlot=Average[PrimaryAverage](close)
    RealMotion=(close/PrimaryAveragePlot - 1)*100
    
    
    SlowRealMotion=Average[RealMotionAverageSlow](RealMotion)
    FastRealMotion=Average[RealMotionAverageFast](RealMotion)
    
    //Bollinger Bands
    fUpperBand = FastRealMotion + ((STD[RealMotionAverageFast](RealMotion)) * NumDevsUp)
    fLowerBand = FastRealMotion - ((STD[RealMotionAverageFast](RealMotion)) * NumDevsDn)
    
    //Plotting
    
    RealMotionO=(open/PrimaryAveragePlot - 1)*100//added to original code to make candles
    RealMotionH=(high/PrimaryAveragePlot - 1)*100//added to original code to make candles
    RealMotionL=(low/PrimaryAveragePlot - 1)*100//added to original code to make candles
    DRAWCANDLE(RealMotionO, RealMotionH, RealMotionL, RealMotion)//added to original code to make candles
    
    Return RealMotion COLOURED(150,75,0) AS "Real Motion", SlowRealMotion COLOURED(255,0,102) AS "SlowRealMotion", FastRealMotion COLOURED(0,0,255) AS "FastRealMotion", fLowerBand COLOURED(0,0,0) AS "fLowerBand", fUpperBand COLOURED(0,0,0) AS "fUpperBand", BaseLine COLOURED(0,0,0) AS "BaseLine"
    
    Lighthouse thanked this post
    #183840 quote
    Lighthouse
    Participant
    Master

    Thanks

    I was missing that “DRAWCANDLE” function (or DRAWBARCHART in case)

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

How to display candles (or bars) in an indicator instead of close only?


ProBuilder: Indicators & Custom Tools

New Reply
Author
author-avatar
Lighthouse @ciccio Participant
Summary

This topic contains 2 replies,
has 2 voices, and was last updated by Lighthouse
4 years, 1 month ago.

Topic Details
Forum: ProBuilder: Indicators & Custom Tools
Language: English
Started: 12/25/2021
Status: Active
Attachments: No files
Logo Logo
Loading...