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
There you go:
MyATR = AverageTrueRange[14](close)
DrawText("#MyATR#",BarIndex,high * 1.005)
You have to embed the variable name within hashes.
Dear Robert
An incredibly big thank you. =)
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,
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.
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.
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).
Very nice worked perfect.
Big thank you.