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 Belfortbucks, Today, 09:29 PM
      0 responses
      6 views
      0 likes
      Last Post Belfortbucks  
      Started by zstheorist, Today, 07:52 PM
      0 responses
      7 views
      0 likes
      Last Post zstheorist  
      Started by pmachiraju, 11-01-2023, 04:46 AM
      8 responses
      151 views
      0 likes
      Last Post rehmans
      by rehmans
       
      Started by mattbsea, Today, 05:44 PM
      0 responses
      6 views
      0 likes
      Last Post mattbsea  
      Started by RideMe, 04-07-2024, 04:54 PM
      6 responses
      33 views
      0 likes
      Last Post RideMe
      by RideMe
       
      Working...
      X