How to Backtest Strategies Correctly in NinjaTrader
Education

How to Backtest Strategies Correctly in NinjaTrader

Cameron Bennion
·
November 20, 2025
·
8 min read

Backtesting is the backbone of confidence. If you don't know that your strategy has worked in the past, you won't have the conviction to stick with it during a drawdown in the future. Without that conviction, you'll turn off the bot after three losing days — exactly when it's about to recover. But most traders backtest wrong, and the result is false confidence that leads to real losses.

This guide covers how to backtest correctly in NinjaTrader 8's Strategy Analyzer — the right data, the right metrics, and the red flags that tell you a strategy is fooling you.

Step 1: Get the Right Data

NinjaTrader's Strategy Analyzer can use minute bars, daily bars, or tick data. For day trading strategies, always use minute bars at minimum, preferably tick data for precision. Here's why it matters:

  • Minute bars: Fast to process, good for strategies with wide stops (5+ points on ES). The bar's open/high/low/close is accurate, but the order of fills within the bar is assumed, not recorded.
  • Tick data: Shows every individual trade that occurred. More accurate fill simulation, especially for tight-stop strategies. Takes longer to process but is worth it for anything where a 1-2 tick difference in fill price changes the outcome.

For NinjaTrader tick data, you can download from your broker's data feed (Rithmic or CQG provide historical tick data). You'll want at least 2-3 years of data to test across different market regimes — trending bull markets, grinding ranges, and volatile crash events.

One important detail: use continuous contract data (the "@ES" symbol in NT8, not "ES 06-25" or any specific month). Continuous contracts splice together individual expiration months so you can test across years without gaps.

Step 2: Run Your Initial Backtest

Trade This Systematically

Stop reading. Start executing.

Join 500+ traders using YMI's automated bots, daily KPLs, and AI trade plans — no guesswork required.

In NinjaTrader 8, open the Strategy Analyzer from the Tools menu. Select your strategy, set your date range, instrument, and data series. Before running, configure these critical parameters:

  • Starting capital: Use your actual account size. The position sizing relative to account equity affects whether you can even take trades (insufficient margin), so this needs to be realistic.
  • Commission: NinjaTrader defaults to $0. Change this to your actual commission. For Apex accounts using Rithmic, expect ~$4-5 round-turn per contract. For your own live account, use whatever your broker charges.
  • Slippage: Add 1 tick of slippage for liquid markets (ES, NQ) during normal hours. Add 2-3 ticks for less liquid times (pre-market, overnight) or for strategies that use market orders.

Without commissions and slippage, a breakeven strategy looks profitable. A marginal strategy looks great. Always include these costs before you evaluate a single number.

Step 3: Read the Right Metrics

The default NT8 report shows dozens of numbers. Here are the ones that actually matter and what they tell you:

  • Profit Factor: Total gross profit ÷ total gross loss. The single most important summary metric. Below 1.0 means the strategy loses money. 1.0-1.3 is marginal. 1.3-1.6 is solid. Above 1.6 could be genuine edge — or curve fitting. Anything above 2.5 is almost always curve fitting.
  • Win Rate: Percentage of trades that close positive. Don't chase high win rates. A 45% win rate with a 3:1 reward-to-risk is more robust than a 75% win rate with a 1:1. Look at win rate in combination with average win vs. average loss.
  • Expectancy: (Win Rate × Average Win) - (Loss Rate × Average Loss). This is your expected profit per trade in dollar terms. If expectancy is positive, the strategy makes money on average. If it's negative, win rate and profit factor won't save you long-term.
  • Max Drawdown: The largest peak-to-trough equity decline in the test period. This is the number that tells you if you could survive trading this strategy. If max drawdown is $10,000 and your account is $12,000, you would have quit (or been margin-called) before you saw the recovery.
  • Max Consecutive Losers: How many losing trades in a row did the strategy have? A strategy with 10 consecutive losses — even if it's profitable overall — will cause most traders to shut it down out of fear. Know this number before you go live.
  • Sharpe Ratio: Risk-adjusted return. Above 1.0 is acceptable. Above 1.5 is good. Below 0.5 means the volatility of returns is too high relative to the average return — you'll experience large swings that are psychologically difficult to endure.

The Trap of Curve Fitting

Curve fitting (also called over-optimization) happens when you tweak strategy parameters so precisely that they produce excellent results on historical data, but fail completely on new data. You didn't discover an edge — you memorized noise.

Here's how it happens: NinjaTrader's optimizer can test hundreds of parameter combinations in minutes. If you run an optimization over 5 years of ES data and find that a 17-period RSI, a 42-tick stop, and a 3.7:1 reward/risk ratio produces the best results, you've likely found a coincidence — not a pattern. Those exact numbers won't work next year because the market didn't actually behave that way for a structural reason.

