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 argusthome, 03-08-2026, 10:06 AM
    0 responses
    88 views
    0 likes
    Last Post argusthome  
    Started by NabilKhattabi, 03-06-2026, 11:18 AM
    0 responses
    48 views
    0 likes
    Last Post NabilKhattabi  
    Started by Deep42, 03-06-2026, 12:28 AM
    0 responses
    31 views
    0 likes
    Last Post Deep42
    by Deep42
     
    Started by TheRealMorford, 03-05-2026, 06:15 PM
    0 responses
    34 views
    0 likes
    Last Post TheRealMorford  
    Started by Mindset, 02-28-2026, 06:16 AM
    0 responses
    69 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Working...
    X