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:

    http://www.ninjatrader.com/support/h...tml?count2.htm
    http://www.ninjatrader.com/support/h...currentbar.htm

    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 stafe, Today, 12:34 PM
          2 responses
          20 views
          0 likes
          Last Post stafe
          by stafe
           
          Started by asmmbillah, Today, 11:18 AM
          1 response
          18 views
          0 likes
          Last Post NinjaTrader_ChrisL  
          Started by nickse2003, Today, 09:56 AM
          1 response
          27 views
          0 likes
          Last Post NinjaTrader_ChristopherJ  
          Started by ATMtrader0001, Today, 10:08 AM
          5 responses
          38 views
          0 likes
          Last Post ATMtrader0001  
          Started by WHICKED, Today, 09:47 AM
          1 response
          26 views
          0 likes
          Last Post NinjaTrader_Spencer  
          Working...
          X