Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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 judysamnt7, 03-13-2023, 09:11 AM
      4 responses
      57 views
      0 likes
      Last Post DynamicTest  
      Started by ScottWalsh, Today, 06:52 PM
      4 responses
      36 views
      0 likes
      Last Post ScottWalsh  
      Started by olisav57, Today, 07:39 PM
      0 responses
      7 views
      0 likes
      Last Post olisav57  
      Started by trilliantrader, Today, 03:01 PM
      2 responses
      19 views
      0 likes
      Last Post helpwanted  
      Started by cre8able, Today, 07:24 PM
      0 responses
      9 views
      0 likes
      Last Post cre8able  
      Working...
      X