Red flags for curve fitting:

  • The strategy has very few trades (under 100 total). With small samples, any parameter set can look good by chance.
  • The optimal parameters are oddly specific (7.3x ATR multiplier, 23-period lookback). Real edges tend to be robust across a range of nearby values.
  • Performance is dramatically better in one sub-period of the test range and mediocre in others.
  • Adding one day of new data significantly changes the "optimal" parameters.

The Golden Rules of Backtesting

  1. Out-of-Sample Testing: Split your data into two chunks. Optimize your strategy on the first 70% of your data (the "in-sample" period). Then run those exact same, locked settings on the remaining 30% (the "out-of-sample" period) without touching anything. If performance holds up on data the strategy never "saw" during optimization, you have real evidence of an edge. If out-of-sample performance collapses, you have curve fitting.
  2. Walk-Forward Analysis: More rigorous than a single train/test split. NinjaTrader has a built-in Walk-Forward Optimizer. It repeatedly optimizes on a rolling window, then tests on the next window. This simulates how a strategy would actually perform as the market evolves. A strategy that survives walk-forward testing has demonstrated adaptability, not just historical memorization.
  3. Include Commissions and Slippage: Mandatory, not optional. A strategy that makes $10 per trade gross becomes a losing strategy after $5 commissions and 1 tick ($12.50 on ES) of slippage. That's $17.50 in costs against a $10 profit. Always stress-test with realistic numbers.
  4. Test Across Different Market Conditions: A strategy that was "optimized" on 2023-2024 saw a specific bull market environment. Test it on 2022 (brutal bear market and high volatility), 2020 (COVID crash), and 2018 (Q4 selloff). If it falls apart in any of these periods, it's not robust — it's regime-dependent. Regime-dependent strategies require regime filters to avoid deploying in bad conditions.
  5. Look at Max Drawdown, Not Just Net Profit: A strategy that makes $100k/year with a $50k max drawdown will never survive live trading. Real traders experience those drawdowns in real-time, in real money, with real psychological pressure to quit. Could you survive watching $50k disappear before the recovery? If the answer is no, the strategy's net profit means nothing.

YMI's Backtesting Process

Before any strategy or bot template is released to members, it goes through our full validation process:

  1. Initial development on in-sample data (2022-2023)
  2. Out-of-sample verification on 2024
  3. Walk-forward optimization across the full 2020-2024 period
  4. Regime-specific analysis: separate results for trending vs. ranging environments
  5. Monte Carlo simulation: 1,000+ randomized trade order permutations to stress-test the equity curve
  6. Forward testing on a paper account for 30-60 days before member release

We spend hundreds of hours stress-testing the Marty Bot and KPL Bot across different market conditions and regimes before releasing them. We do the heavy lifting so you can trade with the kind of evidence-based confidence that actually keeps you in the trade when it draws down temporarily.

Skip the testing — trade pre-validated strategies:

  • Marty Bot Specs — full backtest results, parameters, and 2025 performance data
  • KPL Bot Specs — verified performance across 2024–2025 with commission/slippage included
  • Pro Trader Membership — get the bots and templates ready to deploy, with onboarding support

About the Author

Cameron Bennion

Founder, Young Money Investments · Quant Trader

Cameron has 18+ years of live market experience trading ES, NQ, and futures. He founded Young Money Investments to teach systematic, data-driven trading to everyday traders — the same quantitative methods used at his hedge fund, Magnum Opus Capital. His members have collectively earned $50M+ in prop firm funded accounts.

18+ Years Trading ExperienceHedge Fund Manager — Magnum Opus Capital$50M+ Funded for MembersNinjaTrader SpecialistFutures: ES · NQ · RTY · CL · GC
Trade with Cameron's systems:7-Day Free Trial →

Free — No Credit Card

Get Daily KPLs in Your Inbox

AI-generated Key Price Levels for ES & NQ, delivered every trading morning. Join 500+ traders who start their session with a plan.

🔒 Your information is secure. We respect your privacy and will never spam you.

Risk Disclosure & Disclaimer

Educational Purposes Only: The content provided in this blog is for educational and informational purposes only. It does not constitute financial, investment, or trading advice. Young Money Investments is not a registered investment advisor, broker-dealer, or financial analyst.

Risk Warning: Trading futures, forex, stocks, and cryptocurrencies involves a substantial risk of loss and is not suitable for every investor. The valuation of futures, stocks, and options may fluctuate, and as a result, clients may lose more than their original investment.

CFTC Rule 4.41 - Hypothetical or Simulated Performance Results: Certain results (including backtests mentioned in these articles) are hypothetical. Hypothetical performance results have many inherent limitations. No representation is being made that any account will or is likely to achieve profits or losses similar to those shown. In fact, there are frequently sharp differences between hypothetical performance results and the actual results subsequently achieved by any particular trading program.

Testimonials: Testimonials appearing on this website may not be representative of other clients or customers and is not a guarantee of future performance or success.

Ready to Apply These Strategies?

Join 500+ traders using YMI's automated bots, daily KPLs, and AI trade plans to trade systematically.

Intro Trader includes a 7-day free trial • 30-day money-back guarantee on all tiers