Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Programatic data backfill?

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

    Programatic data backfill?

    Is there some way to force NinjaTrader to backfill a bar series with historical data?

    What I would like to do is to have a strategy which loads a list of symbols from a file and Add()'s them. In the strategy, I would like to be able to reference the past 20 5min bars (and eventually the past 20 daily bars) without waiting for the 100 minutes for these bars to fill with incoming tick data. As soon as I call Add(), I'd like to get NinjaTrader to request the past bars if the database doesn't already have them.

    Is this possible? How do I do it?

    #2
    Unfortunately this is beyond what we can support. NinjaTrader will generally go out and get data automatically if it does not find it in the database.
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      What does "generally" mean? When does it go out and get data and when doesn't it? Kind of tricky developing strategies if you don't know how they'll behave

      Comment


        #4
        In NinjaTrader 6.5, bring up the Help Guide and search for "When does NinjaTrader Load Historical Data".
        Josh P.NinjaTrader Customer Service

        Comment


          #5
          Originally posted by Josh View Post
          In NinjaTrader 6.5, bring up the Help Guide and search for "When does NinjaTrader Load Historical Data".
          It looks like that refers to the "Format Data Series" which is used when you manually change an instrument on a chart. What happens for strategies?

          Comment


            #6
            It is the same for strategies. If you load a strategy onto a chart then the Format Data Series of the chart is relevant for your case. If you load a strategy via the Strategies tab in the Control Center I believe it is seen as the same as in Case 1. ("Format Data Series" contains the current day).
            Josh P.NinjaTrader Customer Service

            Comment


              #7
              Josh,

              In the main NT window, when you go to add a Strategy, there is no "Format Data Series" option. There is a "Data Series" section, but it just lists the Instrument, Type and Value. Similarly, when you run a backtest, you specify the begin and end time, but based on how the indicators look and when the first tick comes in, it doesn't gather any extra data but instead starts the backtest on the N'th bar (where N is the 'Min bars required' option).

              So if you need 20 bars and you're using the 5min bar, it looks like you need to wait 20*5=100 minutes into the trading day before getting your first OnBar event.

              I've only been working with the backtester so far so I can't say for sure if this happens in other cases and am just trying to understand the framework so I know what to expect and work around it.

              Comment


                #8
                In the main window it will load the data necessary. (the 20 bars required will be loaded as you start the strategy).
                Josh P.NinjaTrader Customer Service

                Comment


                  #9
                  Originally posted by Josh View Post
                  In the main window it will load the data necessary. (the 20 bars required will be loaded as you start the strategy).
                  Brill.

                  Does NT also fetch 20 bars when I call 'Add(PeriodType.Daily, 1)' in Initialize()?

                  Comment


                    #10
                    Yes it should.
                    Josh P.NinjaTrader Customer Service

                    Comment


                      #11
                      Adrian, FYI: http://www.ninjatrader-support.com/v...ead.php?t=4388

                      Comment

                      Latest Posts

                      Collapse

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