All posts

Strategies6 min read

A disciplined way to backtest gap-and-go setups

Backtest the gap and go strategy without hindsight: define universe, time‑stamp catalysts, model the opening auction, and predeclare entries and exits.

By TerraTrade Team

A candlestick chart around the 09:30 opening bell highlighting a visible upside price gap and early continuation, no logos.

You only get one opening print each day, and most of the “gap and go” edge—if it exists—comes from what is known and tradable before that print. This guide shows stock day traders how to specify a gap-and-go strategy you can actually backtest without hindsight. We pin down five things, in order: (1) the tradeable universe, (2) the catalyst and its time stamp, (3) liquidity and opening execution mechanics, (4) measurable opening behavior, and (5) exits that are defined in advance. Each section cites primary market mechanics or research so you can reproduce results and audit assumptions.

What traders mean by “gap and go”#

Component to defineOption A (conservative)Option B (per exchange data)NotesSupporting evidence
Gap percentage baseUse prior day’s official consolidated closeUse primary‑listing venue’s official closing pricePick one and hold it fixed across the sample
Pre‑open reference for gapMidpoint of last pre‑market NBBO at 09:28:59 ETIndicative opening (auction) price at 09:2x ETYou must store the exact timestamp used for every symbol/dayHOW THE OPENING AND CLOSING CROSS WORK
Opening reference levelsOpening‑range high/low over first N minutes (e.g., 1–5)Pre‑market high/low and/or indicative auction imbalance levelsDefine N and whether pre‑market levels are included in triggersHOW THE OPENING AND CLOSING CROSS WORKA framework for opening gaps | Paul Remington Wang
Catalyst time signalSEC EDGAR accepted timestamp (“filedAt”)Original press‑release distribution time (server‑stamped)Only catalysts time‑stamped before your pre‑open reference can be usedSEC.gov | Accessing EDGAR DataDoes Overnight News Explain Overnight Returns?

Step 1 — Define the gap universe you can actually trade#

Step 2 — Time‑stamp the catalyst before the open#

Step 3 — Liquidity and opening execution mechanics you must respect#

Step 4 — Entries, invalidations, and exits that do not look ahead#

Step 5 — Bias controls, walk‑forward, and replication#

  1. Choose the historical sample and build a survivor‑free symbol list for each test date Survivorship Bias in Emerging Market Small-Cap Indices: Evidence from India's NIFTY Smallcap 250.
  2. Pick one gap metric and one pre‑open reference timestamp (e.g., 09:28:59 NBBO midpoint or indicative auction price) and store it per symbol/day HOW THE OPENING AND CLOSING CROSS WORK.
  3. Define liquidity floors (ADV or dollar value) and any price bands, and exclude days lacking full intraday or auction‑message coverage HOW THE OPENING AND CLOSING CROSS WORK.
  4. Fetch and archive catalysts with auditable timestamps (EDGAR accepted times and/or server‑stamped press releases) SEC.gov | Accessing EDGAR Data.
  5. Classify catalysts and flag eligibility based on timestamps strictly preceding your pre‑open reference SEC.gov | Accessing EDGAR DataDoes Overnight News Explain Overnight Returns?.
  6. Specify opening behavior features you will measure (opening‑range N, pre‑market high/low, VWAP) A framework for opening gaps | Paul Remington Wang.
  7. Choose exactly one entry rule (e.g., opening‑range break) and one invalidation rule. Pre‑register all thresholds Gap-and-Go Strategy — Strategy Guide With Entries & Exits.
  8. Decide on exit logic: time‑based, structure‑based trailing, or fixed R multiple. No references to the future day’s range Gap-and-Go Strategy — Strategy Guide With Entries & Exits.
  9. Model execution according to whether you participate in the opening auction (MOO/LOO) or trade after the open; apply the venue’s auction rules and collars if applicable HOW THE OPENING AND CLOSING CROSS WORK.
  10. Implement bias controls: walk‑forward or purged cross‑validation with an embargo, and log all hyperparameters and seeds Advances in Financial Machine Learning [Book].
  11. Run base tests and then robustness slices (by catalyst type, liquidity, gap size buckets).
  12. Journal every trade with standardized tags to enable weekly/monthly reviews and playbook updates.

A journal tag set you can reuse#

Strengths and limitations of testing gap‑and‑go

