• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

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.
    Patrick H.NinjaTrader Customer Service

    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.
        Patrick H.NinjaTrader Customer Service

        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?
            Patrick H.NinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by RedDuke, Today, 01:59 PM
            0 responses
            9 views
            0 likes
            Last Post RedDuke
            by RedDuke
             
            Started by MarianApalaghiei, Today, 01:18 PM
            1 response
            10 views
            0 likes
            Last Post NinjaTrader_PatrickG  
            Started by williamzz, Today, 01:00 PM
            1 response
            6 views
            0 likes
            Last Post NinjaTrader_Jim  
            Started by edmata1109, Today, 12:40 PM
            1 response
            12 views
            0 likes
            Last Post NinjaTrader_Kate  
            Started by ballboy11, Today, 11:57 AM
            1 response
            8 views
            0 likes
            Last Post NinjaTrader_Jesse  
            Working...
            X