Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

GetNextBeginEnd()

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

    GetNextBeginEnd()

    I have a strategy and i want to add a session break to it. I want to trade us equities during RTH and I don't want the previous days bars to be used for the current days calculations (like 1 min bars) I know the code is Bars.Session.GetNextBeginEnd, or Bars.FirstBarOfSession but I don't know how to plug it in and have it work for the 9 30 to 4 00 session. I've seen similar posts but I just cant seem to properly implement it into the strategy.

    If i could get the code that would be great! (just started Ninjatrader)
    Thanks

    #2
    Welcome to our forums - you can unfortunately not set the session template to be used via the code. However from your post there's two approaches you could check into:

    a) if you want to use all data for the charting yet limit trading hours to RTH for example you could add a custom time filter into your conditions - http://www.ninjatrader.com/support/f...ead.php?t=3226

    b) if you want to limit the data used for the bars bulding itself, then just ensure to set a certain session template as you create the chart / series, for example use the US Equities RTH one that would mimic your desired hours.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by CarlTrading, 03-31-2026, 09:41 PM
    1 response
    68 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 04-01-2026, 02:41 AM
    0 responses
    38 views
    0 likes
    Last Post CarlTrading  
    Started by CaptainJack, 03-31-2026, 11:44 PM
    0 responses
    62 views
    1 like
    Last Post CaptainJack  
    Started by CarlTrading, 03-30-2026, 11:51 AM
    0 responses
    62 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 03-30-2026, 11:48 AM
    0 responses
    53 views
    0 likes
    Last Post CarlTrading  
    Working...
    X