Where disciplined gap‑and‑go testing shines

  • The open is governed by auditable auction rules, creating reproducible pre‑open signals (indicative price, imbalance) (Source: HOW THE OPENING AND CLOSING CROSS WORK).
  • Catalyst‑conditioned gaps let you study distinct cohorts with objective time stamps (EDGAR accepted times) (Source: SEC.gov | Accessing EDGAR Data).
  • Entry and invalidation can be defined using only first‑N‑minute information, enabling genuinely out‑of‑sample testing (Source: Gap-and-Go Strategy — Strategy Guide With Entries & Exits) (Source: A framework for opening gaps | Paul Remington Wang).
  • Bias controls (purged CV, walk‑forward) are well‑documented and implementable with open research (Source: Advances in Financial Machine Learning [Book]).

Limitations to watch

  • Continuation can be regime‑dependent; a gap with a clean catalyst in one volatility regime may fade in another.
  • Execution quality at and just after the open is sensitive to auction participation and auction collars—bar backtests can misrepresent these mechanics (Source: HOW THE OPENING AND CLOSING CROSS WORK).
  • Catalyst mis‑timestamping (e.g., relying on reposts rather than the EDGAR accepted time) can contaminate “with‑catalyst” cohorts (Source: SEC.gov | Accessing EDGAR Data).
  • Extended‑hours behavior and the presence/absence of indicative prices vary by venue and data access, limiting retail replication (Source: HOW THE OPENING AND CLOSING CROSS WORK) (Source: between the hours of 8:00 PM-4:00 AM ET, the Exchange is closed to trading as it is during all weekend hours.).
A clean candlestick chart around the 09:30 opening bell showing a visible upside price gap and early continuation, no logos or annotations.
The opening gap and first minutes are governed by venue auction rules and immediately tradable prints—not by hindsight [source:1].

FAQ: building a gap‑and‑go test you can trust#

Should I compute the gap from the official open or the pre‑open indicative price?

Use a pre‑open reference you could observe before the cross—such as the last pre‑market NBBO midpoint at a fixed time (e.g., 09:28:59 ET) or the exchange’s indicative opening price disseminated during the imbalance period. Do not use the eventual official open to compute the gap; that injects hindsight HOW THE OPENING AND CLOSING CROSS WORK.

How do I confirm that a gap had a real, tradable catalyst?

Prefer primary records. For filings, record the EDGAR accepted (“filedAt”) timestamp and accession number. For press releases, store the original server‑stamped time. Only catalysts time‑stamped before your pre‑open reference can be used in catalyst‑conditioned tests. Overnight news has distinct effects on returns, so time alignment matters SEC.gov | Accessing EDGAR DataDoes Overnight News Explain Overnight Returns?.

Can I backtest gap and go with only daily bars?

You can prototype with daily bars, but fills at and just after 09:30 ET depend on opening‑auction mechanics and immediate quote/tape conditions. If your logic references the open or the first N minutes, intraday data—and, when relevant, auction imbalance/indicative messages—produce more realistic fills HOW THE OPENING AND CLOSING CROSS WORK.

What’s the simplest way to reduce overfitting in this strategy?

Walk‑forward evaluation or combinatorial purged cross‑validation with an embargo reduces look‑ahead from overlapping events and serial dependence. Pair this with survivor‑free universes and pre-registered parameters to curb data‑snooping Advances in Financial Machine Learning [Book]Survivorship Bias in Emerging Market Small-Cap Indices: Evidence from India's NIFTY Smallcap 250.

I saw conflicting backtests online—why do the results disagree?

Public posts show a range of outcomes across indices and futures, but results hinge on universe, filters, and frictions. Before you adopt any published numbers, read their assumptions on gap definition, auction participation, and costs, and try to replicate on your data Gap-and-Go Strategy: Does Trading the Opening Gap Work? | TradeBricksS&P 500 Gap-and-Go Backtest: Real Until 2022 | YuRa TradingYM Gap & Go Backtest | Dow Jones Futures.

What trading‑hours details matter when modeling the gap?

Venue documentation specifies a closed overnight window (e.g., 8:00 PM–4:00 AM ET in one filing). Treat anything before 09:30 ET as extended‑hours/pre‑market and confirm what data and order types your test assumes. Different sessions follow different mechanics and data dissemination patterns between the hours of 8:00 PM-4:00 AM ET, the Exchange is closed to trading as it is during all weekend hours.HOW THE OPENING AND CLOSING CROSS WORK.

Closing takeaways#

Sources#

Your journal writes posts like this about you.

Connect a broker and TerraTrade turns your own trades into the findings that matter.