Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

Historical data import error

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

    Historical data import error

    When I import historical data I encoutner the following error...

    Import type 'NinjaTrader (beginning of bar timestamps)': Error on calling 'OnNextDataPoint' method: System.InvalidOperationException: Operation is not valid due to the current state of the object. at NinjaTrader.NinjaScript.ImportTypes.TextImportType .OnNextDataPoint() at NinjaTrader.NinjaScript.ImportTypes.ImportType.Imp ort(MarketDataType marketDataType, TimeZoneInfo sourceTimeZoneInfo, Boolean generateMinuteBars, Boolean generateDailyBars, IProgress progress)

    How to fix it?

    #2
    Hello GordonHui,

    Thank you for your post.

    Would you be able to post a sample of the first few lines (maybe 5 or so) of the data you are attempting to import? That would help us know whether the file is formatted in a way that's causing an issue.

    Also, what version of NinjaTrader 8 are you running? You can find this under Help > About. The current version is 8.0.22.2. If you are on a different version, please update to the current version using the instructions below and test:
    • First, copy your license key from NinjaTrader under Help> License Key then exit NinjaTrader
    • Click on the link: http://ninjatrader.com/PlatformDirect
    • Enter your license key and press Submit
    • Select 'NinjaTrader 8'
    • Select 'Download'
    • Critical: Before running the installer, ensure NinjaTrader is closed.
    Thanks in advance; I look forward to assisting you further.
    Kate W.NinjaTrader Customer Service

    Comment


      #3
      The data file is as follow...

      20180227 091500;31772;31773;31723;31753;1192;31743.8
      20180227 091600;31753;31761;31737;31738;672;31747.4
      20180227 091700;31739;31743;31719;31726;498;31731.5
      20180227 091800;31727;31746;31724;31741;514;31737.3
      20180227 091900;31741;31749;31730;31745;360;31741

      The version I'm running is 8.0.22.2 64-bit.

      Comment


        #4
        Hello GordonHui,

        Thank you for your reply.

        Your data is not correctly formatted for import into NinjaTrader. For minute data, the necessary formatting is as follows:
        Minute Bars Format
        Each bar must be on its own line and fields must be separated by semicolon. Only 1 minute bars can be imported.

        The format is:

        yyyyMMdd HHmmss;open price;high price;low price;close price;volume

        Sample data:

        20061023 004400;1377.25;1377.25;1377.25;1377.25;86
        20061023 004500;1377.25;1377.25;1377.25;1377.25;27
        20061023 004600;1377.25;1377.25;1377.25;1377.25;24
        20061023 004700;1377.50;1377.50;1377.25;1377.25;82

        I note the data in your sample has an additional field following what looks to be volume - this would need to be removed prior to the data being imported.

        Please let us know if we may be of further assistance to you.
        Kate W.NinjaTrader Customer Service

        Comment


          #5
          Thank you.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by DJ888, 04-16-2024, 06:09 PM
          6 responses
          18 views
          0 likes
          Last Post DJ888
          by DJ888
           
          Started by Jon17, Today, 04:33 PM
          0 responses
          1 view
          0 likes
          Last Post Jon17
          by Jon17
           
          Started by Javierw.ok, Today, 04:12 PM
          0 responses
          6 views
          0 likes
          Last Post Javierw.ok  
          Started by timmbbo, Today, 08:59 AM
          2 responses
          10 views
          0 likes
          Last Post bltdavid  
          Started by alifarahani, Today, 09:40 AM
          6 responses
          41 views
          0 likes
          Last Post alifarahani  
          Working...
          X