Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Recording current day and previous day

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

    Recording current day and previous day

    Hi I am not sure where to ask this question so please move the question if I am writing to the wrong forum.

    I have about 200 symbols in my strategy. In order to test it on market replay I have to record all 200 symbols for a given day.

    However, the strategy uses the previous session bars as well. And most of symbols do not have the previous session. I could have opened chart and it would have loaded the required history but I cannot open 200 charts.

    Is there any way to force the loading of the history for a symbol list? I.e., when the recording begins, each symbols would have a loaded historical data - exactly like it would be when chart is opened.

    Thank you!

    #2
    Hello alex.nt,

    Thank you for your note.

    The instruments added in the strategy should be loading the same number of bars as the primary bar series the strategy is applied to. How are you determining the data is missing?
    Are you receiving any error messages when this occurs on the Log tab of the NinjaTrader Control Center?

    I look forward to your response.

    Comment


      #3
      Hi Patrick, please consider this:
      I run the strategy on AAPL & MSFT. There is no historical data on my machine.

      I open AAPL chart and add the strategy. AAPL chart would have the default 5 days of history - it will be downloaded. However, MSFT will not have this historical data. Therefore, at the first bar of the new session AAPL may look back for a day, while MSFT may not, as it would have the only the first bar of the current session.

      The question is if I have 200 stocks, how can I ensure they all get 5 days of historical data?

      Comment


        #4
        Hello alex.nt,

        Thank you for your response.

        Check the CurrentBars object for each bar series in your strategy: http://www.ninjatrader.com/support/h...urrentbars.htm

        So for example if I wanted to ensure that I have 5 days of minute data on a 1 minute chart I would check that 1440 bars per day are loaded or 1440 X 4:
        Code:
        if(CurrentBars[0]] <= 5760 || CurrentBars[1] <= 5760 || CurrentBars[2] <= 5760... etc.
        For information on ensuring you have data before accessing the values please visit the following link: http://www.ninjatrader.com/support/f...ead.php?t=3170

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

        Comment


          #5
          Patrick, sorry, the issue is not "find out if you have enough bars", the issue is "how to make sure we do have those bars for all symbols"?

          In other words I would like to load 1 day of historical data for each symbol - even if there is no historical data on my machine. However, since I am connected to my broker, it should technically be possible to download the historical data - the same way it is done for chart.

          Comment


            #6
            Hello alex.nt,

            Thank you for your response.

            The data will loaded based on the DaysToLoad, BarsToLoad or CustomRange setting in the Data Series menu for the primary series and it will load the same data for all additional bar series in the script.

            If it is not doing this then I would inquire on if you get historical data on a chart for these instruments alone. Who do you connect to for data and what instruments are not loading historical data?

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by ScottWalsh, Today, 04:29 PM
            0 responses
            5 views
            0 likes
            Last Post ScottWalsh  
            Started by rtwave, 04-12-2024, 09:30 AM
            2 responses
            22 views
            0 likes
            Last Post rtwave
            by rtwave
             
            Started by tsantospinto, 04-12-2024, 07:04 PM
            5 responses
            70 views
            0 likes
            Last Post tsantospinto  
            Started by cre8able, Today, 03:20 PM
            0 responses
            7 views
            0 likes
            Last Post cre8able  
            Started by Fran888, 02-16-2024, 10:48 AM
            3 responses
            49 views
            0 likes
            Last Post Sam2515
            by Sam2515
             
            Working...
            X