Hello,
Is there a way to retrieve the barindex value of the last bars loaded .
I need it in order to draw a segment from 000000 to actual time .
Giovanni
This is something I need too.
But, while loading the history for the first time, the last current bar is always “BARINDEX”, but we have no possibility to know if this barindex is currently the real actual LIVE one (current time I mean.. hope it makes sense?).
Thanks Nicolas,
I did it this way and it works except that the segment is not automatically refreshed on a new bar.
// defparam drawonlastbaronly = true
REM Current time add 1 hour due to timezone difference
REM x1= barindex at time 000000
if time=CurrentTime+010000 and date=today then
lastbarindex=barindex
vDopen=Dopen(0)
DRAWSEGMENT(x1,vDopen,lastbarindex,vDopen) coloured(0,0,255,255)
endif
Well done, your code is clever.
What is the purpose of “+010000”?
Did you try with this condition instead?
time>=CurrentTime+010000
Fantastic Nicolas!
I tried your code and now the segment is refreshed!
I am adding +010000 because ProrealTime is installed on IG UK while my computer is in Germany (I work in Remote Deesktop) and there is one hour difference.
Thank you very much!!!!!!!