Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Initial number of bars on chart prior to loading

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

    Initial number of bars on chart prior to loading

    Hi,

    Is there any way within Ninja Script to find out how may bars will be loaded initially on a chart prior to the chart being loaded?

    Thanks,
    gbard

    #2
    Hello gbrad,

    As long as TickReplay is not being used you could use the Count property on any series to know how many points it has. https://ninjatrader.com/support/help...ries_count.htm

    Code:
    Print(Count);
    If you are going to use that for any index purposes then you would need to subtract depending on the Calculate setting, with OnBarClose you would be looking at Count - 2 to get the last bar, OnEachTick would be Count - 1.

    I look forward to being of further assistance.

    Comment


      #3
      Can't Count be examined during State.DataLoaded?

      Comment


        #4
        Hi Jesse,

        bltdavid gets to my point. I would like to know how many bars would initially get loaded prior to hitting bar 0 in OnBarUpdate. Is that possible?

        Note, I don't really need the exact number, just something near that number.

        In my case, I'm not using TickReplay, but that's good to know.

        Thanks,
        gbrad

        Comment


          #5
          Hello gbrad,

          What you are asking is what I provided in post 2, please try printing the Count property. You can do that on bar 0 or if you wanted in State.DataLoaded.

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

          Comment


            #6
            Hi Jesse,

            Yes, that's what I needed. I tested it and it works fine.

            Thank you very much.

            gbrad

            Comment


              #7
              Originally posted by NinjaTrader_Jesse View Post
              As long as TickReplay is not being used you could use the Count property on any series to know how many points it has. [url]https://ninjatrader.com/support/helpGuides
              Hi Jesse.

              So, uh, what does TickReplay have to do with many 'points' in a Series?

              I mean, that sounds counterintuitive -- if you want to know how many historical
              bars exist in the primary data series on the chart, how does that number change
              when TickReplay is used?

              The link you provided does not mention a relationship between Count and TickReplay.

              Comment


                #8
                Hello bltdavid,

                When TickReplay is enabled the bars are being built from tickreplay data so the count is not known ahead of time when used from OnBarUpdate.

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                0 responses
                560 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