Thanks for the ansewer that looks great in general.
In my case, I tried, but my timeframe is in ticks in the indcator, it seems like I cannot combine it with a time view, like 1 hour.
I would like to get values at specific times, let’s say each 15 minutes on a 200 ticks chatr on dow
I used the folloing code to retrieve Close by hand, but I was wondering wheter
Q1/ There would be a better way to build the (closeTime0 to closeTime4) simulated array, like using a real array, I may need more values and I would like to use indicators on those. I can go from scratch, but it would be really tedious without arrays (no for, while, and so on)
Q2/ I see it works only with Time and CurrentTime is never updated (i.e: if I use “IF CTM >= FutTime AND CT<220000 Then” in the code below instead of “IF CT >= FutTime AND CT<220000 Then”), is this or documented somewhere or a defect ?
Sample code I made to debug the issue:
ONCE FutTime=40000
ONCE s=5*pipsize
CH=Hour
CM=Minute
CMC=CurrentMinute
CloseTime0=Close
CT=Time
CTC=CurrentTime
BI=barindex
Y=high
DRAWTEXT(“FutTime: #FutTime#” , BI, Y+14*s)
DRAWTEXT(“Time: #CT#” , BI, Y+12*s)
DRAWTEXT(“Current time: #CTC#” , BI, Y+11*s)
DRAWTEXT(“Minute: #CM#” , BI, Y+9*s)
DRAWTEXT(“Current minute: #CMC#” , BI, Y+8*s)
DRAWTEXT(“Close0: #closeTime0#” , BI, Y+6*s)
DRAWTEXT(“Close1: #closeTime1#” , BI, Y+5*s)
DRAWTEXT(“Close2: #closeTime2#” , BI, Y+4*s)
DRAWTEXT(“Close3: #closeTime3#” , BI, Y+3*s)
DRAWTEXT(“Close4: #closeTime4#” , BI, Y+2*s)
DRAWTEXT(“Nb hits: #CountMM5M15#” , BI, Y+1*s)
IF CT >= FutTime AND CT<220000 Then
closetime4=closeTime3
closeTime3=closeTime2
closeTime2=closeTime1
closeTime1=closeTime0
CountMM5M15=CountMM5M15+1
Y=close
s=-s
DRAWTEXT(“FutTime: #FutTime#” , BI, Y+14*s)
DRAWTEXT(“Time: #CT#” , BI, Y+12*s)
DRAWTEXT(“Current time: #CTC#” , BI, Y+11*s)
DRAWTEXT(“Minute: #CM#” , BI, Y+9*s)
DRAWTEXT(“Current minute: #CMC#” , BI, Y+8*s)
DRAWTEXT(“Close0: #closeTime0#” , BI, Y+6*s)
DRAWTEXT(“Close1: #closeTime1#” , BI, Y+5*s)
DRAWTEXT(“Close2: #closeTime2#” , BI, Y+4*s)
DRAWTEXT(“Close3: #closeTime3#” , BI, Y+3*s)
DRAWTEXT(“Close4: #closeTime4#” , BI, Y+2*s)
DRAWTEXT(“Nb hits: #CountMM5M15#” , BI, Y+1*s)
s=-s
IF CM < 45 then
FutTime=CH*10000+(ROUND(CM/15)+1)*1500
ELSE
FutTime=(CH+1)*10000
DRAWVLINE(barindex) coloured (0,0,128) // test to see whether the test works: should draw a vertical line each hour
IF FutTime > 210000 then
FutTime= 040000 // make sure we do not collect value between 21:00:00 and 4:00:00 (fixed timings depending on local TZ)
CountMM5M15=0
ENDIF
ENDIF
ENDIF
Return
Any suggestions or insights for Q1 and Q2 ?
Thanks for your help