Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Refrenceing Instrument & Session Templete info

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

    Refrenceing Instrument & Session Templete info

    I would like to create an indicator that draws the main data series Instrument market hours.

    I know that the session object contains session.TimeZoneInfo & session.GetNextBeginEnd which can reference the timezone, which I can use ConvertTimeBySystemTimeZoneId to get the market time, and the next Begin and ENd of the market hours.

    My question, is how can I reference the Instrument default Session template (exist in Instrument Manager)? The Instrument object doesn't contain a reference to its own session template.

    #2
    Shai, thanks for the post - while it would not be a documented / supported property, you could look into using Instrument.MasterInstrument.SessionTemplate for this task. It should give you the default template defined for your master instrument in the NT database.

    Comment


      #3
      Dear Bertrand,

      Thank you for your reply, it did help much, and I could get the local times for the instrument market.

      What I'm still missing is the market operational time and the time of opening and closing. Is there any indicator or any other source for it.

      Comment


        #4
        Unfortunatley I'm not aware of any other source. The session templates would be your best source here.

        Comment


          #5
          Originally posted by Shai Samuel View Post
          Dear Bertrand,

          Thank you for your reply, it did help much, and I could get the local times for the instrument market.

          What I'm still missing is the market operational time and the time of opening and closing. Is there any indicator or any other source for it.

          The process would be as follows:

          (1) If you wish to trade an instrument "X", then you need find out the trading times on the website of th exchange where the instrument is traded.
          (2) In a second step you create a session template for the instrument "X" by using time zone of exchange and the opening hours.
          (3) You can now save that session template under instrument setttings.
          (4) Now you can use that template for your purposes.

          For example, for ES (S&P 500 mini futures) I have consulted the website, and in line with contract specifications, there are three possible session templates

          - ETH (full trading hours)
          - RTH (regular trading hours)
          - ETH with subsessions (full trading hours, divided into night session, regular session and evening session)

          The first two templates come with NinjaTrader. I have created the third one, which I use for some of my charts. (Nota: The contractual closing time of the trading day is 4:15 PM Central, I have used 4:30 PM Central to include all data prior to November 18, 2012, when the contractual trading times were changed.
          Attached Files

          Comment


            #6
            Thank you so much Bertrand & Harry. Is there a way to refer & use the session template data programmatically?

            Comment


              #7
              Originally posted by Shai Samuel View Post
              Thank you so much Bertrand & Harry. Is there a way to refer & use the session template data programmatically?
              You're welcome, you mean you would want to create and assign the template via your script internally?

              Comment


                #8
                Ok, I experienced and understand now the concept of the session template, and referring to it better.

                My question is still about the two possibly different session templates that might be associated with the instrument:
                1. The one which is currently in use, which was assigned by the Data Series property or the Strategy who call the indicator. This one has to do with your choice.
                2. The one which is originally assigned to the instrument, as you can see in the Instrument Manager->Instrument Editor. This one has to do with the Instrument definition.

                To access them from code we can use:
                1. The first one will be Bars.Session.
                2. Can use Instrument.MasterInstrument.Session for the second one?

                Comment


                  #9
                  Hi Shai, yes that understanding would be correct, those are the templates you can access and choices a user could make, either set a specific one or use the instrument default set.

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by argusthome, 03-08-2026, 10:06 AM
                  0 responses
                  106 views
                  0 likes
                  Last Post argusthome  
                  Started by NabilKhattabi, 03-06-2026, 11:18 AM
                  0 responses
                  54 views
                  0 likes
                  Last Post NabilKhattabi  
                  Started by Deep42, 03-06-2026, 12:28 AM
                  0 responses
                  36 views
                  0 likes
                  Last Post Deep42
                  by Deep42
                   
                  Started by TheRealMorford, 03-05-2026, 06:15 PM
                  0 responses
                  38 views
                  0 likes
                  Last Post TheRealMorford  
                  Started by Mindset, 02-28-2026, 06:16 AM
                  0 responses
                  74 views
                  0 likes
                  Last Post Mindset
                  by Mindset
                   
                  Working...
                  X