• 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.


No announcement yet.

Partner 728x90


Historical Data Problem

  • Filter
  • Time
  • Show
Clear All
new posts

    Historical Data Problem


    I am attempting to pull yesterday's (Sep 1, 2015) Open price at 09:00 ET for the CL October futures contract.

    On the chart, this value appears as 46.86, yet when I retrieve it via code, I get 46.98. I investigated and saw that in my Ninjatrader7/db/minute/CL 10-15 folder, the open at 09:00 is 46.86 (i.e. the correct value).

    However, in the Ninjatrader7/db/tick/CL 10-15 folder, the value appears as 46.98, which is the value I retrieved from my code, but does not match the Open value at 09:00 as found in the Minute bars.

    I have the Save Chart Data as Historical option turned on and am using Kinectick for my data feed.

    How can I remedy this issue so that my historical tick data is correct (and can be retrieved programmatically)?

    Thank you.

    Hello ivb73077,

    Why have you enabled Save chart data as historical?

    By doing this, the data is being saved with your local PC clock. If this is out of sync with the Kinetick server by even a few seconds, this will cause descrepancies in the data.

    When requesting tick data with Kinetick between the hours of 9:30am ET to 4:30pm ET you will have access to 8 days of historical tick data. If you request the data outside those hours the full 180 days is available. After you request the data, it will be downloaded to your historical database and cache, and you will be able to access this data at any time.

    Since Kinetick has tick data available, why are you saving the tick data?

    Also, if you sync your PC clock with internet time, this will correct any new incoming data but will not correct any data that has already been saved.

    To sync the PC clock:
    • Right-click the clock in the lower right corner of your desktop
    • Select Adjust date/time
    • Click on Internet Time tab
    • In the Server: drop-down select time.nist.gov
    • Click Update
    • If the message that appears says successful your PC clock should now be updated
    • If not, select a different server from the Server: drop-down and try again (repeat until one of the servers is successful)

    Chelsea B.NinjaTrader Customer Service


      Per your instructions, I turned off Save Chart Data and re-synced to the NIST time.

      I only need 2 days of historical data, so am well within the 8 available.

      I restarted NT and the open price is 46.98 on a tick chart and a range chart. However, it still shows an open of 46.86 on the 1-minute chart.

      How do I fix this?


        Hi ivb73077,

        I want to be clear about what you are comparing.

        The 9:00 bar is closed at 9:00. This means that this is the 8:59 to 9:00 information. The first tick at 9:00 would be the close price of that minute's bar. The first tick at 8:59 would be the opening price of the 9:00 bar.

        However, that said, I'm showing the 9:00 AM (8:59 to 9:00 information) minute bar as Open: 46.86 and Close: 46.98.

        I am showing the first tick at 8:59:00 is 46.86.
        I am showing the first tick at 9:00:00 is 46.98.

        The tick closing the 9:00 bar and opening the 9:00 AM bar (9:00 to 9:01 information) is the tick at 9:00:00 with a price at 46.98.

        Are you showing a different open and close for the 9:00 minute bar?
        Are you showing a different tick at 8:59:00 or 9:00:00?
        Chelsea B.NinjaTrader Customer Service


          Yes - I see the same prices you noted. I think the issue stems from my misunderstanding how the bar timestamps are set.

          So when I retrieve the number of bars ago a bar occurred using GetBars or get the number of the bar at a DateTime using Bars.GetBars, I am getting the bar that closed at that time.

          That said, if I want the opening price at 9am, I need to pull the 9:01 bar and get its Open. But for a close at 2:30, I can reference the 2:30 Close.

          Am I understanding this correctly?


            Hi ivb73077,

            Yes, every bar is marked by the close time. When you use get bar with a date and time, the bar it returns is marked by the close of that bar.

            This is true everywhere for data bars in NinjaTrader.
            Chelsea B.NinjaTrader Customer Service


              Thank you for the explanation.


              Latest Posts


              Topics Statistics Last Post
              Started by UltraNIX, Today, 01:43 AM
              0 responses
              Last Post UltraNIX  
              Started by Velaice, Today, 01:27 AM
              0 responses
              Last Post Velaice
              by Velaice
              Started by leodrz, Yesterday, 09:45 PM
              2 responses
              Last Post leodrz
              by leodrz
              Started by habibalex, Yesterday, 09:30 PM
              0 responses
              Last Post habibalex  
              Started by Herrwolf1, Yesterday, 09:07 PM
              0 responses
              Last Post Herrwolf1