Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Number of bars over more than one session

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

    Number of bars over more than one session

    Hi everyone

    Bars.BarsSinceSession will give you the number of bars since the beginning of this session.

    Is there any way I can find the number of bars since the beginning of the previous session, or indeed the beginning of 'n sessions ago'?

    Much obliged in advance for any help.

    #2
    Hello arbuthnot,

    Thank you for your post.

    There is no direct function or method to call to pull the number of bars in the previous session. You can however use the GetNextBeginEnd to pull the beginning and ending of a session and use CurrentBar to store the value of the CurrentBar on Session Start and then subtract that from the CurrentBar at the Session End to have the number of bars per session.

    For information on GetNextBeginEnd please visit the following link: http://www.ninjatrader.com/support/h...xtbeginend.htm
    For information on CurrentBar please visit the following link: http://www.ninjatrader.com/support/h...currentbar.htm

    Comment


      #3
      Thanks very much, Patrick.

      It looks fairly complex but I'll try my best!

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by CaptainJack, 05-29-2026, 05:09 AM
      0 responses
      475 views
      0 likes
      Last Post CaptainJack  
      Started by CaptainJack, 05-29-2026, 12:02 AM
      0 responses
      315 views
      0 likes
      Last Post CaptainJack  
      Started by charlesugo_1, 05-26-2026, 05:03 PM
      0 responses
      253 views
      1 like
      Last Post charlesugo_1  
      Started by DannyP96, 05-18-2026, 02:38 PM
      1 response
      340 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 05-11-2026, 05:56 AM
      0 responses
      305 views
      0 likes
      Last Post CarlTrading  
      Working...
      X