• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

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, 05: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 GMiller64, Today, 05:56 PM
                0 responses
                1 view
                0 likes
                Last Post GMiller64  
                Started by rickyblah12, Today, 05:01 PM
                1 response
                3 views
                0 likes
                Last Post NinjaTrader_ShawnB  
                Started by jtrading82, 10-11-2019, 05:07 PM
                8 responses
                80 views
                1 like
                Last Post sledge
                by sledge
                 
                Started by MARTIN MARTIN, Yesterday, 01:01 PM
                3 responses
                42 views
                0 likes
                Last Post MARTIN MARTIN  
                Started by NickyD, Today, 11:42 AM
                1 response
                10 views
                0 likes
                Last Post NinjaTrader_Jim  
                Working...
                X