Backtesting CSV Import Intraday Opening Range Breakout RealTest RealTest Code

Can RealTest Backtest Intraday 5-Minute Data and Opening Range Breakouts (CSV Guide)

Summary

RealTest 2.0 is natively an End-of-Day (Daily, Weekly, Monthly) portfolio engine and does not yet process multiple intraday timestamps per calendar date natively. However, you can backtest Opening Range Breakouts (ORB) cleanly with exact annualized daily stats by importing custom CSV files storing precomputed 5-min or 15-min opening-range levels in the Extra column paired with intraday EntryStop and same-day ExitTime ThisClose MOC exits.

· 5 min read
RealTest 2.0 CSV Opening Range Breakout workbench showing SPY ORB_Level chart left, DataSource CSV script top-right, and same-day close Trade List bottom-right
Key findings
  • RealTest 2.0 natively supports Daily, Weekly, and Monthly BarSize modes rather than native multi-bar intraday timestamps per date, so claiming RealTest runs native tick or 5-minute intraday bars is incorrect.
  • The cleanest way to backtest Opening Range Breakouts (ORB) inside RealTest while keeping 100 percent accurate annualized ROR, Sharpe, and MaxDD is importing custom daily CSV files via DataSource CSV with precomputed 5-min or 15-min opening-range trigger levels stored in the Extra column.
  • RealTest officially supports same-day intraday day trades via EntryLimit or EntryStop (EntryTime Intraday) paired with ExitRule 1 and ExitTime ThisClose (generating a parent entry order attached to a closing MOC exit).
  • An alternative workaround for multi-bar 5-minute or 15-minute CSV testing assigns sequential synthetic calendar dates to each bar, though annualized metrics like ROR and Sharpe must then be rescaled because 78 five-minute bars equal one trading day.
  • Validated in RealTest 2.0 via -import and -test on 2,516 SPY sessions (2016 to 2024), our naive ORB CSV template executed 1,338 same-day trades (1,160 ThisClose MOC exits and 178 intraday stop-outs) and exposed why raw ORB entries without relative-volume and gap filters bleed heavily once StopSlip and CloseSlip are included.

Every week on the RealTest user forum and across AI chat tools, traders ask the exact same question. Can RealTest backtest 5-minute or 15-minute intraday data and Opening Range Breakout (ORB) strategies? General AI assistants frequently hallucinate fake directives like BarSize: 5min that immediately fail RealTest's parser.

Here is the exact, official truth grounded in the RealTest CSV Import documentation and verified directly via realtest.exe -import and -test in RealTest 2.0, along with the two practical CSV workflows traders actually use to test ORB setups inside RealTest.

What RealTest 2.0 Supports (And What It Does Not) for Intraday Data

RealTest's engine is architected around portfolio-wide daily, weekly, and monthly bars (BarSize: Daily, Weekly, or Monthly). Although CSVFields recognizes a Time column during import, RealTest requires one unique date per bar row in an .rtd file and does not natively evaluate 78 separate 5-minute bars stamped with the same calendar date.

Intraday Approach in RealTest How CSV Data Is Formatted Annualized Stats Accuracy Best Use Case
Method 1 (Recommended) Daily OHLC + Precomputed ORB in Extra One row per trading day with 5-min/15-min opening-range trigger stored in Extra (or auxiliary symbol) 100% exact ROR, Sharpe, MaxDD, and calendar dates Opening Range Breakout (ORB), VWAP level breakouts, gap-and-go day trades
Method 2 Synthetic Sequential Dates per 5-Min Bar Each 5-min bar is assigned a sequential calendar date (7-day calendar fill) Distorted (78 bars = 1 real day; must inspect per-trade expectancy and profit factor) Multi-bar intraday indicator testing (5-min EMA, intraday trailing stops)
Native Intraday Brackets on Daily Bars Standard Norgate daily bars using EntryLimit/EntryStop + ExitRule: 1 + ExitTime: ThisClose 100% exact + supported in live OrdersMode (LMT GTD 15:40 + child MOC) Daily-signal intraday fade or breakout day trades closed at 16:00

Notice that Method 1 also avoids a critical trap when evaluating academic ORB papers. Many popular SSRN Opening Range Breakout studies omit stop slippage completely. Running your CSV ORB data inside RealTest lets you attach realistic StopSlip, CloseSlip, and IBKR commissions immediately and see whether the intraday edge survives real execution friction.

