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

International time conversion

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

    International time conversion

    All,

    Please find attached a simple time conversion system (.xls) which accurately reflects NYSE trading session times from the perspective of Melbourne Australia (easily transferable to any time-zone). This is useful when say trading S&P500 e-mini contracts (ES) from Melbourne (with charts set to the local time) when you only want to take positions during the NYSE trading session (9:30am - 4:00pm).

    The I imagine this would be simple for a more experienced programer to code in NT. My current skills are not sufficient. An indicator with boolean return for market hours would be useful to many NT users.

    I envisaged something using genetic lists would do the trick and represent a minimal drain on processes.

    Any ideas welcome.

    Regards
    Shannon
    Attached Files

    #2
    Thanks for sharing your Excel calculator Shannon!
    BertrandNinjaTrader Customer Service

    Comment


      #3
      Hi Shannon,

      there are some solutions to this, depending on whether you use NT 6.5. or NT 7.0

      NT 6.5.

      NT 6.5. cannot convert the session times to your local time. This is basically a limitation of .NET 2.0. However the SessionPivotsV85 indicator uses a time conversion algorithm, which converts US Eastern Time to Universal Time and adjusts for daylight saving time. NT can then correctly display the result in your local time (have not tested this for Downunder though). It would be easy to add a backcolor option to display the NYSE session with a different background color.

      NT 7.0

      As .NET 3.5. supports time zone conversion, NT 7.0 comes with a session manager. You can access the session end time via Bars.Session.GetNextBeginEnd(). Let us assume that you want to display 24 hours of data, but highlight the session through a different backcolor of the chart. All you need is to define an offset and two colors (include with properties to make them user definable). I further assume that you use the predefined GLOBEX session for ES. You will then select an offset of 6 hours 45 minutes (8:30 to 15:15 Central Time) and write a few lines to your indicator which look like

      Bars.Session.GetNextBeginEnd(Time[0], out sessionBegin, out sessionEnd);
      if (Time[0] > sessionEnd.Substract(offset) && Time[0] <= sessionEnd)
      BackColor = sessionColor;
      else
      BackColor = offsessionColor;

      Let me know, what you look for, and I could quickly code this or integrate it with the SessionPivots indicator for NT 6.5

      Comment


        #4
        Harry,

        Where can I locate this "SessionPivotsV85" indicator?

        I was looking at popping the New York (NY) and Melbourne (Melb) arrays into two genetic lists in the "Initialize" section, then in the "OnBarUpdate" section run code equivalent the rather simple function in in excel.

        As this code would be run on each bar update the chart background could be shaded and a boolean could be returned so as a strategy could quickly reference the information.

        Struggling at the moment getting the NY info (dates & UTC offsets) and Melb info (dates & UTC offsets) into genetic lists. One column is DateTime and the other is integer!

        Shannon

        Comment


          #5
          The indicators are here:



          If you look for a fast solution you should convert to NT 7.0, as .Net 3.5 supports time conversion, and it is easy to display the correct sessions.


          Originally posted by Shansen View Post
          Harry,

          Where can I locate this "SessionPivotsV85" indicator?

          I was looking at popping the New York (NY) and Melbourne (Melb) arrays into two genetic lists in the "Initialize" section, then in the "OnBarUpdate" section run code equivalent the rather simple function in in excel.

          As this code would be run on each bar update the chart background could be shaded and a boolean could be returned so as a strategy could quickly reference the information.

          Struggling at the moment getting the NY info (dates & UTC offsets) and Melb info (dates & UTC offsets) into genetic lists. One column is DateTime and the other is integer!

          Shannon

          Comment


            #6
            All,

            Please find attached an indicator that appears to do the job. It may not be overly neat, comments / improvements are welcome.

            With minor modification, this indicator could be customized to different markets and home time zones.

            Regards
            Shannon
            Attached Files

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Gerik, Today, 09:40 AM
            1 response
            6 views
            0 likes
            Last Post NinjaTrader_Gaby  
            Started by RookieTrader, Today, 09:37 AM
            1 response
            10 views
            0 likes
            Last Post NinjaTrader_ChelseaB  
            Started by alifarahani, Today, 09:40 AM
            0 responses
            5 views
            0 likes
            Last Post alifarahani  
            Started by KennyK, 05-29-2017, 02:02 AM
            3 responses
            1,284 views
            0 likes
            Last Post NinjaTrader_Clayton  
            Started by AttiM, 02-14-2024, 05:20 PM
            11 responses
            186 views
            0 likes
            Last Post NinjaTrader_ChelseaB  
            Working...
            X