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 CarlTrading, 03-31-2026, 09:41 PM
    1 response
    81 views
    1 like
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 04-01-2026, 02:41 AM
    0 responses
    42 views
    0 likes
    Last Post CarlTrading  
    Started by CaptainJack, 03-31-2026, 11:44 PM
    0 responses
    64 views
    2 likes
    Last Post CaptainJack  
    Started by CarlTrading, 03-30-2026, 11:51 AM
    0 responses
    66 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 03-30-2026, 11:48 AM
    0 responses
    54 views
    0 likes
    Last Post CarlTrading  
    Working...
    X