Complete Validated RealTest Script (CSV Import + Extra ORB + ThisClose Exit)

Below is a complete, runnable script demonstrating RealTest's single-file DataSource: CSV import with an Extra opening-range trigger column, intraday EntryStop execution, protective ExitStop, and same-day ExitTime: ThisClose MOC liquidation. Note one important alignment detail when preparing your own 5-minute or 15-minute CSV externally. Because RealTest evaluates EntryStop from the prior bar's row by default, either populate Extra with a strictly pre-open pivot or align your preprocessed post-9:45 session OHLC row carefully without ever leaking the full session's future High or Close into the trigger.

Notes:
	Importing custom CSV data with Extra opening-range levels in RealTest
	and modeling same-day Opening Range Breakout (ORB) entries with intraday
	EntryStop triggers, protective ExitStop, and same-day ThisClose MOC exits.

Import:
	DataSource:	CSV
	CSVFile:	C:\RealTest\Data\spy_orb_demo.csv
	CSVFields:	Symbol,Date,Open,High,Low,Close,Volume,Extra
	SaveAs:	C:\RealTest\Data\spy_orb_demo.rtd

Settings:
	DataFile:	C:\RealTest\Data\spy_orb_demo.rtd
	StartDate:	2016-01-01
	EndDate:	2024-12-31
	AccountSize:	100000
	BarSize:	Daily

Parameters:
	atrLen:	14
	stopMult:	0.75

Data:
	atrN:	ATR(atrLen)
	ma200:	Avg(C, 200)
	// Extra column holds imported 15-min opening range level from custom CSV
	orbLevel:	Extra
	trendUp:	C > ma200

Strategy: spy_orb_daytrade
	Side:	Long
	EntrySetup:	Symbol = $SPY and trendUp and orbLevel > 0
	// Breakout stop above imported opening-range threshold; exit MOC same session
	EntryStop:	orbLevel
	EntryTime:	Intraday
	Quantity:	100
	QtyType:	Percent
	MaxPositions:	1
	Commission:	Max(1, Shares * 0.005)
	StopSlip:	0.0005 * FillPrice
	CloseSlip:	0.0003 * FillPrice
	ExitStop:	FillPrice - stopMult * atrN
	ExitRule:	1
	ExitTime:	ThisClose
	Ambiguity:	Stop

Charts:
	ORB_Level:	orbLevel
	MA200:	ma200

For multi-symbol CSV folders (one file per ticker such as SPY.csv, QQQ.csv, TQQQ.csv), simply replace CSVFile with DataPath: C:\RealTest\Data\ORB_CSV and omit Symbol from CSVFields. If your CSV uses European semicolon formatting and comma decimals, add CSVNumFmt: Comma inside Import.

Why Realistic StopSlip and CloseSlip Expose Naive ORB Strategies

Executed in RealTest 2.0 via -import (exit code 0 across 2,516 real SPY daily bars) and -test (2016 through 2024), this unrefined baseline took 1,338 same-day trades (1,160 closing MOC exit rule fills with Bars = 0 and 178 intraday exit stop closures; for example SPY on August 19, 2024 buying at 554.73 and exiting at the 16:00 close at 559.44 for +0.84%). Notice also that AvgExp reports 0.00 percent because RealTest measures exposure at end-of-day after every ThisClose day trade has already flattened to cash!

RealTest 2.0 equity and drawdown graph exposing slippage impact on naive SPY CSV Opening Range Breakout day trading
RealTest 2.0 Daily Stats Graph for the unrefined SPY CSV breakout day-trade template (2016 to 2024). Paying 5 bps StopSlip on entry plus 3 bps CloseSlip on exit across 1,338 daily attempts turns a naive unfiltered ORB into a steady -71.75% bleed, confirming why real ORB strategies require strict opening-range volume, trend, and gap filters.

That downward slope is one of the most valuable lessons in quantitative day trading. On 1,338 high-frequency round trips, even modest 8 bps combined slippage per trade compounds into more than 100 percent gross friction over nine years. Profitable Opening Range Breakouts therefore demand real intraday opening-range CSV datasets (comparing actual first-5-minute or 15-minute relative volume and direction against historical norms) rather than firing blindly every session. Pair this guide with our RealTest fill timing and slippage guide and our RealTest IBKR OrdersMode reference before running live intraday brackets.

Free 5-Minute Intraday CSV Datasets and 15-Minute ORB Script for RealTest

