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 charlesugo_1, 05-26-2026, 05:03 PM
    0 responses
    66 views
    0 likes
    Last Post charlesugo_1  
    Started by DannyP96, 05-18-2026, 02:38 PM
    1 response
    149 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 05-11-2026, 05:56 AM
    0 responses
    162 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 05-10-2026, 08:12 PM
    0 responses
    99 views
    0 likes
    Last Post CarlTrading  
    Started by Hwop38, 05-04-2026, 07:02 PM
    0 responses
    286 views
    0 likes
    Last Post Hwop38
    by Hwop38
     
    Working...
    X