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 Problem

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

    Historical Data Problem

    Hello,

    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.

    #2
    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)


    http://mintywhite.com/windows-7/7maintenance/windows-seven-7-sync-system-clock-with-internet-time-how-to/
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      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?

      Comment


        #4
        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

        Comment


          #5
          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?

          Comment


            #6
            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

            Comment


              #7
              Thank you for the explanation.

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by trilliantrader, Today, 08:16 AM
              2 responses
              6 views
              0 likes
              Last Post trilliantrader  
              Started by samish18, Today, 08:31 AM
              1 response
              1 view
              0 likes
              Last Post NinjaTrader_Clayton  
              Started by Creamers, 09-08-2023, 10:26 AM
              6 responses
              157 views
              0 likes
              Last Post JonyGurt  
              Started by funk10101, Today, 08:14 AM
              1 response
              2 views
              0 likes
              Last Post NinjaTrader_Jesse  
              Started by bill2023, Yesterday, 08:51 AM
              3 responses
              22 views
              0 likes
              Last Post bltdavid  
              Working...
              X