A backtest that ignores costs, uses thin data and was tuned on the same period it's judged on will look great and teach you nothing. The Strategy Analyzer in NinjaTrader 8 can run honest tests, but its defaults don't force them. This guide covers the workflow and the traps, in the order you'll hit them. For exact menu labels and current features, the official NinjaTrader 8 help guide is the authority. Labels can shift between versions.
The setup
From the Control Center, open the Strategy Analyzer from the New menu. Then:
- Pick a strategy. Use a built-in sample to learn the interface before testing your own NinjaScript.
- Choose the instrument and contract. For a multi-year ES or NQ test, decide how you'll handle expirations (see the data section).
- Set the date range. Fix it before you look at any results, and decide your in-sample and out-of-sample split now.
- Choose the data series type. One-minute bars are fine for many intraday ideas. If your logic depends on what happens inside a bar, such as stop and target in the same bar, you need tick data and a finer order fill resolution, which is slower and needs the tick history downloaded.
- Enter commission and slippage from your own broker and expectations rather than the defaults. Look up your actual round-turn cost, and assume at least one tick of slippage on market and stop orders for a liquid contract. One ES tick is $12.50, so one tick each way is $25 per round turn per contract before commissions. A test with zero costs can't be replicated live.
Data quality comes first
Your next step
Review the setup before you automate it.
Read the NinjaTrader setup and strategy limits, then test in SIM. YMI bot access belongs to Pro. Check your broker or prop firm's rules before enabling automation.
The amount and quality of history depends on your data provider and subscription, so check what you actually have before trusting a test. Look for gaps, missing sessions and bad prints in the Historical Data window, and compare a few known days against another source.
Quarterly contracts need a plan. A continuous series stitches contracts together using a merge policy, and back-adjusted prices shift historical levels, which can distort any strategy that uses absolute prices or round numbers. For futures research I use the front-month contract and treat a suspiciously short window as a sign of a broken rollover merge. Also don't assume session times or roll dates are the same for every product; CME Globex equity index futures run nearly around the clock with a daily break, but check the CME product and holiday schedule for exact hours.
How much history is enough? There's no magic number. Cover different conditions, such as trending stretches, quiet ranges and volatility shocks, and expect a strategy to look different across them. A few months of friendly conditions tells you very little.
In-sample and out-of-sample
In-sample data is where you develop and optimize. Out-of-sample data is a later period you set aside and never use to choose parameters. Procedure:
- Reserve the most recent portion of history as out-of-sample before any optimization.
- Optimize only on the in-sample period.
- Run the chosen settings once on out-of-sample data and compare.
- If you then change the strategy because of the out-of-sample result, that data is no longer clean.
Some drop from in-sample to out-of-sample is normal. A collapse suggests curve fitting. A good out-of-sample result still isn't proof of future edge.
The optimizer's trap
The optimizer tests many parameter combinations and ranks them on a fitness measure. Test enough combinations and some will look good by chance, even on random data. You're seeing the winner of a large tournament.
Two checks help. First, look at neighbors: if a 14-period setting makes money but 13 and 15 don't, you probably found noise. A real effect tends to hold across a range of nearby settings. Second, try walk-forward testing, which optimizes on one window, tests on the next, then rolls forward. It simulates re-tuning over time better than one split, though it can still be overfit if you keep redesigning the strategy until the walk-forward looks good.
Reading the results
Don't judge by net profit alone. Look at these together:
- Net profit after costs. Meaningless without the next items.
- Profit factor. Gross profit divided by gross loss. It's a ratio, not a verdict. Compare it before and after realistic costs.
- Maximum drawdown. The worst peak-to-trough fall. If you wouldn't keep trading through it, the strategy isn't usable for you.
- Trade count. Thirty trades isn't a statistically proven edge, and a large count won't fix a flawed test. More trades just narrow the uncertainty.
- Win rate with average win and loss. A 40% win rate with larger winners can beat a 70% win rate with small ones. Neither number alone settles it.
To review live or simulated trades afterwards, use the Trade Performance report in NinjaTrader 8, not the old Account Performance tab.
What the simulation can't tell you
A backtest fill is a model. Touching a limit price in historical data doesn't mean your order would have filled, because queue position matters and the Strategy Analyzer has settings that control whether limit orders fill on touch or need trade-through. Use the stricter assumption when you're unsure. Simulated fills also assume your size doesn't move the market, which stops being reasonable as size grows. A simulated fill is not exchange queue or slippage validation, and SIM doesn't recreate live fills or psychology.
Before going live
Record a run manifest for every test: the strategy version, parameters, instrument and contract handling, data source and date range, split method, costs and fill settings. If you can't reproduce a result, don't use it. Start small, compare live execution to what the test assumed, and write down in advance which divergences would make you pause the strategy. If you want to see how a published bot's rules are specified before comparing it to anything, the KPL bot specs and Marty bot specs describe its current behavior.
About the Author
Founder, Young Money Investments · Quant Trader
Cameron trades ES, NQ, and futures across multiple market cycles. He founded Young Money Investments to teach systematic, data-driven trading and manages Magnum Opus Capital. His work emphasizes documented rules, risk controls, and review over outcome promises.
Free, No Credit Card
Get the Free Room Preview
See how the room works before choosing a membership. Follow a setup in SIM and review what happened.
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.

