Edges
Gap Trading Strategy
Every morning, a handful of stocks open at prices that have nothing to do with where they closed the night before. A drug trial result, an earnings miss, a Fed statement, a competitor acquisition — the news arrives after the closing bell and reshapes expectations before the opening one. The gap between yesterday's close and today's open is not random noise. It is a compressed record of how the market collectively revised its view overnight. For a systematic trader, that compression is the opportunity.
Gap Trading — Example Setup (AAPL)
The gap trading edge is not about predicting news. It is about recognizing that different market participants process the same news at different speeds. Institutions revise positions in pre-market with conviction. Retail traders react at 9:30. The first fifteen minutes of regular trading hours is where those two cohorts collide — and the outcome of that collision is more predictable than most traders assume.
What a Trading Gap Is
A gap occurs when a security's opening price differs meaningfully from its previous closing price. If a stock closes at 48.50 and opens the next morning at 54.00, the price has gapped up by approximately 11.3%. No continuous trading occurred to bridge those levels — the market re-priced overnight.
Gaps are common on earnings days, FDA decision dates, macro announcement mornings, and any session following significant overnight news. They are rarer in broad index ETFs during low-volatility periods and more frequent in individual equities and sector ETFs tied to news-sensitive industries: biotech, energy, financials, and technology.
The gap number itself — the percentage difference between prior close and opening price — is the raw fact. What converts that fact into a tradeable signal is everything that surrounds it: the volume confirming the move, the direction of the gap relative to the news catalyst, and whether the pre-market price action strengthened or faded as open approached.
Gap Classification
Not all gaps behave the same way after open. Three behavioral classes account for most of what traders observe in practice.
Gap-and-go. Price gaps up (or down) on a strong catalyst — a positive earnings surprise, a buyout premium, a product approval — and the volume in the first minutes of regular trading confirms the move. High volume means participants are actively adding to the position at the open price, not dumping into the gap. In gap-and-go conditions, the opening gap becomes a floor (for a gap-up) or a ceiling (for a gap-down). The trade is to enter in the direction of the gap once the first candle establishes a structure and hold for continuation.
Gap-and-fill. Price gaps but the catalyst is ambiguous — guidance was revised without a clear positive or negative read, or the news is technically significant but the market cannot agree on the implication. Volume is average or below. In these cases, the gap often fills partially or completely within the same session: price drifts back toward the prior close as the initial reaction fades. The gap-and-fill pattern is the mirror image of gap-and-go — the trade, if any, is a fade entry betting on reversion rather than continuation.
Gap-and-crap. The most dangerous pattern for a long-biased trader. Price gaps up on news that looks strong at first read, attracts retail buyers at open, then collapses within the first hour. The failure mechanism is typically that institutional participants used the pre-market enthusiasm to distribute — they sold into the retail bid. The tell is a gap-up with high opening volume that immediately fails to hold its first five-minute high. By mid-morning, price is at or below the prior close. A trader who entered long on the gap-up has a significant drawdown, and if they were sizing aggressively, a damaging one.
Correctly classifying a gap before you trade it is the practical skill. Volume and news sentiment are the two primary classifiers.
Why the Edge Exists
The gap trading edge is an information asymmetry edge with a specific time structure.
Before the regular session opens, institutional investors — hedge funds, mutual funds, large proprietary desks — have already assessed the overnight news, cross-checked it against their positions, and decided how they want to be positioned at open. They have research teams, access to primary sources, and decades of pattern experience. Their pre-market order flow reflects this assessment. The pre-market price level is, in part, a weighted reflection of informed money's interpretation.
Retail traders, by contrast, are overwhelmingly reactive. Most read the news headline at 9:25 and make a decision at 9:30. Their participation surges in the first minutes of regular trading, layering additional order flow on top of whatever the pre-market established. This retail wave is emotionally driven — fear and greed are at peak intensity when a stock has moved 10% before the opening bell.
The collision between pre-positioned institutional orders and reactive retail flow creates a price discovery window in the first five to fifteen minutes of regular trading. During that window, the stock is still resolving its new fair value. The edge is that this resolution process has statistical regularities. Gap-and-go patterns resolve upward with higher probability when the news catalyst is unambiguous and volume confirms conviction. Gap-and-crap patterns resolve downward with higher probability when the news catalyst is event-driven (a beat-and-lower guidance situation, for example) and pre-market volume tapers off before open.
There is also a structural edge in pre-market liquidity. Pre-market spreads are wider, volumes are thinner, and prices are easier to move than in regular sessions. This means the pre-market price can overshoot or undershoot the true new equilibrium — giving regular-session participants a slight information advantage once full liquidity arrives.
How Sentiment Qualifies the Gap
A gap percentage alone is not a reliable trading signal. A 7% gap-up on routine rebalancing noise behaves entirely differently from a 7% gap-up following a clinical trial result.
Sentiment scoring — the type Newsvibe produces for individual news events — functions as a qualifier that separates tradeable gaps from noise. The mechanics of the classification map directly to gap type. A high-confidence positive sentiment score on a company-specific event (not a broad market event) increases the prior probability that a gap-up is gap-and-go rather than gap-and-crap. A mixed or ambiguous sentiment score — where the news contains both positive and negative elements — predicts gap-and-fill behavior with higher reliability than an unscored approach.
The second dimension sentiment adds is urgency. An article classified as high-urgency — where the news is time-sensitive and decisions must be made before the next trading session — tends to produce gaps with more follow-through because institutional response is faster and more decisive. Low-urgency news (a product roadmap update, a routine management change) produces gaps that fade more reliably.
In practice, the sentiment filter serves as a binary gate before the gap signal is acted upon. If the sentiment score exceeds a positive threshold on a company-specific event, the gap-and-go signal is live. If the sentiment is mixed or the event is broad-market (a macro release that gaps the entire sector together), the signal is downgraded to monitoring status only. This avoids the most expensive category of gap trade: entering a gap-and-go pattern on a day when the entire sector is gapping together due to macro correlation, which drowns the individual stock signal in index noise.
When It Fails
Gap trading has four well-defined failure modes.
Low-volume gaps. A gap with below-average volume in both pre-market and the regular-session open has no conviction behind it. Price moved because of thin liquidity, not because market participants have a directional view. These gaps fill more often than they continue, regardless of news quality. Volume ratio — pre-market volume relative to 30-day average pre-market volume — is the first filter. Below 0.8x, the signal degrades substantially.
Sector-correlation gap days. When the broad market or a sector gaps simultaneously — a Fed announcement, an oil shock, a macro data release — individual stock gaps are dominated by the macro direction. A biotech stock may gap up 5% because its sector is up 5%, not because of any company-specific catalyst. Applying a gap-and-go strategy to this environment treats macro beta as a company-specific signal. The trade may work, but for the wrong reason — and when the macro reverses intraday (common on macro announcement days), the individual stock follows the sector down, not any fundamental re-rating.
News that reverses before open. Pre-market is not static. A stock may gap up 12% at 5 AM on an initial headline, and by 8 AM the follow-on coverage has clarified that the earnings beat was accompanied by a sharp revenue guide-down. The gap will compress before open, and if it gaps down versus the 5 AM level, the early pre-market signal was false. A gap strategy that locks in the pre-market price at 5 AM and does not monitor for revision before 9:30 will act on stale information.
Holding past the first fifteen minutes. The gap edge is a price discovery edge, and price discovery resolves within the first fifteen minutes in most cases. After that window, the price is at its new equilibrium and the edge degrades to noise. A gap trade held beyond the first fifteen minutes without a defined continuation reason is a different trade — a trend trade, a momentum trade — and it should be evaluated as such.
How to Code It in Python
The following detects gaps at the open using pre-market data and classifies them for directional entry.
import pandas as pd
def calculate_gap(prev_close: float, current_open: float) -> float:
return (current_open - prev_close) / prev_close
def classify_gap(gap_pct: float, volume_ratio: float, gap_threshold: float = 0.02) -> str:
if abs(gap_pct) < gap_threshold:
return 'no_gap'
if gap_pct > 0 and volume_ratio > 1.5:
return 'gap_go_long'
if gap_pct < 0 and volume_ratio > 1.5:
return 'gap_go_short'
return 'gap_fade_candidate'
gap_pct is the fractional difference between the previous regular-session close and the current opening price, calculated by calculate_gap. A value of 0.05 means the stock opened 5% above the prior close.
gap_threshold is the minimum gap size to treat as a tradeable event. At 0.02 (2%), gaps smaller than that are classified as no_gap — they do not represent a significant overnight catalyst. In practice, the right threshold depends on the volatility regime of the universe you are scanning. High-beta small caps may require a 3–5% threshold; large-cap liquid stocks may be worth examining at 1.5%.
volume_ratio is pre-market volume divided by average pre-market volume over the prior 30 days, for the same time window (typically measured at 9:25 AM against the 4 AM–9:25 AM pre-market window). A ratio above 1.5 means volume is running 50% above its historical average for this pre-market window — a meaningful confirmation of institutional participation. Below 1.5, the gap lacks volume confirmation and moves to gap_fade_candidate.
Adding sentiment as a second qualifier. The sentiment score from a news API sits outside the price data pipeline. In practice, you call the sentiment scoring endpoint before open with the relevant company ticker and news timestamp, receive a score on a normalized scale (e.g., -1.0 to +1.0), and use it to gate entries from the gap classifier:
def gap_signal_with_sentiment(
gap_classification: str,
sentiment_score: float,
sentiment_threshold: float = 0.4
) -> str:
if gap_classification == 'gap_go_long' and sentiment_score >= sentiment_threshold:
return 'enter_long'
if gap_classification == 'gap_go_short' and sentiment_score <= -sentiment_threshold:
return 'enter_short'
if gap_classification == 'gap_fade_candidate':
return 'watch_fade'
return 'no_trade'
The sentiment_threshold of 0.4 is a starting point. Higher values filter for stronger news events and reduce trade frequency. Lower values pass more trades but accept weaker sentiment confirmation. The right value depends on how your sentiment model distributes scores across events — check the distribution on your historical event set before committing to a threshold.
Entry timing. The entry window is the first five to fifteen minutes of regular trading. A common implementation: wait for the first five-minute candle to close, confirm the gap is holding (current price above the gap level for long, below for short), and enter on the close of that first candle or the open of the second. This avoids the most chaotic seconds at 9:30 while still capturing the price discovery window.
The Oyamori Approach
Oyamori tracks gap events as a core edge category within the edges catalog, monitoring both gap frequency by ticker universe and gap classification accuracy over time. When a gap-and-go signal fires, the platform surfaces the sentiment score and volume ratio alongside the gap percentage — so the qualifying factors are visible at entry, not reconstructed after the fact.
The platform's sentiment layer is designed specifically for the pre-market gap use case. Newsvibe scores news events as they arrive overnight, with timestamps that allow a gap strategy to query sentiment for events that landed in the relevant pre-open window. The combination of a gap signal and a Newsvibe urgency flag is the operational trigger: both must align for the trade to be active.
For traders building their own gap detection pipeline, the Python scaffolding above is a starting point. The edge logic transfers; the data plumbing — getting clean pre-market volume data and reliable open prices on the correct symbols — is where most implementations spend the majority of setup time.