Indicator value on chart

Viewing 6 posts - 16 through 21 (of 21 total)
  • Author
    Posts
  • #168963 quote
    robertogozzirobertogozzi
    Moderator
    Legend

    You can access CLOSED candles. When you see a new price on the chart it’s because it’s CLOSE, which may change until the candle is closed, but you cannot access the previous value retained on the same forming candle.

    Each candle is a single unit, be it 1 Day, 1 hour or 1 second. You cannot access its multiple values whenever you see it changing on the chart.

    The solution is to use MTF (Multi Time Frame) support that allows to use several TF’s.

    You could use, say 1h TF as your setup TF, then use a lower TF to access the 1h candle while it’s being built:

    Timeframe(1h,UpdateOnClose)
    CloseA = close
    Timeframe(default)
    CloseB = close
    Return CloseA AS "Closed",CloseB AS "Forming Now",CloseB[1] AS "Forming Now previous"
    
    Zigo thanked this post
    #168993 quote
    IG_CFD_TraderIG_CFD_Trader
    Participant
    Average

    Hi Zigo,

    What if the next value on your chart is -137 (i.e. CCI increased 1 up but is still <0). How do I colour the number in green to indicate that it increased up?

    #168995 quote
    IG_CFD_TraderIG_CFD_Trader
    Participant
    Average

    Tnx Zigo,

    But what if the next value on your chart is -137 (i.e. CCI increased 1 up but is still <0). How do I colour the number in green to indicate that it increased up?

    #169020 quote
    ZigoZigo
    Participant
    Master

    Change line 4 and line 8

    4 if mycci mycci[1] then

    #169023 quote
    ZigoZigo
    Participant
    Master

    “Aanpassing”

    //Zigo 6/05/2021
    Defparam DRAWONLASTBARONLY =true
    
    Timeframe(1h,UpdateOnClose)
    CloseA = mycci
    Timeframe(default)
    CloseB = mycci
    
    mycci=round(CCI[14](typicalPrice))
    if mycci <mycci[1] then
    r=255
    g=0
    bl=0
    elsif mycci > mycci[1] then
    r=0
    g=255
    bl=0
    endif
    DRAWTEXT(” #mycci#”, barindex, mycci, dialog,standard, 25)coloured(r,g,bl,255)
    
    Return mycci
    DAX-30-secondenMycci.png DAX-30-secondenMycci.png
    #169025 quote
    robertogozzirobertogozzi
    Moderator
    Legend

    @Zigo

    Always use the ‘Insert PRT Code’ button when putting code in your posts to make it easier for others to read.

    Thank you 🙂

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

Indicator value on chart


ProBuilder: Indicators & Custom Tools

New Reply
Author
author-avatar
IG_CFD_Trader @wnakhoul Participant
Summary

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

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