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 jclose, Today, 09:37 PM
      0 responses
      5 views
      0 likes
      Last Post jclose
      by jclose
       
      Started by WeyldFalcon, 08-07-2020, 06:13 AM
      10 responses
      1,414 views
      0 likes
      Last Post Traderontheroad  
      Started by firefoxforum12, Today, 08:53 PM
      0 responses
      11 views
      0 likes
      Last Post firefoxforum12  
      Started by stafe, Today, 08:34 PM
      0 responses
      11 views
      0 likes
      Last Post stafe
      by stafe
       
      Started by sastrades, 01-31-2024, 10:19 PM
      11 responses
      169 views
      0 likes
      Last Post NinjaTrader_Manfred  
      Working...
      X