I am trying to find the bar_index
for each time, when I select the time interactively on a specific timeframe.
lets say in 1D
timeframe I select the today date via
i_date = input.time(timestamp("23 Aug 2023 00:00 +0300"), "Date", confirm=true)
Then I expect that the corresponding bar_index
be 0
for it.
In the same way, for the time of yesterday, I expect that bar_index
be 1
.
How can I do this?
I also looked into this question but it is not computing the bar index as I am looking for.