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 Mindset, 04-21-2026, 06:46 AM
      0 responses
      90 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by M4ndoo, 04-20-2026, 05:21 PM
      0 responses
      135 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Started by M4ndoo, 04-19-2026, 05:54 PM
      0 responses
      68 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Started by cmoran13, 04-16-2026, 01:02 PM
      0 responses
      119 views
      0 likes
      Last Post cmoran13  
      Started by PaulMohn, 04-10-2026, 11:11 AM
      0 responses
      69 views
      0 likes
      Last Post PaulMohn  
      Working...
      X