Explainer
NinjaTrader backtesting
NinjaTrader backtests NinjaScript strategies in its Strategy Analyzer, with optimization, walk forward and Monte Carlo options, on data you load.
Updated
How it runs
NinjaTrader’s backtesting lives in the Strategy Analyzer. You open it from the New menu in the Control Center. It runs historical analysis on automated strategies written in NinjaScript.
You pick a strategy, choose a backtest type, and run it over historical data. For a walk-forward run, “Walk Forward Optimization” is one of the backtest types. Facts here were read from NinjaTrader’s help guide in October 2026, so check the vendor for anything current.
- Strategy Analyzer
- The NinjaTrader tool that backtests and optimizes strategies.
- NinjaScript
- The code language NinjaTrader strategies are written in.
- Walk forward optimization
- Tuning settings on one window of history and testing them on the window after it, then sliding forward.
- Basket testing
- Testing a strategy on several instruments in one run.
What it can do
The help guide lists these functions under the Strategy Analyzer:
- Backtest a strategy.
- Optimize a strategy.
- Walk forward optimize a strategy.
- Multi-objective optimization.
- Basket testing of multiple instruments.
- Monte Carlo simulation.
- Reviewing performance results and understanding backtest logs.
What it needs
The walk-forward guide lists what a user needs: access to historical data, a custom NinjaScript strategy, and a good understanding of the Strategy Analyzer. Sample strategies come installed with NinjaTrader.
So there are three jobs before the first run. Write the rules as code. Load data that covers the markets and years you want. Decide the costs and check how the tool applies them.
NinjaTrader’s pricing page says strategy backtesting is free to use, with no time limit and no funding required.
Limits to know about
The tool tests coded strategies, so ambiguity in your rules turns into a coding decision. If a rule can be read two ways, the code picks one without telling you.
NinjaTrader’s help guide has pages on how historical fills are processed and on differences between real-time and backtest results. Read both. Every backtest tool has fill rules, and a number means little until you know them.
Optimization also deserves care. Running many settings and keeping whichever one looks most favourable fits the settings to the history. Walk-forward testing and held-back data exist to check for that.
Every backtest tool has fill rules. Read how yours handles historical fills before you trust a number.
Questions to ask of any tool
Which bar size does it test on? What happens when a stop and a target sit inside the same bar? How does it handle a contract roll? Does it include commission and slippage? Can you see every trade?
Our explainers on same-bar fills, data and costs go through why each matters.
Where a done-for-you service fits
We are the alternative to writing the code. You describe the rules in plain language, and we run them on CME futures data and return every trade with the assumptions used. A version is $19.
Questions and answers
How do I backtest in NinjaTrader?
Open the Strategy Analyzer from the New menu in the Control Center, choose a NinjaScript strategy and a backtest type, and run it over historical data.
What does the Strategy Analyzer do?
It runs historical analysis on NinjaScript-based strategies: backtests, optimization, walk forward optimization, multi-objective optimization, basket testing and Monte Carlo simulation.
What do I need to run a walk-forward test in NinjaTrader?
Access to historical data, a custom NinjaScript strategy, and a good understanding of the Strategy Analyzer, according to NinjaTrader’s guide.
Is NinjaTrader backtesting free?
NinjaTrader’s pricing page says strategy backtesting is always free to use, with no time limit and no funding required. Check the vendor for current terms.