Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Tick / Minute Data is not the same

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

    Tick / Minute Data is not the same

    I wrote a simple strategy (could have been a indicator) to download tick data and save it as a file, so I could import tick data into Ninja faster than manually downloading tick data.

    The main code looks like this although it could be better written:


    Code:
    for(int i = 0; i < BarsArray[0].Count; i++) 	
    {
    	DateTime time = BarsArray[0].GetTime(i);
    	double price = BarsArray[0].GetClose(i);
    	long volume = BarsArray[0].GetVolume(i);
    	string outstring = time.Year.ToString("D4") + time.Month.ToString("D2") + time.Day.ToString("D2")
    					 + " " + time.Hour.ToString("D2") + time.Minute.ToString("D2") + time.Second.ToString("D2") 
    					+ ";" + price.ToString() + ";" + volume.ToString();
    	outputFile.WriteLine(outstring);
    	}
    If I run this on a instrument with minute data the output after midnight has data as shown here:

    20130708 235100;1460;1
    20130708 235300;1460;1
    20130708 235700;1460.75;5
    20130709 000700;1461;4
    20130709 000800;1461;2
    20130709 001300;1460.25;2

    But on tick data (1 tick) it looks like this:

    20130708 220507;1459.5;1
    20130708 220609;1459.25;1
    20130708 220658;1459;1
    20130709 070025;1471.5;1
    20130709 070025;1471.5;1
    20130709 070025;1471.5;1

    The only parameter that was changed was from minute to tick, but the tick data starts today at 7:00 am and the minute data (which shows changes in the prices) has data at a little after midnight.

    So the minute data looks continuous (more or less) and the tick data appears to have a big gap from 10:00PM yesterday to 7:00 AM today (CST) roughly.

    Thanks,

    Leroy
    Last edited by ldissinger; 07-09-2013, 07:32 AM.

    #2
    Hello Leroy,

    Thank you for your post.

    Is there a difference in the Session Template used for the Tick data versus the Minute data?

    You can check this by right clicking in your chart > select Data Series > check the Session Template setting. If running on the Strategies tab > right click on the strategy > select Edit Strategy > check the Session Template setting.

    I look forward to your response.

    Comment


      #3
      No, both are set to use the instrument settings.

      I can send you the code privately if you want to see it. It is about as simple as it can be.

      Leroy
      Last edited by ldissinger; 07-09-2013, 07:18 AM.

      Comment


        #4
        Hello Leroy,

        Thank you for your response.

        Yes please, I would like to review your code and test on my end if possible. Please send a note to support[at]ninjatrader[dot]com with 'ATTN: Patrick - 878129' in the subject line and a reference to this thread in the body of the e-mail with your code attached to the e-mail.

        Support Forum Thread: http://www.ninjatrader.com/support/f...ad.php?t=59186

        I look forward to your response.

        Comment


          #5
          It has been sent.

          Leroy

          Comment


            #6
            Hello Leroy,

            I have received the file, I will follow up with you after I test this on my end.

            Comment


              #7
              Of course, you will have to rename the file in NinjaTrader 7\import between enabling and disabling (after changing from minute to tick data). I was using 1 as the interval for tick and minute time frames.

              Thanks,

              Leroy

              P.S. I moved everything into the OnBarUpdate method so it would play tick by tick and save to the file in the same manner, but same results. This method also takes a lot longer than the original.
              Last edited by ldissinger; 07-09-2013, 08:04 AM.

              Comment


                #8
                Hello Leroy,

                Thank you for your time today.

                As requested the information on why this was occurring is listed below:

                Having the 'Save chart data as historical' option (Tools > Options > Data) enabled when connected to a data feed provider that supports historical data is not recommended as it will override downloading data from the historical data servers for your data feed provider. And it is possible to see gaps in these cases for times you may not have had the instrument open in NinjaTrader or NinjaTrader was shut down.

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by Stanfillirenfro, Today, 07:23 AM
                1 response
                4 views
                0 likes
                Last Post NinjaTrader_Gaby  
                Started by cmtjoancolmenero, Yesterday, 03:58 PM
                2 responses
                22 views
                0 likes
                Last Post cmtjoancolmenero  
                Started by olisav57, Yesterday, 07:39 PM
                1 response
                9 views
                0 likes
                Last Post NinjaTrader_ChelseaB  
                Started by cocoescala, 10-12-2018, 11:02 PM
                7 responses
                944 views
                0 likes
                Last Post Jquiroz1975  
                Started by oviejo, Today, 12:28 AM
                1 response
                12 views
                0 likes
                Last Post NinjaTrader_Gaby  
                Working...
                X