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 Mindset, 04-21-2026, 06:46 AM
          0 responses
          57 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Started by M4ndoo, 04-20-2026, 05:21 PM
          0 responses
          78 views
          0 likes
          Last Post M4ndoo
          by M4ndoo
           
          Started by M4ndoo, 04-19-2026, 05:54 PM
          0 responses
          39 views
          0 likes
          Last Post M4ndoo
          by M4ndoo
           
          Started by cmoran13, 04-16-2026, 01:02 PM
          0 responses
          101 views
          0 likes
          Last Post cmoran13  
          Started by PaulMohn, 04-10-2026, 11:11 AM
          0 responses
          61 views
          0 likes
          Last Post PaulMohn  
          Working...
          X