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.
To help us continually offer you the best experience on ProRealCode, we use cookies. By clicking on "Continue" you are agreeing to our use of them. You can also check our "privacy policy" page for more information.Continue