Dashboard return current value

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #165606 quote
    Jocke
    Participant
    Average

    Dear Probuilder support

    I am building a dashboard/indicator following your tips and instructions found on the forum.

    This link is very helpful for the drawtext function of an indicator (https://www.prorealcode.com/blog/learning/simple-indicators-dashboard/)

    But I cant find out how to return the current value of a indicator.

    I am trying to get the current ATR value/number displayed in realtime or the bollinger band width for example.

    Best regards

    #165610 quote
    robertogozzi
    Moderator
    Master

    There you go:

    MyATR = AverageTrueRange[14](close)
    DrawText("#MyATR#",BarIndex,high * 1.005)

    You have to embed the variable name within hashes.

    Jocke thanked this post
    #165783 quote
    Jocke
    Participant
    Average

    Dear Robert

    An incredibly big thank you. =)

    robertogozzi thanked this post
    #172020 quote
    IG_CFD_Trader
    Participant
    Average

    Hi Roberto,

    is there a way to return (via drawtext) the value of an indicator at every 1 minute interval in a 15 minute time frame. For example using drawonlastbaronly=true this would result in printing value of indicator every 1 minute for total of 15 results on every bar.

    if possible, I would appreciate your help on how to achieve this.

    Regards,

    #172021 quote
    robertogozzi
    Moderator
    Master

    No, it’s not possible.

    Multi Time Frame support allows to plot higher TF’s indicators and values in a smaller TF, not the other way round.

    It’s because the lowest TF used is the one that sets the pace (timing) and it must be the one of your chart.

    #184089 quote
    Jocke
    Participant
    Average

    Dear Roberto

    A short follow up/ addition to the returned values.

    I try to code them in different colours like if ATR is above value of 20 it is displayed in green text and below 20 in red for example.

    What is wrong with the code below?

    //—ATR
    myATR = AverageTrueRange[14](close)
    DRAWTEXT(“ATR:”,barindex-Xoffset,65,SansSerif,Bold,16)coloured(230,230,250)
    if myATR>20 then
    DRAWTEXT(“#MyATR#”,barindex–25,65,SansSerif,Bold,16)coloured(0,153,0)
    elsif myATR<20 then
    DRAWTEXT(“#MyATR#”,barindex–25,65,SansSerif,Bold,16)coloured(153,0,0)
    endif

    Thank you and best regards.

    #184129 quote
    robertogozzi
    Moderator
    Master

    There you go:

    //—ATR
    DEFPARAM DrawOnLastBarOnly = TRUE
    Xoffset  = 10
    myATR    = AverageTrueRange[14](close)
    Distance = myATR * 0.3
    if myATR>90 then
       DRAWTEXT("ATR:",barindex-Xoffset,myATR+Distance,SansSerif,Bold,16) coloured(230,230,250)
       DRAWTEXT("#myATR#",barindex,myATR+Distance,SansSerif,Bold,16) coloured(0,153,0)
    elsif myATR<=90 then
       DRAWTEXT("ATR:",barindex-Xoffset,myATR-Distance,SansSerif,Bold,16) coloured(230,230,250)
       DRAWTEXT("#myATR#",barindex,myATR-Distance,SansSerif,Bold,16) coloured(153,0,0)
    endif
    return myATR AS "ATR"

    The value 90 (or anything else( must be set according to the time frame (the higher the TF, the higher the value).

    Jocke thanked this post
    #186348 quote
    Jocke
    Participant
    Average

    Very nice worked perfect.

    Big thank you.

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

Dashboard return current value


ProBuilder: Indicators & Custom Tools

New Reply
Author
author-avatar
Jocke @jocke Participant
Summary

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

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