Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

BarsRequest

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

    BarsRequest

    Hello,

    I am looking to implement BarsRequest in an indicator, so load data from a certain point, for an indicator that does not load a data series. So, I can say, load the data from the last hour, etc. I looked at the code example in the docs, and I can see how I might do this, and how I would process the data. The big question I had, was how would I sync this with the bars of the primary data series on the chart? For example. Main chart is 100 tick, but I request 1 hour of tick data. Is it possible to tell what bunch of ticks from the BarsRequest are in what bar number of the chart data series?

    Thanks.

    #2
    Hello pjsmith,

    Below is a link to an example script that does a BarsRequest in an addon (and prints to the output window).
    https://ninjatrader.com/support/foru...518#post742518

    As well as a link to the help guide on BarsRequest which includes example code.
    https://ninjatrader.com/support/help...arsrequest.htm

    The BarsRequest will not be associated or synchronized with any series or other data.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Hi,

      Thanks for the example Chelsea. I'd actually seen this, but it does not answer my question I think.

      If I call this in an indicator that already has a primary data series on the chart, how can I find out what bar number of the chart primary data series the current bar of the secondary dynamically loaded data series belongs to? Does that make sense? For example - I have a 1 minute bar series on the chart. I load 15 minutes tick data - I want to mark the bar on the chart where I detect an interesting event in that 15 minutes of tick data. How to I say, OK, I'd on bar 23,567 of the tick set. That happens to be in Bar 5 of the minute set? I hope you get what I am trying to achieve. Thanks.

      Comment


        #4
        Hello pjsmith,

        BarsRequests will not be synchronized.

        You can try using Bars.GetBar() to find a bar in the series by time.
        https://ninjatrader.com/support/help...-us/getbar.htm

        If you need synchronized data, then use AddDataSeries().
        Chelsea B.NinjaTrader Customer Service

        Comment


          #5
          Thanks. Adddataseries is what I need to avoid. I will try to fudge something with bars.getbar. I think I can make that work.

          Comment

          Latest Posts

          Collapse

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