NinjaTrader 8 Trading Hours Templates: RTH vs ETH for Automated Strategies

Two traders run the same NinjaTrader 8 strategy on the same NQ chart, with the same settings, over the same three months. One backtest shows a smooth equity curve. The other shows a different trade count, different entries and a worse drawdown. Nobody changed the code. One of them changed a single dropdown: the Trading Hours template.

Trading Hours templates are one of the least glamorous settings in NinjaTrader 8, and one of the most important for an automated strategy. They decide which bars your strategy sees, where each trading day starts and ends, which holidays get skipped, and when the platform's own exit on session close fires. This guide explains how templates work, what changes when you pick RTH instead of ETH, and how to set them up so your backtest, your live strategy and your prop firm's rules all agree on what "the session" means.

What a Trading Hours Template Actually Is

NinjaTrader's Help Guide describes Trading Hours templates as containers for the session start and end times of a specific market or instrument. NinjaTrader ships with predefined templates for the most common instruments, and you can view, copy and edit them from the Control Center under Tools > Trading Hours.

Each template holds four kinds of information:

According to the Help Guide, you can apply a template in four places: the chart's Data Series window, the Market Analyzer, the Strategy Analyzer when you set up a backtest, and the Strategies tab of the Control Center when you start a live strategy. That last pair is the one to remember. Your backtest and your live strategy each have their own Trading Hours setting, and nothing forces them to match.

RTH vs ETH for Index Futures: What NinjaTrader Ships

For CME US equity index futures, the market NQ and ES traders live in, NinjaTrader includes two templates: CME US Index Futures ETH (electronic trading hours) and CME US Index Futures RTH (regular trading hours). We opened both template files in a current NinjaTrader 8 install to see exactly what they contain. Here is how they compare.

Setting CME US Index Futures ETH CME US Index Futures RTH
Template time zone Central Central
Session times 17:00 the prior day to 16:00 8:30 to 16:00
Sessions per week 5 (Sunday evening through Friday afternoon) 5 (Monday through Friday)
First bar of each session The evening open, around 17:00 Central The 8:30 Central open (9:30 Eastern)
Overnight bars Included Excluded
Holidays and early closes Included Included

NinjaTrader updates these templates over time, so open Tools > Trading Hours in your own install and confirm what yours says before you rely on any of the times above. The point of the table is the shape of the difference, not the exact minutes.

Notice that both templates end at the same time. The difference is where the day starts. On ETH, a trading day begins the evening before. On RTH, it begins at the cash open. That one difference ripples through almost everything your strategy calculates.

How the Template Changes Your Strategy's Logic

Indicators only see the bars the template loads

A strategy running on the RTH template never receives the overnight bars. Every indicator it uses is calculated only on regular-session data. A 20-period EMA on 5-minute RTH bars at 9:35 Eastern includes bars from the previous afternoon. The same EMA on ETH bars includes the overnight session, which can be a very different market.

Neither is wrong. They are different inputs, so they produce different signals. The mistake is building a strategy on one template and running it live on the other. If your backtest used RTH and the strategy goes live with the instrument's default ETH template, your indicators are reading different data than the ones you tested.

"First bar of the session" moves

Opening range and gap strategies often anchor on the first bar of the session. In NinjaScript, the usual check is Bars.IsFirstBarOfSession, which the Help Guide says returns true when the bar is the first one processed in a trading session.

On the RTH template, that is the 9:30 Eastern bar. On ETH, it is the evening open the day before. An opening range breakout coded against IsFirstBarOfSession and run on ETH will build its range from the overnight open, not the cash open, and trade a completely different setup than the one you designed. The code compiles, it runs, and it is quietly wrong.

Two more details from the Help Guide are worth knowing. IsFirstBarOfSession always returns true on the very first bar processed (when CurrentBar is 0), even if that bar sits in the middle of a session. And if you load a fixed number of bars instead of a date range, the first bar loaded can land mid-session too. Loading by days or by a custom date range lines the first processed bar up with the template's session start.

Holidays and early closes

Templates are also your holiday calendar. The Help Guide is direct about it:

"NinjaTrader will exclude trading holidays that are defined in the Trading Hour Template." (NinjaTrader 8 Help Guide, Using the Trading Hours Window)

The CME US Index Futures templates in our install list full-day holidays such as Christmas, New Year's Day and Good Friday, plus partial holidays with early closes around midday Central. The Help Guide describes the holiday types you can define:

Early closes matter for automation. If your strategy assumes the session always ends at the normal time, it may hold a position into a close that came hours early. A template with the early close defined lets NinjaTrader's session logic see that shorter day.

Exit on Session Close Runs Off the Template

