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.
    BertrandNinjaTrader Customer Service

    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.
        BertrandNinjaTrader Customer Service

        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?
              BertrandNinjaTrader Customer Service

              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.
                  BertrandNinjaTrader Customer Service

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by helpwanted, Today, 03:06 AM
                  1 response
                  10 views
                  0 likes
                  Last Post sarafuenonly123  
                  Started by Brevo, Today, 01:45 AM
                  0 responses
                  7 views
                  0 likes
                  Last Post Brevo
                  by Brevo
                   
                  Started by aussugardefender, Today, 01:07 AM
                  0 responses
                  5 views
                  0 likes
                  Last Post aussugardefender  
                  Started by pvincent, 06-23-2022, 12:53 PM
                  14 responses
                  242 views
                  0 likes
                  Last Post Nyman
                  by Nyman
                   
                  Started by TraderG23, 12-08-2023, 07:56 AM
                  9 responses
                  385 views
                  1 like
                  Last Post Gavini
                  by Gavini
                   
                  Working...
                  X