Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Reset variables at beginning/end of US Equities RTH

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

    Reset variables at beginning/end of US Equities RTH

    How do I reset the variables of a strategy at the beginning/end of these hours? When using IsNewSession, FirstBarOfSession, etc is doesn't seem to yield the desired result.

    Thanks

    #2
    Hello Lumbeezl,

    Bars.IsFirstBarOfSession will be true on the first bar update of a new session of the primary bars.

    Try the print in the help guide:
    https://ninjatrader.com/support/help...rofsession.htm


    If you are using a different trading hours template on the chart or for the data series for the script and you want to reference a different template, this is possible with custom logic that gets a trading hours object with NinjaTrader.Data.TradingHours.Get(string tradingHoursName) and checks the Sessions.


    Last edited by NinjaTrader_ChelseaB; 02-17-2019, 09:24 PM.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Originally posted by Lumbeezl View Post
      How do I reset the variables of a strategy at the beginning/end of these hours? When using IsNewSession, FirstBarOfSession, etc is doesn't seem to yield the desired result.

      Thanks
      The 'session'variables depend on the session template that you are using. Instead, use the exact times that you want to reset the variables.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by judysamnt7, 03-13-2023, 09:11 AM
      4 responses
      59 views
      0 likes
      Last Post DynamicTest  
      Started by ScottWalsh, Today, 06:52 PM
      4 responses
      36 views
      0 likes
      Last Post ScottWalsh  
      Started by olisav57, Today, 07:39 PM
      0 responses
      7 views
      0 likes
      Last Post olisav57  
      Started by trilliantrader, Today, 03:01 PM
      2 responses
      21 views
      0 likes
      Last Post helpwanted  
      Started by cre8able, Today, 07:24 PM
      0 responses
      10 views
      0 likes
      Last Post cre8able  
      Working...
      X