To save you hours of cleaning and formatting raw intraday CSV files yourself, we publish four free ready-to-import RealTest intraday resources directly on SetupAlpha. Grab our Free SPY & QQQ 15-Minute Intraday Breakout Strategy for RealTest alongside the matching formatted CSV datasets for Free SPY 5-Minute Intraday CSV Data, Free QQQ 5-Minute Intraday CSV Data, and TQQQ 5, 15, and 30-Minute Opening Range Data for RealTest.

If you want to automate custom CSV preprocessing and RealTest validation pipelines using AI, see our Build RealTest Strategies with Claude Code AI course, or browse complete multi-day equity systems inside our RealTest Portfolios collection and free RealTest code library.

Key terms

CSVFields
A RealTest Import directive specifying the comma-separated column order of custom CSV files (Date, Time, Open, High, Low, Close, Volume, AdjClose, RealClose, Dividend, Extra).
Extra Bar Field
A dedicated custom numeric data slot imported per symbol per bar via CSVFields that can store precomputed intraday levels like 15-minute opening-range highs.
Opening Range Breakout (ORB)
An intraday momentum strategy entering when price breaks above or below the high-low range established during the first 5, 15, or 30 minutes of regular trading.
ThisClose Day-Trade Exit
RealTest's supported same-day closing exit pattern pairing an intraday EntryLimit or EntryStop with ExitRule 1 and ExitTime ThisClose (MOC at 16:00).
DataPath vs CSVFile
RealTest CSV Import options where CSVFile loads one combined multi-symbol CSV file and DataPath imports an entire directory of individual SYMBOL.csv files.

Frequently asked questions

Can RealTest backtest intraday 5-minute or 15-minute bar data natively?

No. RealTest 2.0 natively supports Daily, Weekly, and Monthly BarSize modes and requires unique calendar dates per bar row. To test Opening Range Breakouts cleanly with exact annualized stats, import a custom CSV with precomputed 5-min or 15-min opening-range levels in the Extra column, or assign sequential synthetic dates to 5-minute rows when evaluating per-trade expectancy.

How do you import a custom CSV file into RealTest?

Create an Import section with DataSource CSV, CSVFile pointing to a single multi-symbol CSV (or DataPath pointing to a folder of SYMBOL.csv files), CSVFields listing the exact column order such as Symbol,Date,Open,High,Low,Close,Volume,Extra, and SaveAs naming your output .rtd file.

How do you code a same-day day trade that exits at the market close in RealTest?

Use an intraday entry order (EntryLimit or EntryStop with EntryTime Intraday) combined with ExitRule set to 1 and ExitTime set to ThisClose. RealTest closes every trade at that same session's close (generating a parent order plus child MOC order in Orders mode) and records 0 holding bars.

Why does AvgExp show 0.00 percent on a RealTest day-trading strategy?

RealTest calculates daily exposure at the end of each trading day after all exits have settled. Because a same-day strategy with ExitTime ThisClose flattens every position before the bell, overnight end-of-day exposure is 0.00 percent.

What is the Extra column used for in RealTest CSV imports?

Extra is a built-in numeric field in CSVFields that lets you attach one custom per-bar value (such as a 15-minute opening range high, unadjusted close, or fundamental metric) to every bar row and reference it directly as Extra inside Data or Strategy formulas.

Why do many Opening Range Breakout backtests fail when realistic slippage is added?

High-frequency daily ORB strategies often take over 1,000 stop-entry and MOC-exit round trips per decade. Adding realistic StopSlip and CloseSlip quickly overwhelms small average trade gains unless entries are filtered by opening-range volume, gap structure, and directional momentum.

Related strategies

SPY & QQQ 15-Minute Intraday Breakout Strategy (Free RealTest Script)
Free working 15-minute Opening Range Breakout RealTest script ready to pair with intraday CSV datasets.
View →
SPY 5-Minute Intraday Data (Free CSV Download)
Pre-formatted historical SPY 5-minute intraday CSV dataset ready for RealTest research and opening-range testing.
View →
TQQQ Opening Range Data for RealTest (5, 15 and 30 min)
Clean precomputed 5, 15, and 30-minute TQQQ opening-range CSV data engineered specifically for RealTest CSV import.
View →
← Back to Learn

#1 RealTest Backtests

Supercharge Your Trading Now

Reduce drawdown, build diversification, or speed up your development time.

Browse RealTest Strategies