I am seeking help with code to calculate the number of bars from a specific date and time. For example, on an hourly chart, I would like to calculate the number of bars since 10am on 23 May 2024.
I had success with druby’s solution, although I had to adjust the result by adding 24 (working on an hourly chart)…so I’m wondering if it’s counting barssince the next opentime after the end of the opendate? It’s an easy adjustment for me to make, I was just interested to understand the logic.
We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.