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 NullPointStrategies, Yesterday, 05:17 AM
      0 responses
      56 views
      0 likes
      Last Post NullPointStrategies  
      Started by argusthome, 03-08-2026, 10:06 AM
      0 responses
      132 views
      0 likes
      Last Post argusthome  
      Started by NabilKhattabi, 03-06-2026, 11:18 AM
      0 responses
      73 views
      0 likes
      Last Post NabilKhattabi  
      Started by Deep42, 03-06-2026, 12:28 AM
      0 responses
      45 views
      0 likes
      Last Post Deep42
      by Deep42
       
      Started by TheRealMorford, 03-05-2026, 06:15 PM
      0 responses
      49 views
      0 likes
      Last Post TheRealMorford  
      Working...
      X