Calculate no. of bars from a specific date and time

Forums ProRealTime English forum ProOrder support Calculate no. of bars from a specific date and time

Viewing 4 posts - 1 through 4 (of 4 total)
  • #236666

    Hi,

    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.

    Thanks,

    Madokin

    #236667
    JS

    Hi,

    Try this one:

     

    2 users thanked author for this post.
    #236668

    Hi,

    or this:

     

    2 users thanked author for this post.
    #236696

    Thank you druby and JS for your help.

    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.

Viewing 4 posts - 1 through 4 (of 4 total)

Create your free account now and post your request to benefit from the help of the community
Register or Login