Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Maximum bar index of CurrentBar?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Maximum bar index of CurrentBar?

    Hi,

    Is there a Maximum bar index of CurrentBar? I am about to code up an indicator which requires housekeeping of index values of Price and oscillator fractals, which I could do using relative indexing scheme, or with an absolute indexing scheme, which worries me for wrap-around effects, e.g. for the case that CurrentBar is a Int32 type.

    Best regards,
    Martin

    #2
    Hello,

    Thank you for the question.

    I am unsure of the question here, are you asking is there a limit to which the CurrentBar can reach?

    The CurrentBar is a Int32 so it would be subject to the Int32 max value of 2,147,483,647. There is no hard coded limit to the amount of bars otherwise if that is what you are asking.

    I am unsure if the PC would be capable of displaying this many bars in one chart, I suppose a custom bar type or something that is tick based it may be possible but highly doubtful.

    For more information regarding the Count of bars please see these documents:




    Please let me know if I may be of additional assistance.

    Comment


      #3
      Thanks for the answer.

      My concern is not indicator Chart Display, but backtesting a strategy using an indicator over a Long period of time, where there may occur a wrap-around of the Int32 number eventually, e.g. having a strategy that uses an indicator which uses CurrentBar for indexing purpose.

      Of course, I can avoid this by using relative indices which I can shift in the indicator on each new bar.

      Best regards,
      Martin

      Comment


        #4
        Hello,

        Thank you for getting back to me,

        I believe what you are asking is that after the int32 maximum number of bars was hit, would the index start over at 0 am I correct?

        If a maximum value was hit It would get either a index out of range error or a int32 too large error but not wrap around to 0 and continue.

        The data set would need to be extremely large to even approach the int32 limit of 2,147,483,647 bars.

        Please let me know if I may be of additional assistance.

        Comment


          #5
          Thanks for the information. This was exactly what I was looking for. So no problem in using CurrentBar index for back-reference then even for very large data sets in backtesting.

          Cheers,
          Martin

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Geovanny Suaza, 02-11-2026, 06:32 PM
          0 responses
          562 views
          0 likes
          Last Post Geovanny Suaza  
          Started by Geovanny Suaza, 02-11-2026, 05:51 PM
          0 responses
          325 views
          1 like
          Last Post Geovanny Suaza  
          Started by Mindset, 02-09-2026, 11:44 AM
          0 responses
          101 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Started by Geovanny Suaza, 02-02-2026, 12:30 PM
          0 responses
          547 views
          1 like
          Last Post Geovanny Suaza  
          Started by RFrosty, 01-28-2026, 06:49 PM
          0 responses
          547 views
          1 like
          Last Post RFrosty
          by RFrosty
           
          Working...
          X