Supported way to launch Strategy Analyzer backtests or construct an Optimizer programmatically from an AddOn?

I’m building a NinjaTrader 8 AddOn (build 8.1.6.3) that needs to run a matrix of historical Strategy Analyzer backtests across varying instruments, strategies, bar periods and parameters, unattended, and collect structured results.

I’ve read the AddOn, OnOptimize, RunIteration and BarsRequest help guide pages, and read the actual @DefaultOptimizer.cs shipped on my install. From that source, OnOptimize() only iterates Strategies[0].OptimizationParameters — it doesn’t appear to add a strategy, set an instrument, bar period, or date range; Strategies already has content by State.Configure, which looks like Strategy Analyzer populates it from its own UI before invoking the optimizer.

Two specific questions:

  1. Is there any supported way to construct an Optimizer (or otherwise launch a Strategy Analyzer backtest) from an AddOn — setting the instrument, strategy, bar period and date range programmatically — without a human manually configuring Strategy Analyzer’s UI first?

  2. I’ve seen forum references to an open feature request SFT-4391 for exposing Strategy Analyzer to NinjaScript, and a general statement that “there is no supported interface with the Strategy Analyzer for programmatic access.” Can you confirm whether that’s accurate, and whether SFT-4391 (or any other tracked request) covers this specific use case?

If there’s genuinely no supported path today, that’s a useful answer too — it tells me to stop looking for one.

Your reading is consistent with the supported surface I can find: the public docs describe Optimizer as operating within the Strategy Analyzer context, while a NinjaTrader support response says there are no supported NinjaScript methods for programmatically starting a strategy. I would not build an unattended AddOn runner against internal Analyzer types without current confirmation from support. BarsRequest can supply historical bars, but it is not a documented replacement for the Analyzer’s strategy lifecycle or reports.

So the practical split is: keep Strategy Analyzer as the manual execution boundary, or build a separate research harness and explicitly treat its results as non-equivalent until reconciled against native Analyzer runs. Since this community is no longer officially staffed, support.ninjatrader.com is the right place to confirm whether SFT-4391 covers construction and launch of backtests specifically.

With NT8 being C#, there’s a lot you can do, though that doesn’t mean NinjaTrader officially supports it. As far as I know, they haven’t supported this in the past, and I’m not aware of that changing. If you’re working with an AI agent and would consider a commercial add-on, I have something that handles this along with quite a bit more.

I’ve developed an add-on called HTAIBridge that lets an AI agent work directly with NinjaTrader Desktop. It can open charts, read indicator values, change settings, manage workspaces and templates, help build and test NinjaScript, and much much more.

With NinjaTrader running and the required historical data available, the AI can open Strategy Analyzer, set up and run backtests or parameter optimizations, then retrieve and compare the results, right down to individual trades. You can specify the strategy, instrument, bar period, dates and parameters.

More information and a video in my post here: The backtesting section starts at 56:34.

Please Be Safe in this Crazy World!
:smiling_face_with_sunglasses: