Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How to know the number of iterations a backtest has/will run

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

    How to know the number of iterations a backtest has/will run

    Hi all.

    I'm looking for a way to determine programmically in a Strategy how many times it has/will run in a Backtest against multiple instruments. For example, if I run a strategy against MSFT, GOOG, and AMZN, then I want to know either the number of instruments that are in a backtest run, or some sort of notice when the backtest has run against the last instrument in the instrument list.

    There are a couple ways I think this could be done:

    1. Determine if the Strategy is being run against an Instrument List (More than 1 instrument) and find out how many instruments are in the Instrument List.
    2. Is if there is some object (StrategyCollection for example) that would have a count of the number of times a Strategy has been run in a backtest. This must be stored somewhere as the StrategyAnalyzer window has a "Combined Results" row after a Strategy backtest has run against an instrument list, and this would require knowledge of the number of instruments it was run against.

    Any ideas? I know this isn't supported by NinjaTrader, but I would appreciate any advice to lead me in the right direction.

    #2
    Hello tickleboy,

    Thank you for your post.

    I would not know of any means to achieve this in code. You could add the list in the strategy alone, but may not be the best idea if the list is quite large.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    563 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    329 views
    1 like
    Last Post Geovanny Suaza  
    Started by Mindset, 02-09-2026, 11:44 AM
    0 responses
    101 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
    0 responses
    547 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    548 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X