Hello,
can the DateToBarindex instruction work in a code but not only with a graphical purpose?
Let’s say, if I define:
mySessionStartBarIndex=DateToBarindex(YYYYMMDDHHMMSS)
with YYYYMMDDHHMMSS matching the date and hour of a market opening time, then would this return a corresponding index?
As it seems not then what would be the solution to get a workeable index ?
Thanks
Yes, it cannot assign values to variables, only the other way round is possible:
x = 20240827140000
drawvline(DateToBarIndex(x)) //fine
y = DateToBarIndex(x) //Not supported
return