Prevent the rectangle from being drawn continually, only at each new bar.

Forums ProRealTime English forum ProBuilder support Prevent the rectangle from being drawn continually, only at each new bar.

Viewing 3 posts - 16 through 18 (of 18 total)
  • #214781

    Yes, so that’s what I talked about. In history your calculation is made only once because the bars are already closed. While on the current bar, until its closure, your calculation is made on each tick and on each new tick you are increasing the column number (counter in your code?) and there creating X rectangles for the same bar and they are all painted until the bar is closed.

    I have trouble making the rectangles to be detected and plotted with your version, what is instrument and timeframe please?

    In order for your counter to increase only a new bar, change this function like this: (checking if timestamp of the bar is newer):

     

    #214782

    Thanks for your answer.

    I’m using the 1 Minute Timeframe for Testing.

     

    #215201

    By the way, I solved it last week.

    • The counter and drawonlastbaronly must be removed.

    As well as:

     

    1 user thanked author for this post.
Viewing 3 posts - 16 through 18 (of 18 total)

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