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 CaptainJack, 05-29-2026, 05:09 AM
      0 responses
      48 views
      0 likes
      Last Post CaptainJack  
      Started by CaptainJack, 05-29-2026, 12:02 AM
      0 responses
      30 views
      0 likes
      Last Post CaptainJack  
      Started by charlesugo_1, 05-26-2026, 05:03 PM
      0 responses
      99 views
      0 likes
      Last Post charlesugo_1  
      Started by DannyP96, 05-18-2026, 02:38 PM
      1 response
      177 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 05-11-2026, 05:56 AM
      0 responses
      170 views
      0 likes
      Last Post CarlTrading  
      Working...
      X