Most traders meet the Trading Hours template through IsExitOnSessionCloseStrategy, the "Exit on session close" setting. According to the Help Guide, it cancels all strategy-generated orders and closes all open strategy positions at the close of the session. Here is what the documentation says about how it behaves:

Set it in code inside OnStateChange() during State.SetDefaults or State.Configure, which is the only place the Help Guide says it should be set:

if (State == State.SetDefaults)
{
    IsExitOnSessionCloseStrategy = true;
    ExitOnSessionCloseSeconds    = 30;
}

The key word in all of this is "session." The exit fires at the end of the session in your template, not at the end of your prop firm's trading window. If your firm wants you flat earlier than your template's session end, exit on session close will not get you there in time. That job belongs to your own time-based flatten in the strategy code.

Your firm's cutoff and your template's close are two different clocks

Suppose your prop firm requires every position to be closed by a set time each afternoon, and that time is earlier than the session end in your Trading Hours template. Exit on session close will flatten you at the template's close, which is after the firm's deadline. Treat exit on session close as a backstop and code a separate flatten at your firm's cutoff, with a few minutes of margin. Check your firm's current rules page for the exact time, because these rules change.

Break at EOD and Bars That Span the Close

Each data series also has a Break at EOD setting, which controls whether bars are forced to end at the end of the trading day defined by your template. The Help Guide's warning about Renko bars with Break at EOD set to false, where exit on session close could trigger after the close, shows why it matters. NinjaScript exposes that setting through IsResetOnNewTradingDays, which the Help Guide says reports whether a series is using Break at EOD. Its default is false, and the value set in the user interface overrides anything set in code.

That last detail catches people. If your code assumes Break at EOD is on, but the data series in the Strategy Analyzer or on the Strategies tab has it off, the UI wins. Check the data series settings, not just your code, before you trust a backtest, especially on Renko, tick or range bars.

Stop Hardcoding Session Times: Use SessionIterator

A common shortcut is to hardcode "9:30" and "16:00" into a strategy. It works until daylight saving time shifts, a holiday shortens the day, or the strategy moves to a VPS set to a different time zone. NinjaScript has a better tool for this: SessionIterator.

The Help Guide describes SessionIterator as a way to traverse the trading hours data that applies to a set of bars. The useful members for a strategy are:

The Help Guide's example creates one from the strategy's bars and asks for the session that contains the current bar:

sessionIterator = new SessionIterator(Bars);
sessionIterator.GetNextSession(Time[0], true);
DateTime tradingDay = sessionIterator.ActualTradingDayExchange;

Because ActualSessionEnd comes back in your PC's local time, a "flatten 10 minutes before the session ends" rule built on it keeps working on a VPS in another time zone and on early-close days, as long as the template has the holiday defined. The Help Guide also recommends building and storing your own SessionIterator instance when you work with historical bars, rather than creating one on every bar.

Want a strategy that already handles the session for you?

NQ Ultra is a ready-to-run NinjaTrader 8 strategy for NQ futures, built for traders running prop firm accounts. Start from a finished system instead of debugging session logic.

Get NQ Ultra on Whop

A Setup That Keeps Backtest and Live in Sync

Here is the process we recommend for any automated strategy before it touches a funded account:

  1. Pick one template on purpose. Decide whether the strategy's logic needs overnight data. If it trades the cash open and its indicators should ignore the overnight session, RTH is the natural fit. If it uses overnight highs and lows or trades outside regular hours, use ETH.
  2. Use the same template everywhere. Set it in the Strategy Analyzer for the backtest, on the chart, and on the Strategies tab when you start the strategy live. Write it down next to the strategy's settings.
  3. Check the template itself. Open Tools > Trading Hours and confirm the sessions, the EOD marker, the time zone and the holiday list. If you need a custom window, copy the built-in template and edit the copy rather than changing the original.
  4. Load by date range. So the first processed bar lines up with a real session start and IsFirstBarOfSession means what you think it means.
  5. Code your firm's cutoff separately. Use exit on session close as a backstop, not as your compliance rule.
  6. Replay a holiday week. Run the strategy through a short holiday session in Market Replay and confirm it flattens before the early close. Our guide to testing a NinjaTrader 8 strategy with Market Replay walks through the setup.

Troubleshooting: Symptoms That Point to the Template

If you see any of these, check the Trading Hours setting before you touch the strategy code:

The Trading Hours template is a quiet setting, which is exactly why it causes so many confusing results. Your strategy can only be as consistent as the session definition underneath it. Choose a template deliberately, use it in every place you run the strategy, and let NinjaTrader's session tools handle the clock instead of hardcoded times. Then the trades you tested are the trades you get.