Hello,
I would like to extract the opening of the very first traded bar (including pre). I have tried with a code, but it seems it's giving me in milliseconds. I want to convert it to something like 11:05. I would like to be able to extract the time and assign it to a variable "t" as it is. In this example "t" should be assigned to "1105". I do not know how to include daylight savings with it. Please help.
Thank you
I would like to extract the opening of the very first traded bar (including pre). I have tried with a code, but it seems it's giving me in milliseconds. I want to convert it to something like 11:05. I would like to be able to extract the time and assign it to a variable "t" as it is. In this example "t" should be assigned to "1105". I do not know how to include daylight savings with it. Please help.
Thank you
Code:
def firstBarNumber = if GetDay() <> GetDay()[1] then BarNumber() else firstBarNumber[1];
def time = if BarNumber() == firstBarNumber then gettime() else time[1];