Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

last bar of entire session

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

    last bar of entire session

    Hi,

    how to recognize that it is the last bar of the entire chart in historical backtesting (real time is obvious to me) on a chart in strategy code ? For example if it is the last bar I would like to print some statistics, but only if it is the last bar so that the computer would not eat up resources without purpose making the running even slower.

    best regards
    Kittyan

    #2
    Hello Kittyan,

    You can work with CurrentBar in relation to Count to identify this.

    When CalculateOnBarClose = true:
    if (Count - 2 == CurrentBar)

    When CalculateOnbarClose = false;
    if (Count - 1 == CurrentBar)
    Ryan M.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    647 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    369 views
    1 like
    Last Post Geovanny Suaza  
    Started by Mindset, 02-09-2026, 11:44 AM
    0 responses
    108 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
    0 responses
    572 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    573 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X