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 TradeSaber, Today, 07:18 AM
      0 responses
      7 views
      0 likes
      Last Post TradeSaber  
      Started by PaulMohn, Today, 05:00 AM
      0 responses
      9 views
      0 likes
      Last Post PaulMohn  
      Started by ZenCortexAuCost, Today, 04:24 AM
      0 responses
      6 views
      0 likes
      Last Post ZenCortexAuCost  
      Started by ZenCortexAuCost, Today, 04:22 AM
      0 responses
      3 views
      0 likes
      Last Post ZenCortexAuCost  
      Started by SantoshXX, Today, 03:09 AM
      0 responses
      17 views
      0 likes
      Last Post SantoshXX  
      Working...
      X