Hello,
I would like to add the average daily range histogram to the intraday chart.
The original code for DAILY TF is the following:
How can I see the same info in the Intra chart? thanks a lot for your support
HI = High
LO = Low
rng = (HI - LO)
avgrng = average[10](rng)
wide = avgrng* 1.25
narrow = avgrng* 0.65
wideavg = avgrng * 1.25
narrowavg = avgrng * 0.65
if rng >= wide then
r = 0
g = 0
b = 255
else
if rng <= narrow then
r = 77
g = 12
b = 82
else
r = 85
g = 86
b = 86
endif
endif
RETURN rng coloured(r,g,b) STYLE(histogram,1) as "RNG", avgrng coloured(255,255,255) STYLE(dottedline,1) as "AVG RNG", wideavg coloured(255,0,0) STYLE(dottedline,1) as "AVG WIDE", narrowavg coloured(84,185,209) STYLE(dottedline,1) as "AVG WIDE"
Hi, replacing first 2 lines by these should do it:
HI = dhigh(0)
LO = dlow(0)
Hi JC,
thanks for your reply.
Unfortunately the indicator returns nothing if I substitute those two lines as you suggest, independently from the TF used.
Sorry, was too fast not seeing how it was used for averages further down and not just range of one day, so need timeframe keyword.
With this I get example attached for Dax TF 5mn bottom window assuming you wish to keep same return last line:
timeframe (daily)
HI = dhigh(0)//High
LO = dlow(0)//Low
rng = (HI - LO)
avgrng = average[10](rng)
wide = avgrng* 1.25
narrow = avgrng* 0.65
wideavg = avgrng * 1.25
narrowavg = avgrng * 0.65
if rng >= wide then
r = 0
g = 0
b = 255
else
if rng <= narrow then
r = 77
g = 12
b = 82
else
r = 85
g = 86
b = 86
endif
endif
timeframe(default)
RETURN rng coloured(r,g,b) STYLE(histogram,1) as "RNG", avgrng coloured(255,255,255) STYLE(dottedline,1) as "AVG RNG", wideavg coloured(255,0,0) STYLE(dottedline,1) as "AVG WIDE", narrowavg coloured(84,185,209) STYLE(dottedline,1) as "AVG WIDE"
Thanks a lot JC, now it works 😉