Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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.
    JesseNinjaTrader Customer Service

    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.
        JesseNinjaTrader Customer Service

        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 adeelshahzad, Today, 03:54 AM
          5 responses
          32 views
          0 likes
          Last Post NinjaTrader_BrandonH  
          Started by stafe, 04-15-2024, 08:34 PM
          7 responses
          32 views
          0 likes
          Last Post NinjaTrader_ChelseaB  
          Started by merzo, 06-25-2023, 02:19 AM
          10 responses
          823 views
          1 like
          Last Post NinjaTrader_ChristopherJ  
          Started by frankthearm, Today, 09:08 AM
          5 responses
          21 views
          0 likes
          Last Post NinjaTrader_Clayton  
          Started by jeronymite, 04-12-2024, 04:26 PM
          3 responses
          43 views
          0 likes
          Last Post jeronymite  
          Working...
          X