No announcement yet.

Partner 728x90


Importing Historical Data - Associating the Data with a Specific Contract

  • Filter
  • Time
  • Show
Clear All
new posts

    Originally posted by NinjaTrader_BrandonH View Post
    Hello beejinator,

    Thanks for your note.

    It is likely that the data you are trying to import is not in a correct format. You would need to make sure that the data you are importing in the file is in one of the formats listed in the help guide page below.

    Understanding import file and data formats:
    Formatting data and formatting the file name:

    Further, I see you noted that you created a single rollover date for December 2050 which will not work. You should just add the current year that some of the data exists in. For example, if the data goes up to this month add a contract for this month.

    The future instrument expects to have multiple contracts of data and to use the merge policy with offsets. If your data is already merged going back many years and isn't something to be traded on/fake instrument, it may be easier to just use a stock type instrument instead of a futures instrument.

    Let me know if I may assist further.
    Hi thanks for all these posts. Helpful. I am almost there but I can't find any forum content on my issue.

    -> I followed all the rules, got my data formatted properly for import. It is a continuous backadjusted futures contract.
    -> I set up the instrument in Instruments first, matching tick size, dollars per point, trading hours etc.
    -> I successfully import the data, but no matter what I try it gets imported as a stock. Based on NT8 website, this will occur if not Instrument is set up ahead of time. However I believe I have done this properly. The file name is 'DX2.Last' and it is a .txt file.
    -> The problem with this import is 1. no matter what I type as the trading hours in the Instrument setup, NYSE trading hours are forced. 2. The minimum price increment gets forced to 0.01 (IE 1 cent) which does not work for futures contracts.

    So that brings me to above quote.

    -> I try importing it as a stock as suggested here, but that comments out the Point Value.

    Any suggestions?

    Thank you,


      Hello Tim,

      Thanks for your post.

      To clarify, you created a Futures instrument for DX2 in the Tools > Instruments window before importing the historical data. Is that correct?

      If you are importing historical data for a futures or forex instrument, the instrument MUST exist in the database. If it does not, you must add it first via the Instruments window. Any data imported where the instrument does not exist in the database will automatically be imported as a "Stock" instrument type.

      It seems that your historical data file does not have an expiry month included in the file name.

      When you import historical data for a futures instrument, the text file needs to include the expiry month. Please see the link below under 'Understanding import file and data formats'.

      For example:
      MSFT.Last.txt for Microsoft stock last price data
      ES 12-09.Bid.txt for the S&P E-mini December contract bid price data
      EURUSD.Ask.txt for the Euro/U.S. dollar currency pair ask price data​​

      For information about adding an instrument please see the 'Adding an Instrument" section of this help guide page:

      Please see this help guide page that details how to import historical data from a .txt file:
      Brandon H.NinjaTrader Customer Service


        You definitely created your custom instrument as the "Futures" type, right? What's the error message you get when you try to import? What's the exact format of your data for each column? Important to make sure it follows the Ninjatrader requirements.

        What worked for me, importing historical tick data for NQ futures:
        • Create a new instrument named NQ_HISTORICAL, with all the settings copied from the existing NQ instrument
        • The only difference is that I added a SINGLE expiry/contract for a future expiration month (I chose December 2024)
        • I then renamed my import text file to "NQ_HISTORICAL 12-24". This is important, do NOT add .Last or .txt, it won't work. (Unfortunately NT support keeps giving the advice to name the file that way) That being said, make sure the file is saved as a text file, just don't add .txt to the file name.


          Thanks to the two responses!

          Yes I definitely created it as a futures contract. I did it many times w same result, no way I made the same error over and over.

          BrandonH: the expiry month in the name of the txt file, matched to a single (in the far future) expiry date set up when creating the Instrument, did the trick.

          And, now the ETH trading hours are included. All good!

          Thanks so much to you both.



          Latest Posts


          Topics Statistics Last Post
          Started by ZeroKuhl, 05-30-2024, 10:22 AM
          3 responses
          Last Post NinjaTrader_Jesse  
          Started by johnsb1990, Today, 09:34 AM
          0 responses
          Last Post johnsb1990  
          Started by psangram, Today, 09:30 AM
          0 responses
          Last Post psangram  
          Started by gabberdim, Today, 09:14 AM
          2 responses
          Last Post gabberdim  
          Started by kiss987, 05-16-2018, 02:19 AM
          13 responses
          Last Post NinjaTrader_Jesse