Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Can We Build A Portfolio Backtester Ourselves?

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

    Can We Build A Portfolio Backtester Ourselves?

    Hi all,

    Like many others, I've been keeping track of the years-long threads, feature requests and votes for this feature. It does not appear to be a priority for the NinjaTrader team to be able to backtest multiple strategies in the strategy analyzer. We are thinking about building an add-on ourselves that accomplishes this, and displays results in a screen almost identical to Strategy Analyzer, but aggregates results of multiple strategies.

    My question is, is this something a vendor could do themselves? I've seen and heard that it is possible, but not sure. Ninjacators offer a portfolio backtester as part of their Robot Labs program. So they figured it out somehow. My main questions are

    - The idea is to build it within NinjaTrader as a custom add-on. Is this possible?
    - Do the exposed NinjaScript APIs allow us to run multiple strategies concurrently? Where we would I start if we wanted to do this ourselves?
    - I'm familiar with the performance metric APIs and it would seem that "displaying" the aggregate results

    Open to thoughts and insight from those experienced in this area, as always.

    - Jay
    jaybedreamin
    NinjaTrader Ecosystem Vendor - Zion Trading Algos

    #2
    Thanks Brandon,

    I'm aware of the existing feature request. I guess I was more curious to know if that possible given the current APIs and exposed methods. I've been thinking about it deeper and here's what I think is possible, but I'm not sure. Basically, I'm wondering if I can make a master strategy that combines the logic of subclass strategies, thereby making it able to process the entry logic of multiple systems within 1 strategy class.

    - Create a Strategy, call it PortfolioAnalyzer
    - Every other strategy in the "portfolio" that you want to run will be of type PortfolioStrategyBase
    - PortfolioStrategyBase has base functions that all child strategies must implement, like

    setEntryCondition(bool)

    setExitCondition(bool)

    setParameters()

    setDataSeries()

    setInstrument()
    as well as corresponding getter methods

    - PortfolioAnalyzer will simply call these above functions on each instance of
    ​PortfolioStrategyBase in OnBarUpdate(), and add the necessary data series for each strategy.

    The only issue I'm having with this approach is that there is no way that I know of to get the full list of all available strategies NinjaTrader. How can I do this? I want to be able to check if a strategy is of a certain base class, and then call the appropriate function in C#. But it seems like NinjaTrader doesn't expose this. Account.Strategies returns an empty list, and I'm guessing that's because of the reason you listed in your response?
    jaybedreamin
    NinjaTrader Ecosystem Vendor - Zion Trading Algos

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by NullPointStrategies, Yesterday, 05:17 AM
    0 responses
    55 views
    0 likes
    Last Post NullPointStrategies  
    Started by argusthome, 03-08-2026, 10:06 AM
    0 responses
    132 views
    0 likes
    Last Post argusthome  
    Started by NabilKhattabi, 03-06-2026, 11:18 AM
    0 responses
    73 views
    0 likes
    Last Post NabilKhattabi  
    Started by Deep42, 03-06-2026, 12:28 AM
    0 responses
    45 views
    0 likes
    Last Post Deep42
    by Deep42
     
    Started by TheRealMorford, 03-05-2026, 06:15 PM
    0 responses
    49 views
    0 likes
    Last Post TheRealMorford  
    Working...
    X