good morning, in an indicator that runs in a monthly Timeframe, is possible to know the date on which the Max and Min of that month occurred?
The below code finds and plots in the middle of the chart the monthly high low dates:
defparam drawonlastbaronly=true
timeframe(monthly)
if openmonth<>openmonth[1] then
hh=high
ll=low
endif
hh=max(hh,high)
ll=min(ll,low)
timeframe(default)
if hh<>hh[1] then
hhdate=(date/10000)
endif
if ll<>ll[1] then
lldate=(date/10000)
endif
drawtext("Monthly high date: #hhdate#",0,0)anchor(middle,xshift,yshift)
drawtext("Monthly low date: #lldate#",0,-30)anchor(middle,xshift,yshift)
return hh,ll
Thank Nicholas, but your code is not exactly what i need.
Think you are in a monthly graph and you asked to print over the candlestick the date and the price of the max and of the min: how you can detect the two date?
No you can’t do that on a monthly timeframe, we have to zoom in an inferior timeframe like I did in the posted code.