Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Last bar of prior session

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

    Last bar of prior session

    Hi,,
    im using 30 second bars updating on bar close. I’d like to grab an indicator value from the close of the last day session to compare with that value on first bar of current session.

    I figured out first bar for today but how do I specify IsLastBarOfSession
    For yesterday

    hope that’s clear enough. Thanks!
    rr

    #2
    Hello RedRock,

    There is no IsLastBarOfSession but there is a IsFirstBarOfSession property. https://ninjatrader.com/support/help...ghtsub=isfirst

    If the current close [0] is the first bar of the session then the [1] bars ago close would be the last bar of the previous session.

    To get an indicator value, its last value from the previous session you would use

    Code:
    if (Bars.IsFirstBarOfSession)
    ​{
       double lastSessionValue = EMA(12)[1]; 
    }

    Comment


      #3
      Hi Jesse. I was heading down that road but then noticed this from another post sooo.maybe it’s obsolete?
      Thanks

      Comment

      Latest Posts

      Collapse

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