Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

SessionTemplate

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

    SessionTemplate

    I am converting code from 7 to 8.

    Here is a line that I don't know how to get the converted code :


    if( (Instrument.MasterInstrument.Name == "ES" && Instrument.MasterInstrument.SessionTemplate == "CME US Index Futures RTH") || (Instrument.MasterInstrument.Name == "CL"&& Instrument.MasterInstrument.SessionTemplate == "Nymex Energy RTH") )

    The problem is with : Instrument.MasterInstrument.SessionTemplate

    Can someone help me out on this.

    Thanks
    Last edited by blar58; 11-07-2015, 11:14 AM.

    #2
    Hello blar58,

    Thank you for your inquiry.

    You would want to use "Bars.TradingHours.Name".

    Please take a look at this link in the NinjaTrader help guide for further information on utilizing this: http://ninjatrader.com/support/helpG...hours_name.htm

    Example:
    Code:
    if (Bars.TradingHours.Name == "CME US Index Futures RTH")
         // do stuff
    Please, let us know if we may be of further assistance.
    Zachary G.NinjaTrader Customer Service

    Comment


      #3
      Thank you very much ZacharyG

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Geovanny Suaza, 02-11-2026, 06:32 PM
      0 responses
      673 views
      0 likes
      Last Post Geovanny Suaza  
      Started by Geovanny Suaza, 02-11-2026, 05:51 PM
      0 responses
      379 views
      1 like
      Last Post Geovanny Suaza  
      Started by Mindset, 02-09-2026, 11:44 AM
      0 responses
      111 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by Geovanny Suaza, 02-02-2026, 12:30 PM
      0 responses
      577 views
      1 like
      Last Post Geovanny Suaza  
      Started by RFrosty, 01-28-2026, 06:49 PM
      0 responses
      582 views
      1 like
      Last Post RFrosty
      by RFrosty
       
      Working...
      X