Compare timeframes: which bars suit this strategy?
An optimization searches your strategy's settings on one kind of bar — 5-minute, say. It never asks whether the strategy would have been better on 15-minute or 60-minute bars, because the bar period is not one of the strategy's settings: NinjaTrader loads one series of bars for a whole Strategy Analyzer run, and every trial in that run is tested on those bars.
So the question "which timeframe suits this strategy?" used to mean running the same optimization three or four times by hand and comparing the result pages by eye. Compare timeframes does that for you and puts the answers side by side.
NinjaTrader 8 only. On MultiCharts the chart defines the bars, so you run each chart's optimization separately.
How to run one
- Open the strategy and set up the Optimize stage exactly as you would for a single run: which settings to search and over what ranges, the number of trials, the minimums, the date range and the instrument.
- Press Compare timeframes…, next to Run Optimize. A panel opens with the bars from your form on the first line and a few neighbours below it (5, 10, 15 and 30 minutes, for example).
- Change them to the timeframes you want to see. Each line is a bar type and a value; + timeframe adds a line and × removes one. Anything NinjaTrader offers can go in the list, including range, tick, volume and third-party bar types. Two timeframes is the minimum, six the maximum.
- Press Run on these timeframes.
The app then runs the same optimization once per timeframe, one after another: the same ranges, the same number of trials, the same minimums, the same dates and instrument, and the same weeks held back at the end of the range. Only the bars change. It sets the bars in the Strategy Analyzer and starts each run itself, so keep a Strategy Analyzer window open and leave it alone until the comparison has finished.
Each timeframe costs a full optimization. Four timeframes take about four times as long as one.
Reading the comparison page
The page fills in as the runs finish. There is one row per timeframe:
| Column | What it tells you |
|---|---|
| Settings tried | How many settings that run tested. |
| Ranked | How many of them cleared your minimums (enough trades, and the win rate and drawdown limits if you set them). Only ranked settings can be "best". |
| Profitable | How many ended the period with a profit after costs — ranked or not — and what share of the settings that is. |
| Typical trades | The trade count of the middle setting. It shows how often the strategy trades on those bars. |
| Best: trades, net, PF, win %, max DD | The top-ranked setting of that run. |
| Took | How long that run lasted. |
| Run | A link to the run itself. |
Every run in a comparison is an ordinary optimization run. Open it and you get the full result page: the leaderboard, the review of any row, and the buttons that continue to walk-forward and audit. Its page says which comparison it belongs to, so you can find your way back.
Stop the comparison stops the run in progress and skips the ones still waiting. The timeframes that had already finished are kept.
When a row says "refused"
A timeframe can be turned away before it starts, and the row then shows the reason. The usual one is a bar type built from tick data (range, renko, tick, volume and most third-party bars) on a date range that NinjaTrader's tick history does not cover. The other timeframes still run.
When a row finished but nothing is ranked
Every setting was tested, and none cleared your minimums. That is not the same as "this timeframe does not work". Slow bars trade rarely: a strategy that makes 270 trades on 5-minute bars may make 20 on 60-minute bars over the same months, and a 20-trade minimum then turns away almost everything. Open that run — its page says which minimum turned the settings away and how close the nearest one came.
What the table can tell you, and what it cannot
Look at the share of profitable settings before you look at the best row. The best row is one setting. The share is the whole neighbourhood. A timeframe where 60 % of the settings made money is telling you something about the strategy on those bars; a timeframe where one setting in a hundred made money is telling you that one setting got lucky.
Look at the typical trade count. A best row that rests on 25 trades can show any profit factor you like. If the slow timeframes interest you, give them a longer date range before you read their numbers — the page flags a best row with fewer than 40 trades.
Remember that picking a timeframe is a search too. Compare four timeframes and take the best one, and you have chosen from four looks at the same months. The winner is flattered by that choice in exactly the way the best setting of an optimization is flattered. That is why the page calls itself a screen and not a test.
So the comparison answers one question — which bars are worth taking forward? — and the answer still has to earn its place. Take the timeframe you prefer through Walk-forward and Audit like any other optimization result, on its own, before you trust it.
Compare timeframes or a campaign?
Both can put several timeframes side by side. They are for different moments.
| Compare timeframes | Campaign | |
|---|---|---|
| What runs on each timeframe | One optimization | The whole chain: walk-forward, audit, perturbation |
| How long | Minutes to an hour or two | Overnight |
| What you get | A first look: where does this strategy trade, and does anything make money there? | A verdict per timeframe, the survivors, and one holdout test the choice never saw |
| Plan | Every plan | Studio |
Use the comparison to decide which two or three timeframes deserve a night's work, then let a campaign judge those.
The one-line version
Same optimization, several timeframes, side by side — a quick way to see which bars are worth testing properly, not a test in itself.