Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Days to load?

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

    Days to load?

    For live automated trading when do I use "days to load" vs "min bars required" vs. "max bars lookback"?

    In my case, my strategy uses tick data in BarsArray[0] and day data in BarsArray[1]. I need 30 days of historical data for my functions. Typically, this has meant that I've need to run 30 + 20 buffer = 50 min bars required. Given this info, to run live, do I set days to load =50 and min bars required =50?

    Also, I'm getting an OnBarUpdate expection when I try to run live. However, I'm not getting any exceptions when I run in backtest mode. I haven't been able to find the exception so I'm wondering if it has something to do with the strategy automation parameters.

    #2
    bluelou, what OnBarUpdate() error would you exactly get in your log tab as you attempt running the strategy?

    DaysToLoad sets how many historical data will be loaded up, same as when you create a chart directly.

    MinBarsRequired will determine how many bars the OnBarUpdate() of your strategy is not called at the start of your data to give indicators used time to 'catch up' properly before strategy logic would trigger based on them.

    MaxBarsLookback determines how many bars your custom DataSeries objects could be programmatically accessed back in your code, 6.5 used the Inifite setting, 7 offers 256 as a new default as this should be enough for most request and optimizes memory usage significantly.
    BertrandNinjaTrader Customer Service

    Comment


      #3
      The OnBarUpdate error I'm getting is "You are accessing an index with a value that is invalid since its out of range. This error only occurs when I try to trade live and it does not occur when I'm running a backtest. What steps do you suggest? Will I only be able to debug when the markets are open since this is when the error occurs?

      Regarding DaysToLoad:
      So, if my strategy requires 30 days for the indicators to "catch up" do I want both DaysToLoad = 30 AND MinBarsRequired = 30? What happens if I don't select any DaysToLoad?

      Comment


        #4
        It may be the case that you would only be able to test in real-time. What you can try using is the Market Replay to see if you can reproduce off of that. Otherwise it would have to be live testing.

        You will definitely want to use Days to Load. That will load up the historical data needed for your indicators. Otherwise it would only build up your chart in real-time as data flows in which would take a lot longer than just loading historical data. BarsRequired would still be necessary as it determines how many bars are needed on the chart prior to processing strategy logic.
        Josh P.NinjaTrader Customer Service

        Comment


          #5
          In NT 6.5.1000.16
          When starting a new strategy in Strategies Tab, the UI only has a "min bars required" parameter. There is no "days to load" setting. So when does historical data start loading for indicators?

          Comment


            #6
            Camdo, in 6.5 this would be dictated by the default chart lookback settings under Tools > Options > Data if you start them from the strategies tab.
            BertrandNinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by geddyisodin, 04-25-2024, 05:20 AM
            8 responses
            58 views
            0 likes
            Last Post NinjaTrader_Gaby  
            Started by halgo_boulder, 04-20-2024, 08:44 AM
            2 responses
            21 views
            0 likes
            Last Post halgo_boulder  
            Started by mishhh, 05-25-2010, 08:54 AM
            19 responses
            6,189 views
            0 likes
            Last Post rene69851  
            Started by gwenael, Today, 09:29 AM
            0 responses
            5 views
            0 likes
            Last Post gwenael
            by gwenael
             
            Started by Karado58, 11-26-2012, 02:57 PM
            8 responses
            14,830 views
            0 likes
            Last Post Option Whisperer  
            Working...
            X