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

How to neutralize time zones & daylight savings time?

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

    How to neutralize time zones & daylight savings time?

    Hi,

    I am moving from TradeStation to Ninja and now I encounter a problem with the time stamps of bars:

    If I am not mistaken the time stamp is always based on the time zone of the PC that NT is running on, right?
    Is there a way to either switch the time stamps to the time zone of the exchange where the instrument traded? Or has somebody come up with a calculation method for the time difference?

    If the time difference is calculated it would need to be done for each day individually as the dates where countries switch on/off daylight savings time can be different. Otherwise historical data would be incorrect.

    Thanks,
    NutFlush

    #2
    Correct NutFlush, NinjaTrader would alwayse use the local time zone set as reference. The Session Manager though allows you to create the session times in other time zones as well and NT would then do the conversion for you. What would not be included currently is a management of exchange holidays, however that's on our list for the next major platform update.
    BertrandNinjaTrader Customer Service

    Comment


      #3
      Originally posted by NinjaTrader_Bertrand View Post
      The Session Manager though allows you to create the session times in other time zones as well and NT would then do the conversion for you.
      What conversion do you mean? How can I convert the time from a bar's time stamp into the exchange time? Do you have any code examples?

      Thanks,
      NutFlush

      Comment


        #4
        Would unfortunately not have any code examples - in the Session Manager you setup the session times you want to use in whatever timezone and save it as template. If you use that template on the chart NT will convert to your local set timezone then and you don't have to worry about that.

        If you want to check the session template set timezone, you can use -

        BertrandNinjaTrader Customer Service

        Comment


          #5
          That link looks like I might find ideas for a solution there.

          Thanks!

          Comment


            #6
            Originally posted by NinjaTrader_Bertrand View Post
            Correct NutFlush, NinjaTrader would alwayse use the local time zone set as reference. The Session Manager though allows you to create the session times in other time zones as well and NT would then do the conversion for you. What would not be included currently is a management of exchange holidays, however that's on our list for the next major platform update.
            One more thing: is it possible to find out through code whether a session is shorter than normal?

            For example that would be the case if the following day is a holiday and therefore the NYSE session is shorter by 3 hours. I experimented with "Bars.Session.GetNextBeginEnd(BarsArray[0], 0, out sessionBegin, out sessionEnd)", but this always gives me the regular session end time, NOT the real one for that specific day (even though the date in the variable sessionEnd is equal to the day when there was a short session).

            Is that also a feature that would only be available in future updates?

            Thanks,
            NutFlush

            Comment


              #7
              Yes, correct that part of the holiday management is on the feedback list as well for the next major update, so you can define those shorter sessions experienced. I'll make sure to count in your vote / request for it as well.
              BertrandNinjaTrader Customer Service

              Comment


                #8
                Great! Thanks!

                Comment


                  #9
                  You cannot find out via code whether a session is shorter than normal. The reason is that the master data for the instrument does not come with a holiday calendar. This issue has been discussed, and I expect (!) that NinjaTrader 8 will come with a holiday calendar which allows you to set specific trading hours for exchange holidays.

                  If you wish to use such holiday calendar, you need to hard-code it into the indicator. One example, how this can be done, are the SessionPivots indicator (see indicator downloads) that allows you to enter the CME holidays manually (default settings include Martin-Luther-King Day, President's Day, Memorial Day, Independence Day, Labour Day and Thanksgiving).

                  Comment


                    #10
                    Thanks for the info, Harry!

                    I am not really surprised that it's NOT possible to find out how long a session is on any given day, because that info would need to be embedded in the data stream (out of reach of Ninja). The alternative would be an additional data source where the software can look up the session times for a variety of exchanges and historical dates. Is that what you were refering to? Knowing the (historical) holidays is slightly different from knowing the actual times when an exchange was open. For example "Sandy" caused the NYSE and NASDAQ to close for 2 days in Oct. 2012 and that certainly was no holiday.

                    Cheers,
                    NutFlush

                    Comment


                      #11
                      Originally posted by NutFlush View Post
                      Thanks for the info, Harry!

                      I am not really surprised that it's NOT possible to find out how long a session is on any given day, because that info would need to be embedded in the data stream (out of reach of Ninja). The alternative would be an additional data source where the software can look up the session times for a variety of exchanges and historical dates. Is that what you were refering to? Knowing the (historical) holidays is slightly different from knowing the actual times when an exchange was open. For example "Sandy" caused the NYSE and NASDAQ to close for 2 days in Oct. 2012 and that certainly was no holiday.

                      Cheers,
                      NutFlush

                      NinjaTrader has an instrument manager, which allows to access the master data for each instrument. Currently the instrument manager allows to select a specific session template for that instrument, which holds the usual trading times.

                      In addition to the session template NinjaTrader 8 would need to include a holiday calendar, which should

                      - allow to mark exchange holidays
                      - modify the trading hours as per session template for specific trading days manually

                      The default values for the holiday calendar should be those specified by the rules of the exchange. In case of a special event such as a hurricane or a terrorist attack you would need to modify those values manually and save them.

                      At least this is, what I expect from NinjaTrader 8. Many years ago I had traded with a simplistic software called QuoteTracker, and this feature was already available, so it is high time that NinjaTrader makes the move to add it.
                      Last edited by Harry; 07-13-2013, 11:40 AM.

                      Comment


                        #12
                        Thanks for explaining!

                        I fully agree with your expectation. That feature would be great.

                        Comment


                          #13
                          Me too

                          Yes that would be great to see NINJA SUPPORT

                          Comment

                          Latest Posts

                          Collapse

                          Topics Statistics Last Post
                          Started by i019945nj, 12-14-2023, 06:41 AM
                          3 responses
                          60 views
                          0 likes
                          Last Post i019945nj  
                          Started by TraderBCL, Today, 04:38 AM
                          2 responses
                          17 views
                          0 likes
                          Last Post TraderBCL  
                          Started by martin70, 03-24-2023, 04:58 AM
                          14 responses
                          106 views
                          0 likes
                          Last Post martin70  
                          Started by Radano, 06-10-2021, 01:40 AM
                          19 responses
                          610 views
                          0 likes
                          Last Post Radano
                          by Radano
                           
                          Started by thanajo, 05-04-2021, 02:11 AM
                          4 responses
                          471 views
                          0 likes
                          Last Post tradingnasdaqprueba  
                          Working...
                          X