Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Retrieve Session Template

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

    Retrieve Session Template

    Is there a way to programatically get the name of the session template being used by the primary data series? Thank you.

    EDIT:
    In NT7 there was Bars.Session.TemplateName. What is the equivalent in NT8?
    Last edited by Zeos6; 09-26-2017, 06:59 PM.

    #2
    Hello Zeos6,

    Thanks for your post.

    You can use Bars.TradingHours.Name
    Paul H.NinjaTrader Customer Service

    Comment


      #3
      Originally posted by NinjaTrader_Paul View Post
      Hello Zeos6,

      Thanks for your post.

      You can use Bars.TradingHours.Name
      Please officially document that, just as it was done in NT7. I have multiple indicators that must display on the chart, the session template that is in use.

      Comment


        #4
        Hello Koganam ,

        Thanks for your reply.

        The trading hours template name property is documented in the helpguide, I missed it when responding earlier. Thanks for the opportunity to add reference information: https://ninjatrader.com/support/help...hours_name.htm
        Paul H.NinjaTrader Customer Service

        Comment


          #5
          Thank you for the reply Paul.

          A question:

          Bars.TradingHours.Name gives the session template associated with the instrument in the instrument list. For example, for ES, you get 'CME US Index Futures ETH'. If the chart uses a different trading hours template for the instrument (as set in the Data Series properties window), for example Default 24x7, Bars.TradingHours.Name still returns 'CME US Index Futures ETH'. Is there any way to get the name of the trading hours template actually applied to the Data Series on the chart rather than the session template associated with the instrument?

          Comment


            #6
            Hello Zeos6,

            Thanks for your reply.

            In my tests the template name returned is the one from the data series and changes when you change the template in the data series. I check for the name in the OnBarUpdate().
            Paul H.NinjaTrader Customer Service

            Comment


              #7
              Hi Paul,

              D'oh! Dumb mistake on my part. I was checking Bars.Instrument.MasterInstrument.TradingHours.Name rather than the Bars.TradingHours.Name. You are quite correct. My apologies. Rather than checking in OnBarUpdate() I check it once in State.DataLoaded.

              Thanks for the help.

              Comment


                #8
                Originally posted by NinjaTrader_Paul View Post
                Hello Koganam ,

                Thanks for your reply.

                The trading hours template name property is documented in the helpguide, I missed it when responding earlier. Thanks for the opportunity to add reference information: https://ninjatrader.com/support/help...hours_name.htm
                Uh oh. I looked at that page multiple times and still managed not to see that! I may have to officially declare myself to be an idiot.

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by mjairg, 07-20-2023, 11:57 PM
                3 responses
                213 views
                1 like
                Last Post PaulMohn  
                Started by TheWhiteDragon, 01-21-2019, 12:44 PM
                4 responses
                544 views
                0 likes
                Last Post PaulMohn  
                Started by GLFX005, Today, 03:23 AM
                0 responses
                3 views
                0 likes
                Last Post GLFX005
                by GLFX005
                 
                Started by XXtrader, Yesterday, 11:30 PM
                2 responses
                12 views
                0 likes
                Last Post XXtrader  
                Started by Waxavi, Today, 02:10 AM
                0 responses
                7 views
                0 likes
                Last Post Waxavi
                by Waxavi
                 
                Working...
                X