ALGOCRUCIBLE ← Help Center
Help Center › Troubleshooting & FAQ

Trading hours: pick the session a backtest runs on

Every backtest in NinjaTrader runs on a trading-hours template: the schedule that says when a session opens and closes. For CME index futures the default template is the near-24-hour one, so a "day" starts at 6 p.m. the evening before and there is no opening bell inside it. Most strategies do not care. Some care completely: a strategy that trades the opening gap, or the first hour after the open, is looking for a session boundary that the 24-hour template does not contain. On that template it either finds nothing to trade, or it trades a phantom "first hour" at 6 p.m.

AlgoCrucible now lets you choose the template for a run, so the strategy is tested on the session it was written for.

Where the field is

Type the exact name of a NinjaTrader trading-hours template — for example CME US Index Futures RTH for regular hours only. A short list of common names is offered as you type, but any template NinjaTrader knows will do, including ones you created yourself.

Finding the exact name

Open the Strategy Analyzer, look at the Trading hours dropdown in the settings column, and copy the name as it appears there. The full list, with each template's sessions and holidays, is under Tools → Trading Hours in the NinjaTrader Control Center. Spelling matters: the app sends the name to NinjaTrader as written.

What the three states mean

Campaign rows start out filled with <Use instrument settings> and write it on every row. That is deliberate: a campaign re-points the same Analyzer window at each combination in turn, and a row on regular hours must never leak its session into the row that follows. Clear the box only if you want a row to inherit whatever the Analyzer happens to hold.

When the name is wrong

If NinjaTrader does not know the template, the run stops at the Run button and tells you which name it could not find. It does not fall back to the default and carry on, because a strategy tested on the wrong session produces confident numbers that mean nothing.

The same is true if the bridge running inside NinjaTrader is older than the app you installed: the run refuses and asks you to restart NinjaTrader so it compiles the updated bridge. The status pill at the top of the app says "restart NinjaTrader" while that is the case.

Does it change anything? Two real cases

Whether the template matters depends on how the strategy reads time.

If your strategy reads the session open or close — session start/end inputs, "first bar of the day" logic, gaps — set the template. If it keys off clock times and never holds overnight, the field is unlikely to matter, and a quick one-trial run on each template will tell you.

Related: values left behind in the grid

Choosing a template is the only thing that persists between runs. Every strategy input is set by the app at the start of each run: the values you search, the values you fix, and the strategy's own default for everything else, exactly as the strategy page shows them. Nothing left in the Analyzer's parameter grid by an earlier run, and nothing typed there, reaches a result. If the grid held a different value, the run log says which input was set back and to what. One exception is deliberate: a text value that exists only in the grid, such as a vendor license key, is never wiped silently. The run stops and asks you to give that input a fixed text on the strategy page, with the value to copy.

Next: Setup if the Analyzer is not yet connected, or Results FAQ for other reasons a run reports zero trades.

← Help CenterFAQ →

Risk Disclosure: Futures and forex trading contains substantial risk and is not for every investor. An investor could potentially lose all or more than the initial investment. Risk capital is money that can be lost without jeopardizing one's financial security or lifestyle. Only risk capital should be used for trading and only those with sufficient risk capital should consider trading. Past performance is not necessarily indicative of future results.

Hypothetical Performance Disclosure: Hypothetical performance results have many inherent limitations, some of which are described below. 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. One of the limitations of hypothetical performance results is that they are generally prepared with the benefit of hindsight. In addition, hypothetical trading does not involve financial risk, and no hypothetical trading record can completely account for the impact of financial risk of actual trading. For example, the ability to withstand losses or to adhere to a particular trading program in spite of trading losses are material points which can also adversely affect actual trading results. There are numerous other factors related to the markets in general or to the implementation of any specific trading program which cannot be fully accounted for in the preparation of hypothetical performance results and all of which can adversely affect trading results.