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 argusthome, Yesterday, 10:06 AM
      0 responses
      20 views
      0 likes
      Last Post argusthome  
      Started by NabilKhattabi, 03-06-2026, 11:18 AM
      0 responses
      18 views
      0 likes
      Last Post NabilKhattabi  
      Started by Deep42, 03-06-2026, 12:28 AM
      0 responses
      14 views
      0 likes
      Last Post Deep42
      by Deep42
       
      Started by TheRealMorford, 03-05-2026, 06:15 PM
      0 responses
      9 views
      0 likes
      Last Post TheRealMorford  
      Started by Mindset, 02-28-2026, 06:16 AM
      0 responses
      38 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Working...
      X