Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Historical data time problem

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

    Historical data time problem

    I have imported 5-minute historical data of nyse stocks into Ninjatrader. The 5 minute charts are good, however, when I switch the chart to a different time frame the data is then displayed wrongly. Fore example if I open a 30 minute chart, it seems like Ninjatrader calculates the closing price of any particular 30 minute candle using data which belongs to the next candle.


    I'll explain:

    Fore example the 30 min candle form 9:30 to 10:00,
    ninjatrader will calculate its closing price by using the data derived from the 5 minute line of data at 10:00 ( and not 9:55)
    meaning the closing price of the 9:30 to 10:00 candle is actually the market closing price at 10:05

    I have opened the data on Omega prosuite and indeed the chart formations of any time frame (besides 5 minute) is displayed differently compared to ninjatrader ( the data on Omaga is in line with my original data files).



    below is a 1 day example of the 5 minute data format I use



    20090813 093000;85.9599;86.3405;85.5200;86.2100;19483
    20090813 093500;86.1200;86.1200;85.2000;85.4200;30533
    20090813 094000;85.3700;85.4600;84.7500;84.7800;48334
    20090813 094500;84.7500;84.9100;84.5100;84.7200;51528
    20090813 095000;84.6820;84.6950;84.1000;84.2200;46029
    20090813 095500;84.1900;84.3500;84.1100;84.2600;42703
    20090813 100000;84.2850;84.5800;84.1500;84.5700;43497
    20090813 100500;84.5500;84.6800;84.3600;84.3900;50381
    20090813 101000;84.4400;84.5800;84.1500;84.5000;52650
    20090813 101500;84.5100;84.6100;84.3400;84.3800;20289
    20090813 102000;84.4100;84.6500;84.3800;84.4400;68113
    20090813 102500;84.5400;84.6200;84.4000;84.4100;14944
    20090813 103000;84.4190;84.6700;84.4000;84.6100;26382
    20090813 103500;84.6180;85.0000;84.4200;84.9300;40115
    20090813 104000;84.9300;85.1500;84.8900;85.1250;43031
    20090813 104500;85.1100;85.1700;84.9400;85.0500;11560
    20090813 105000;85.0700;85.1600;84.9500;85.1400;11531
    20090813 105500;85.1500;85.3000;84.9700;84.9800;21195
    20090813 110000;85.0000;85.2100;84.9700;85.1030;32259
    20090813 110500;85.1340;85.1600;84.8100;84.9100;10254
    20090813 111000;84.9700;84.9700;84.7100;84.7650;21419
    20090813 111500;84.7600;84.7700;84.5000;84.5100;37013
    20090813 112000;84.5000;84.5000;84.3300;84.4290;50414
    20090813 112500;84.3800;84.5400;84.3200;84.5200;10665
    20090813 113000;84.4900;84.5900;84.3100;84.3400;16079
    20090813 113500;84.3400;84.5275;84.3300;84.5275;13135
    20090813 114000;84.5500;84.5500;84.4000;84.4600;19061
    20090813 114500;84.4400;84.5099;84.2800;84.2800;7544
    20090813 115000;84.2800;84.3200;84.2434;84.2620;11450
    20090813 115500;84.2500;84.3300;84.2500;84.3200;8276
    20090813 120000;84.3300;84.4300;84.2400;84.2700;13941
    20090813 120500;84.2700;84.3400;84.2000;84.2020;14253
    20090813 121000;84.2300;84.2600;84.0800;84.0900;16191
    20090813 121500;84.0900;84.2600;84.0800;84.2201;15790
    20090813 122000;84.2100;84.2150;84.0700;84.1280;19571
    20090813 122500;84.1100;84.1800;84.1006;84.1200;9408
    20090813 123000;84.1300;84.3000;84.1100;84.2701;12949
    20090813 123500;84.2900;84.4900;84.2900;84.4400;27022
    20090813 124000;84.4400;84.5000;84.3600;84.4200;27779
    20090813 124500;84.4300;84.6100;84.3800;84.5800;27808
    20090813 125000;84.5800;84.6900;84.5201;84.5201;25430
    20090813 125500;84.5400;84.5700;84.4500;84.5200;13261
    20090813 130000;84.5400;84.7800;84.5300;84.7500;21449
    20090813 130500;84.7500;84.8300;84.7000;84.7601;14342
    20090813 131000;84.7700;84.8400;84.6600;84.7000;23965
    20090813 131500;84.7400;84.7850;84.6000;84.6000;35171
    20090813 132000;84.6000;84.6400;84.4600;84.5400;9896
    20090813 132500;84.5600;84.5600;84.4500;84.4600;8138
    20090813 133000;84.4700;84.6100;84.4700;84.5700;8750
    20090813 133500;84.5500;84.6900;84.5202;84.6596;14719
    20090813 134000;84.6530;84.6600;84.5401;84.5600;11736
    20090813 134500;84.5300;84.6500;84.5300;84.5800;9516
    20090813 135000;84.5800;84.6000;84.4600;84.5000;13275
    20090813 135500;84.5100;84.6300;84.5000;84.6300;10040
    20090813 140000;84.6300;84.6300;84.4700;84.4850;13404
    20090813 140500;84.4800;84.4900;84.3500;84.3802;13448
    20090813 141000;84.4000;84.4000;84.1600;84.3600;22809
    20090813 141500;84.3700;84.4700;84.2300;84.4600;15982
    20090813 142000;84.4600;84.5800;84.3500;84.3500;26022
    20090813 142500;84.3600;84.4600;84.3400;84.3400;10103
    20090813 143000;84.3700;84.5500;84.3300;84.3300;17602
    20090813 143500;84.3000;84.4500;84.2800;84.4100;20432
    20090813 144000;84.4000;84.5200;84.3701;84.4400;10525
    20090813 144500;84.4300;84.4401;84.3500;84.3600;12741
    20090813 145000;84.3600;84.4400;84.3200;84.3999;9400
    20090813 145500;84.3900;84.4300;84.2500;84.2500;14518
    20090813 150000;84.2600;84.3500;84.2400;84.3300;18740
    20090813 150500;84.3400;84.3700;84.2200;84.3200;22371
    20090813 151000;84.3000;84.5200;84.2700;84.4600;25639
    20090813 151500;84.4600;84.5500;84.3900;84.4200;28956
    20090813 152000;84.4800;84.5500;84.4300;84.5093;21034
    20090813 152500;84.5200;84.5600;84.4700;84.5300;17400
    20090813 153000;84.5300;84.6100;84.5000;84.5500;22220
    20090813 153500;84.5599;84.5900;84.4400;84.4800;20485
    20090813 154000;84.4900;84.7400;84.4650;84.6700;38419
    20090813 154500;84.6500;84.7400;84.5100;84.5100;17058
    20090813 155000;84.5200;84.6100;84.4601;84.5300;40361
    20090813 155500;84.5100;84.5800;84.3900;84.4900;47119

    #2
    Hello noizg,

    Thank you for your post.

    I took the data you provided and created an import file for the historical data. When I compare the data to the chart the times listed in the file are when the bar is closed. Please go to Tools-->Historical Data-->Delete. Remove all the historical data for the specific instrument that this data is from.

    Then please copy the data into a .txt file and save the file with the name of the instrument. Then please reimport by going to Tools-->Historical Data-->Import and then choose the file you have created.

    Once you do that please check a chart and you can see the data listed on the chart using the Data Box, which is an icon (fifth from the right on the chart toolbar).
    Ryan O.NinjaTrader Customer Service

    Comment


      #3
      Hi RyanOlson,

      thanks for the quick reply. I deleted and re-imported my data , although the data i use are kept in a text file in the first place.
      As I said before, there is no problem when I open a chart on the 5 min time frame. However the display of candles on higher time frames (like 30min) is all wrong.
      For example, if we look at the AMZN data I provided using the data box, the 30 min candle between 10:00 to 10:30 should close at the price 84.41, I can see that using the 5min chart ( this is the closing price of the 5 min candle at 10:25) . However, the 30min chart shows the closing price as 84.57 instead.
      Same goes for the opening prices.Fore example, on that day the open price of the 5min candle is $85 while switching to the 30min or 1hour chart will give a different opening price for the same time.
      Perhaps there is something wrong with my settings?

      Comment


        #4
        Hi,

        I tested, and am able to duplicate. The issue is that the close is based on the first bar rather than the last. So for the bar you mentioned it is basing the close price off of the 10 AM bar, rather than the any of the in between bars.

        This is to be expected as the bars are closed based on the file. To resolve this you will want to remove the extra two decimal places on each price because NinjaTrader is rounding those numbers and then using only the data that is present in the database.
        Ryan O.NinjaTrader Customer Service

        Comment


          #5
          Hi RyanOlson,
          I have removed the extra two decimals from each line of data, but the problem persists.
          Is there any other possible solution?

          This is an example of the 2 decimal data.


          20090813 0935;86.12;86.12;85.20;85.42;30533
          20090813 0940;85.37;85.46;84.75;84.78;48334
          20090813 0945;84.75;84.91;84.51;84.72;51528
          20090813 0950;84.68;84.69;84.10;84.22;46029
          20090813 0955;84.19;84.35;84.11;84.26;42703
          20090813 100000;84.28;84.58;84.15;84.57;43497
          20090813 100500;84.55;84.68;84.36;84.39;50381
          20090813 101000;84.44;84.58;84.15;84.50;52650
          20090813 101500;84.51;84.61;84.34;84.38;20289
          20090813 102000;84.41;84.65;84.38;84.44;68113
          20090813 102500;84.54;84.62;84.40;84.41;14944
          20090813 103000;84.41;84.67;84.40;84.61;26382
          20090813 103500;84.61;85.00;84.42;84.93;40115
          20090813 104000;84.93;85.15;84.89;85.12;43031
          20090813 104500;85.11;85.17;84.94;85.05;11560
          20090813 105000;85.07;85.16;84.95;85.14;11531
          20090813 105500;85.15;85.30;84.97;84.98;21195
          20090813 110000;85.00;85.21;84.97;85.10;32259
          20090813 110500;85.13;85.16;84.81;84.91;10254
          20090813 111000;84.97;84.97;84.71;84.76;21419
          20090813 111500;84.76;84.77;84.50;84.51;37013
          20090813 112000;84.50;84.50;84.33;84.42;50414
          20090813 112500;84.38;84.54;84.32;84.52;10665
          20090813 113000;84.49;84.59;84.31;84.34;16079
          20090813 113500;84.34;84.52;84.33;84.52;13135
          20090813 114000;84.55;84.55;84.40;84.46;19061
          20090813 114500;84.44;84.50;84.28;84.28;7544
          20090813 115000;84.28;84.32;84.24;84.26;11450
          20090813 115500;84.25;84.33;84.25;84.32;8276
          20090813 120000;84.33;84.43;84.24;84.27;13941
          20090813 120500;84.27;84.34;84.20;84.20;14253
          20090813 121000;84.23;84.26;84.08;84.09;16191
          20090813 121500;84.09;84.26;84.08;84.22;15790
          20090813 122000;84.21;84.21;84.07;84.12;19571
          20090813 122500;84.11;84.18;84.10;84.12;9408
          20090813 123000;84.13;84.30;84.11;84.27;12949
          20090813 123500;84.29;84.49;84.29;84.44;27022
          20090813 124000;84.44;84.50;84.36;84.42;27779
          20090813 124500;84.43;84.61;84.38;84.58;27808
          20090813 125000;84.58;84.69;84.52;84.52;25430
          20090813 125500;84.54;84.57;84.45;84.52;13261
          20090813 130000;84.54;84.78;84.53;84.75;21449

          Comment


            #6
            Hi,

            After removing the decimal places NinjaTrader is building the data as is expected presently. The time stamp on a bar will be the close time, thus the 10:00 AM bar is the close. With NinjaTrader 6.5 this is to be expected, and to resolve this presently you will want to push the data in the file up 5 minutes. The 9:35 bar becomes 9:30, etc. Please see the following link.


            Now, this is something that we will be modifying with the release of NinjaTrader 7, as you will be able to import data where you define how to time stamp the bars, whether with close or open data. Please see the following link.
            Ryan O.NinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by wzgy0920, 04-20-2024, 06:09 PM
            2 responses
            26 views
            0 likes
            Last Post wzgy0920  
            Started by wzgy0920, 02-22-2024, 01:11 AM
            5 responses
            32 views
            0 likes
            Last Post wzgy0920  
            Started by wzgy0920, Yesterday, 09:53 PM
            2 responses
            49 views
            0 likes
            Last Post wzgy0920  
            Started by Kensonprib, 04-28-2021, 10:11 AM
            5 responses
            191 views
            0 likes
            Last Post Hasadafa  
            Started by GussJ, 03-04-2020, 03:11 PM
            11 responses
            3,231 views
            0 likes
            Last Post xiinteractive  
            Working...
            X