Understanding Gaps Study Guide & Workbook: Scott Andrews on Gap Fills, Zones, and Risk

Book: Understanding Gaps: Profiting from the Opening Gap
Author: Scott Andrews
Difficulty: Intermediate

The Big Idea

A market can revisit yesterday’s close frequently and still be difficult to trade profitably. Small successes can be outweighed by fewer large losses, while waiting for a more distant target changes both the payoff and the probability of reaching it.

Scott Andrews organizes this problem around the opening gap’s location, stop distance, and exit plan. This companion develops the reasoning behind those choices with original calculations, timestamped observation exercises, and a session-mapping indicator. Keep the book beside you for its charts and historical research.

The supplied 2008 Traders Press edition identifies Andrews as author and Edward Dobson as editor. References below use the book’s printed Arabic page numbers: printed page 1 is PDF page 7, so add six to find its PDF page. The file contains 61 PDF pages, including front matter and advertising. ISBN: 978-1-934674-01-7. The filename’s shared author field should not be read as evidence of coauthorship.

Quick study guide

ConceptWorking definitionWatch for
Opening gapSession opening price minus the previous chosen session closeA futures settlement or full electronic-session close is a different reference. See lesson 2.
Fade / go with / fade the fillOppose the opening gap / follow it / wait for its retracement then consider the original directionThese are separate events and entry protocols. See lesson 5.
Gap zoneOpening location relative to prior OHLC, conditioned on prior open-to-close directionUse known prior values, define boundary equality, and retain dojis. See lesson 3.
Fill rate / win ratePrior close reached / a trade meets its stated profitable-outcome definitionThe book sometimes counts profitable end-of-day exits as wins without a full fill.
Expectancyp × average win − (1 − p) × average loss − per-trade costUse common units and include the entire candidate population.
Profit factorSum of positive trade P/L divided by the absolute sum of negative trade P/LAn average of yearly ratios is not the pooled ratio.
SizingFloor of planned risk budget divided by assumed stop-risk plus cost per unitMargin and notional exposure are not the same as a loss budget. See lesson 4.
Research disciplineLock definitions before evaluating later dataThirty observations is not a guarantee of adequate evidence. See lesson 7.

Seven-session reading map

These are study sessions, not a seven-day earnings plan. Shorten or split them as needed. The substantive chapters, glossary, and bibliography all have a place; publisher advertising is not a lesson assignment.

Session / printed pagesLearning goalProduce
1 · Introduction, pp. 1–3Separate personal fit from evidence of an edgeProcess constraints and practice 1
2 · What Are Gaps?, pp. 4–12Define sessions, outcomes, and the high-win-rate paradoxOutcome ledger and practice 2
3 · Creating a Profitable Strategy, pp. 13–16Measure size, zone, and calendar effects without hindsightClassification rules and practice 3
4 · Same chapter, pp. 16–19Connect risk distance, payoff, costs, and expectancyRisk calculation and practice 4
5 · Real World Examples, pp. 20–38Separate the author’s observations, decisions, and later explanationsCase audit and practice 5
6 · Gap Trading Tips, pp. 39–40Translate selected advice into falsifiable rulesDecision checklist and practice 6
7 · Get Started!, pp. 41–45; glossary pp. 46–48; bibliography pp. 49–50Build a reproducible plan and evaluate supporting sourcesPractice 7, worksheets, and capstone

1. Fit the process to the trader

Read: pp. 1–3. Goal: distinguish a process you can execute from a process shown to have an edge.

Andrews describes moving away from a discretionary approach that did not suit his temperament. His preference for structure, short holding periods, and a narrow market focus explains why he studied opening gaps. It does not independently establish that opening gaps will suit every trader.

Write two separate questions: “Can I follow this procedure reliably?” and “Does the procedure produce attractive outcomes after costs?” Strong execution cannot rescue a weak method, and a plausible method can still fail through inconsistent execution.

Original example: two reasons for the same loss

Fictional audit of a planned short. The rule required a six-point stop and an end-of-session exit if neither stop nor target occurred.

StepOriginal calculation or observationMeaning
Plan followedThe market moves six points against the assumed entry and the planned stop is triggeredA losing observation can be consistent with the method.
Execution deviatesThe trader cancels the stop and later exits twelve points worseThe deviation changes the result; record it separately.
Research questionRetain both the rule-based hypothetical result and the actual documented resultDo not change the rule retroactively to explain the loss.

Keep this distinction: A loss is not automatically proof of either bad execution or a bad method.

Practice 1

  1. Name one process preference Andrews describes.
  2. Why does a preferred lifestyle not establish positive expectancy?
  3. What should an execution-deviation log contain?
  4. What would you decide before studying the opening gap?
Check your answers — practice 1
  1. Examples include structured rules, a narrow market focus, preparation before the open, and avoiding long holding periods. These describe his preferences.
  2. Personal fit concerns execution and attention; expectancy concerns the distribution of costs and outcomes. They require different evidence.
  3. The intended rule, information and timestamp, actual action, reason for deviation, and both outcomes where independently reconstructable.
  4. A study instrument, session definition, available observation time, and whether the data can support the intended measurements.

2. Separate gap fills from trade wins

Read: pp. 4–12. Goal: define the event being counted before interpreting a percentage.

The book measures its opening gap from the prior regular-session close, rather than requiring an opening price beyond the entire prior range. Its historical S&P futures convention uses a 09:30 ET open and a 16:15 ET prior close. That convention must travel with any attempt to reproduce the study.

Our indicator defaults to a deliberately chosen 09:30–16:00 New York window and offers a 16:15 alternative. This is an adjustable observation convention, not a declaration of current exchange trading hours. A custom-session final trade, a futures settlement, and a data vendor’s daily close need not be identical. Compare data definitions before comparing percentages.

Original example: different closing references create different gaps

Fictional index prices. No market data or fills are claimed.

StepOriginal calculation or observationMeaning
Chosen 16:00 close5,000.00Reference A
Chosen 16:15 close5,004.00Reference B
Next 09:30 open5,010.00Gap A = +10.00; gap B = +6.00.
Morning low5,002.00Reference B is reached; reference A is not yet reached.

Keep this distinction: A “filled gap” depends on which prior close was specified.

Breakaway, common, continuation, and exhaustion are the reading’s four descriptive patterns. Some definitions rely on what subsequently happens. For an opening-time study, record observable prior trend, opening location, and available volume; keep the later pattern label in a separate outcome column.

In the reading

Figure 6 reports a 72.6% average win figure for a no-stop hypothetical fade study covering 2,167 gaps from January 1998 through April 2008. A win includes hitting the gap-fill target or finishing the day profitably.

How to evaluate it

That statistic is not interchangeable with a pure full-fill rate or the win rate of a stopped trading method. Figure 7’s average yearly profit factor of 1.08 also is not automatically a pooled, after-cost profit factor.

Original example: 75% winners can still lose

Fictional 100-trade sample, measured in points per equal-sized unit before and after a fixed hypothetical 0.25-point round-trip cost.

StepOriginal calculation or observationMeaning
Winners75 × 2 = 150 pointsAverage winner: 2 points.
Losers25 × 7 = 175 pointsAverage loss: 7 points.
Gross expectancy0.75 × 2 − 0.25 × 7 = −0.25 pointsWin rate alone conceals the loss.
Gross profit factor150 / 175 ≈ 0.857Below 1 despite frequent winners.
Net expectancy−0.25 − 0.25 = −0.50 pointsCosts worsen a weak gross result.

Keep this distinction: Always ask what wins pay and what losses cost.

Practice 2

  1. Which fictional reference was reached by the 5,002 low?
  2. Does Figure 6 establish a 72.6% full-gap-fill rate?
  3. Calculate the gross P/L of the fictional 100-trade sample.
  4. Can full daily high/low data establish whether a stop or target occurred first?
Check your answers — practice 2
  1. The 5,004 reference was crossed; the 5,000 reference was not reached by that low.
  2. No. Its stated win definition also includes profitable end-of-day exits. It is historical, hypothetical, and no-stop.
  3. 150 − 175 = −25 points, before 25 points of assumed aggregate costs.
  4. No. When both thresholds lie within a daily range, intraday sequencing is needed; otherwise record ambiguity.

3. Classify location before studying outcomes

Read: pp. 13–16. Goal: construct reproducible gap groups using information available at the open.

Gap size tells you the distance to the reference close. Zone adds the prior day’s shape and the new opening location. The same point gap can open outside yesterday’s high, inside an upper wick, or within the body; these are different contexts worth comparing.

The book’s zone results are historical summaries, not probabilities assigned to today. Its detailed Otis subzones, parameters, and selection rules are not fully disclosed. Our broad classification below is a study framework, not an attempted reconstruction of those proprietary signals.

Known featureOur classification ruleBoundary treatment
Prior directionClose > open: up; close < open: down; equality: dojiRetain dojis rather than force them into up/down groups.
Outside prior rangeNew open above prior high or below prior lowStrict comparisons.
Wick areaAbove both prior open/close but below high, or below both but above lowCheck exact-level cases before wick/body cases.
Body areaBetween prior open and closeExact equality with any prior OHLC is its own boundary group.
Gap magnitudeAbsolute(open − prior close); optionally divide by prior close or an independently frozen volatility scaleState units and denominator; no unseen final-day volatility.

Original example: classify before revealing the session

Fictional prior OHLC: open 5,020; high 5,040; low 4,990; close 5,000. The next open is 5,010.

StepOriginal calculation or observationMeaning
Prior direction5,000 < 5,020Prior down session.
Signed gap5,010 − 5,000 = +10 pointsA fade would be short; this is not an instruction to enter.
Opening locationBetween prior close and prior openInside the prior body.
Normalized size10 / 5,000 = 0.20%Record the percentage alongside raw points.

Keep this distinction: Location is available at the open; the eventual narrative is not.

Seasonality adds a calendar grouping, not a causal explanation. The book compares weekdays and months and warns against over-optimization. Splitting a sample by zone, direction, weekday, month, and size can quickly leave tiny groups. A calendar pattern may also reflect changing volatility or event composition.

Practice 3

  1. Classify a new open of 5,045 using the example’s prior values.
  2. How should an open exactly at 5,040 be classified in our protocol?
  3. Why is a ten-point threshold not comparable across all index levels?
  4. Why can adding more filters create more apparent edges?
Check your answers — practice 3
  1. Above the prior high after a prior down session. The signed gap is +45 points.
  2. Exact prior level. Our boundary rule prevents overlapping or inconsistent categories.
  3. Ten points is a different percentage and volatility-scaled distance when the price level or market regime changes.
  4. Many small subdivisions create more opportunities for random patterns and unstable estimates. Lock comparisons and evaluate later data.

4. Balance stops, targets, and costs

Read: pp. 16–19. Goal: calculate payoff and planned risk without confusing them with guaranteed execution.

A wider stop often increases the chance of surviving until a target, but also enlarges a full loss. A nearer target often raises the hit rate while shrinking the average gain. Andrews’ historical tables demonstrate the need to study the combination rather than maximize one percentage.

For a simple two-outcome model before costs, the break-even win rate is L / (W + L), where W and L are positive average win and loss amounts. With a fixed cost c paid on every trade, it becomes (L + c) / (W + L). Real samples with partial exits and end-of-day closes need their full observed distribution.

Original example: slippage changes a fixed-level trade

Fictional gap up: prior close 5,000; opening observation 5,010. A proposed short uses a fixed stop at 5,015 and fixed target at 5,000. The actual short fill is assumed to be 5,009.

StepOriginal calculation or observationMeaning
At the opening observation10-point reward / 5-point distance = 2.00ROnly an initial quote-based illustration.
From assumed short fillReward = 5,009 − 5,000 = 9 pointsThe target is unchanged.
Risk from assumed fill5,015 − 5,009 = 6 pointsActual planned ratio is 9 / 6 = 1.50R.
Break-even, no costs6 / (9 + 6) = 40%Applies only to the stated binary payoff model.
With 0.50-point cost(6 + 0.50) / 15 ≈ 43.33%Cost is a labeled assumption, not a measured ES average.

Keep this distinction: Calculate reward/risk from the actual or explicitly assumed fill.

For ES dollar arithmetic, CME identifies a $50 multiplier per index point; Micro E-mini S&P 500 uses $5 per point. See CME’s contract comparison. These multipliers do not make a historical point stop suitable for current conditions.

Original example: risk budget is different from margin

Fictional account $25,000; planned risk budget 0.5% = $125; six-point stop distance; assumed total cost allowance $5 per ES contract.

StepOriginal calculation or observationMeaning
One ES planned amount6 × $50 + $5 = $305Exceeds the $125 planned budget.
ES quantityfloor($125 / $305) = 0The calculation says zero contracts.
Illustrative MES allowance$1 assumed per micro contract; 6 × $5 + $1 = $31Different cost assumption, explicitly stated.
MES quantityfloor($125 / $31) = 4Planned amount $124; gaps and execution can exceed it.

Keep this distinction: Smaller margin requirements do not justify a larger loss budget.

In the reading

Andrews describes one contract per $10,000 of equity and zone-specific stops. His historical examples include a six-point loss.

Our calculation

At $50 per point, six points is $300 per ES contract: 3% of $10,000 before costs. The fixed equity ratio alone cannot guarantee a small or fixed percentage loss.

The glossary’s profit-factor wording can be confusing. For this workbook, define it as total positive trade P/L divided by the absolute total negative trade P/L under a stated cost convention. Do not put overall net profit in the numerator. Review losing streaks and drawdown alongside the ratio.

Practice 4

  1. What is the fill-based reward/risk ratio in the short example?
  2. What is its binary break-even win rate with the assumed cost?
  3. How many ES contracts fit the $125 planned budget?
  4. Why should a historical seven-point stop not be adopted solely because a table favored it?
Check your answers — practice 4
  1. 9 / 6 = 1.50R before costs, using the fixed target and stop.
  2. 6.5 / 15 = 43.33%. That formula assumes only the specified win/loss outcomes and uniform cost.
  3. Zero. One contract’s $305 planned amount already exceeds the budget.
  4. The old dataset, volatility, price level, filters, costs, and execution model may differ. A historical optimum is not a current recommendation.

5. Audit the real-world examples

Read: pp. 20–38. Goal: extract decision principles without copying selected trades or filling in undisclosed rules.

The case chapter includes winning fades, a loss despite a completed fill, a stopped fade, an avoided zone, a continuation trade, and a reversal after the fill. Study the actual charts in the book. For each, make three columns: information known before entry, decisions made during the session, and explanations written afterward.

Andrews describes a 09:25 decision snapshot and market entry at 09:30. The opening price can differ from that snapshot, and a market order’s execution can differ from the opening chart print. Neither the selected case narratives nor our indicator establish that every opening print was executable.

Book case groupPrinted pagesOriginal study task
Method and Otis overview20–22List disclosed rules separately from unavailable subzone parameters.
Fades and partial exits, Figures 15–1822–28Identify which decisions were fixed in advance and which changed after entry; compute weighted returns rather than adding legs.
Filled gap but losing extended-target trade, Figure 1928–29Explain why reaching the prior close need not mean the chosen trade made money.
Other fade decisions, Figures 20–2229–34Separate valid-signal losses, reduced sizing, and later continuation decisions.
Avoided below-low/prior-up-day case, Figure 2334–35Treat the BLUD label as known location; test rather than inherit its historical ranking.
Go-with case, Figure 2435–37Distinguish trading with the gap from fading it; record that a complete entry algorithm is not supplied.
Fade-the-fill case, Figure 2537–38Treat the later reversal as a new setup with its own entry and risk plan.

Original example: a filled gap can still lose

Fictional long fade: open and assumed fill 4,980, prior close 5,000, extended target 5,010, eventual end-of-session exit 4,975.

StepOriginal calculation or observationMeaning
Mid-session high5,002The gap-fill reference was crossed.
Extended target5,010 not reachedA full-gap event does not satisfy this exit plan.
Exit outcome4,975 − 4,980 = −5 pointsThe hypothetical trade loses before costs.
Alternative full-fill exitA separate protocol targeting 5,000Do not replace the original exit after seeing the result.

Keep this distinction: Keep the gap event and the trade outcome in separate columns.

Original example: weight the scale-out correctly

Fictional short: 50% exits at +4 points, 30% at +7, and 20% at −3. All legs refer to the same initial position.

StepOriginal calculation or observationMeaning
Weighted result0.50 × 4 + 0.30 × 7 − 0.20 × 3 = 3.50 pointsPer initial contract-equivalent, before costs.
Naive addition4 + 7 − 3 = 8 pointsIncorrect because it ignores the different position fractions.
Execution requirementActual leg quantities, prices, and costsSmall positions may not support the stated fractions.

Keep this distinction: Scale-out averages use the original position weights.

The book sometimes explains reversals through trapped traders or short covering. Those are hypotheses about participants, not facts established by the OHLC chart alone. Likewise, the go-with example refers to shorting “up” gaps in its seasonality discussion despite describing a down-gap trade. Flag the mismatch; do not silently convert it into a verified direction-specific statistic.

Practice 5

  1. Why is Figure 19 especially useful to this workbook?
  2. Calculate the original scale-out result.
  3. After a failed fade, is an opposite-direction entry automatically justified?
  4. What would be needed to recreate Otis faithfully?
Check your answers — practice 5
  1. It separates a reached gap-fill level from the outcome of a trade seeking an extended target.
  2. 3.50 points per original position unit before costs; the leg fractions sum to one.
  3. No. It is a new setup requiring an independently defined entry, risk, and exit rule.
  4. Complete subzone boundaries, filters, stop/target choices, data/session definitions, timing rules, and a full validation dataset; the supplied book does not disclose them all.

6. Turn trading tips into decision rules

Read: pp. 39–40. Goal: retain useful process advice while testing broad claims.

The tips combine useful reminders about selectivity, position size, and payoff with strong empirical claims about the open and news. Convert each actionable claim into a recorded comparison rather than treating a memorable phrase as a universal rule.

Source themeOriginal operational responseWhat remains uncertain
Know the locationWrite prior OHLC, direction, and opening band before revealing subsequent barsWhether a specific band predicts a better net outcome today.
Be selectivePredeclare eligible bands, minimum size, and data-quality rejection rulesWhether fewer opportunities improve results per candidate.
News is noiseLog scheduled releases and unexpected events; compare predeclared event versus non-event groupsThe author’s choice to ignore news does not prove execution risk or outcomes are unaffected.
Enter at the openCompare a clearly defined opening-order protocol with a fixed-delay protocol on the same candidatesDelayed entries do not literally catch every loser or miss every winner.
Use extended targetsDefine the extension distance and invalidation rules before entryA farther target can reduce hit rate and expose unrealized gains.
Trade manageable sizeSpecify a planned loss budget, drawdown response, and pause criteriaPsychological comfort does not guarantee adequate risk control.

“No trade” is a valid outcome. A plan can reject a day because the reference session is incomplete or the setup definition is unresolved. Distinguish that from skipping an eligible signal because of discomfort, so the journal can reveal whether the method or its execution changed.

Practice 6

  1. How would you evaluate the source’s news claim?
  2. What must be kept constant when comparing entry timing?
  3. Why count eligible days with no entry?
  4. Does moving a target farther away after a near-stop automatically improve expectancy?
Check your answers — practice 6
  1. Record event categories and timestamps using a predefined rule, hold the remaining protocol constant, and compare outcomes and execution sensitivity on later data.
  2. The candidate set, instrument, date interval, stop/target framework, session definition, and cost assumptions; only the delay should change.
  3. They reveal opportunity coverage and selection effects. A high per-trade score can conceal many missed candidates.
  4. No. That is a changed decision rule; it requires evidence and may sacrifice attainable exits. The near-stop narrative alone is not a causal test.

7. Build a research and practice plan

Read: pp. 41–50. Goal: finish with a research protocol another person could audit.

Andrews recommends selecting a market, organizing historical observations, writing a plan, practicing forward, and only then considering implementation. His caution about overfitting is central: repeatedly tuning zones, stops, and targets can make chance patterns look convincing.

The suggestion to seek at least 30 observations is a starting preference, not a statistical sufficiency test. Four wins out of five is 80%, but changing one outcome changes it by 20 percentage points. Even a larger sample may not represent new volatility conditions or rare losses.

Original example: development results need an untouched check

Fictional research design, not reported performance.

StepOriginal calculation or observationMeaning
Development segment120 sessions used to choose a three-band classificationDocument every attempted variant.
Evaluation segmentNext 60 sessions reserved before any outcomes are viewedFreeze definitions, costs, and data exclusions.
Repeated tuningAfter a weak evaluation, alter the stop using those same 60 sessionsThose sessions have now become development data.
Next stepUse new untouched data or report the revised result as exploratoryDo not call a retuned result independent confirmation.

Keep this distinction: A test set stops being untouched once it influences the rule.

Use the glossary to reconcile definitions, especially win rate, profit factor, and session close. Use the bibliography as a list of leads: locate a source lawfully, verify its date and method, and compare its gap definition before combining findings. A citation in a 2008 bibliography is not independent confirmation of today’s profitability.

Practice 7

  1. Is 30 observations a guarantee of a reliable edge?
  2. What belongs in a forward-practice log?
  3. What happens to evaluation data after they are used to retune a rule?
  4. Should a losing streak automatically trigger a size increase to recover?
Check your answers — practice 7
  1. No. Uncertainty depends on outcome variation, dependence between observations, selection, rare events, and the question being estimated.
  2. Every eligible session, decision timestamp, reference values, intended action, observed action, costs or assumptions, omissions, and rule version.
  3. They become development data. Report that honestly and seek a fresh evaluation segment.
  4. No. Follow predeclared loss-budget and pause rules; recovery goals do not establish a justified position size.

Pine Script session map

Research question: where does the new session open relative to the prior session, and when does a completed bar first show a reach of the prior close?

This complete original Pine Script v6 uses indicator() only. It is a descriptive observation tool, not a recreation of Otis and not a broker simulator. Our labels use broad OHLC regions with explicit equality treatment; they contain no inherited historical win probabilities.

What This Indicator Shows

  1. Session definition. Standard 5-minute bars, 09:30 New York open, selectable 16:00 or 16:15 cutoff. Default 16:00 is our study convention; 16:15 is the book-comparison alternative.
  2. Prior reference. OHLC accumulated from consecutive completed bars in that custom window. A prior session missing any required bar or its endpoint is not accepted.
  3. Opening observation. After the 09:30 bar completes at 09:35, record the opening price and prior-close difference. Default qualification is an absolute gap strictly greater than one price unit, adjustable for the chosen market.
  4. Context label. Prior up/down/doji plus opening location outside the range, within a wick, within the body, or exactly on a prior OHLC level. No rule says that any label should be traded.
  5. First reach marker. The first completed bar with low at or below the prior close for a gap up, or high at or above it for a gap down. The opening bar is included; recognition still waits for its close.
  6. Frozen state. Prior levels and opening price remain fixed for that observation session. Only one first-reach marker occurs. The next observed session resets the state; older gaps are not tracked for later-day fills.

The script builds its custom session directly from chart bars and makes no higher-timeframe requests. Developing bars cannot create confirmed labels or alerts. On an extended-hours chart, references are hidden outside the chosen window. On a regular-hours-only chart, line segments may visually connect across the overnight interval because no intervening bars exist; do not read that connector as overnight price activity.

Use the same session and feed across the sample. TradingView’s session documentation (paid link) explains that custom sessions and exchange-defined sessions are distinct. Our New York timezone handles daylight saving, but the script does not recognize holidays, early closes, contract rolls, or a completely absent day in the dataset.

What This Indicator Does Not Show

There are no entries, stop orders, target orders, fills, returns, win rates, drawdowns, or profitability results. A bar crossing a reference is an observed threshold event, not proof that an order would have executed there. The script does not reproduce 09:25 decisions, seasonality filters, multi-day zones, private subzone parameters, or the go-with and fade-the-fill entry methods.

A partial prior observed session invalidates the next reference, so an early-close session is not silently treated as a full session. A completely absent session cannot be detected from the remaining bars; the next visible day may use the last complete observed session. Missing current bars can hide or delay a first-reach observation. Historical feed corrections or changed settings can alter earlier labels. Continuous futures adjustments and rolls require a separate data audit.

For the first loaded session, the script must collect a complete reference before it can label a later session. On ordinary 16:00 sessions that requires all 78 five-minute bars; the 16:15 alternative requires 81. A prior-close reach on the opening bar can display alongside the new-gap marker at 09:35. This does not authorize an earlier entry or establish the event’s intrabar time.

Validation status: This script has not been compiled in TradingView or run against historical data here. Static review checks the intended session state, completed-bar timing, missing-bar handling, and indicator-only structure. No chart behavior or performance result is claimed as verified.

View Pine Script Indicator Code
//@version=6
indicator("CC Understanding Gaps - Session Map", overlay=true, max_labels_count=500)
// Original descriptive session study; no orders, fills, or performance calculations.
string closeChoice = input.string("16:00", "Session cutoff (New York)", options=["16:00", "16:15"])
float minGap = input.float(1.0, "Observe gaps strictly larger than (price units)", minval=0.0, step=0.25)
bool showLabels = input.bool(true, "Label qualifying opens")
string tz = "America/New_York"
if not chart.is_standard or not (timeframe.isminutes and timeframe.multiplier == 5)
    runtime.error("Use standard 5-minute bars. Audit the instrument and session cutoff manually.")
int yy = year(time, tz)
int mo = month(time, tz)
int dd = dayofmonth(time, tz)
int key = yy * 10000 + mo * 100 + dd
int start = timestamp(tz, yy, mo, dd, 9, 30)
int finish = timestamp(tz, yy, mo, dd, 16, closeChoice == "16:15" ? 15 : 0)
bool inside = time >= start and time_close <= finish
var int activeDay = na
var int nextTime = na
var bool collecting = false
var bool priorValid = false
var float so = na
var float sh = na
var float sl = na
var float sc = na
var float po = na
var float ph = na
var float pl = na
var float pc = na
var float refOpen = na
var float refHigh = na
var float refLow = na
var float refClose = na
var float todayOpen = na
var float signedGap = na
var bool eligible = false
var bool observed = false
bool newGap = false
bool firstTouch = false
string zoneText = ""
if barstate.isconfirmed and inside
    if na(activeDay) or activeDay != key
        activeDay := key
        collecting := time == start
        nextTime := start
        refOpen := na
        refHigh := na
        refLow := na
        refClose := na
        todayOpen := na
        signedGap := na
        eligible := false
        observed := false
        if collecting and priorValid
            refOpen := po
            refHigh := ph
            refLow := pl
            refClose := pc
            todayOpen := open
            signedGap := open - pc
            eligible := math.abs(signedGap) > minGap
            newGap := eligible
            bool boundary = open == po or open == ph or open == pl or open == pc
            zoneText := boundary ? "Exact prior level" : open > ph ? "Above prior high" : open < pl ? "Below prior low" : open > math.max(po, pc) ? "Upper wick area" : open < math.min(po, pc) ? "Lower wick area" : "Prior body area"
            string direction = pc > po ? "Prior up" : pc < po ? "Prior down" : "Prior doji"
            if eligible and showLabels
                label.new(bar_index, high, direction + " | " + zoneText + "\nGap " + str.tostring(signedGap, format.mintick), style=label.style_label_down, color=color.teal, textcolor=color.white, size=size.tiny)
        // A partial current session must never leave an older reference valid.
        priorValid := false
        so := open
        sh := high
        sl := low
        sc := close
    if collecting
        if time != nextTime
            collecting := false
        else
            sh := math.max(sh, high)
            sl := math.min(sl, low)
            sc := close
            nextTime := time_close
            if time_close == finish
                po := so
                ph := sh
                pl := sl
                pc := sc
                priorValid := true
    // The opening bar is included, but recognition waits for its completion.
    bool touches = eligible and not observed and (signedGap > 0 ? low <= refClose : high >= refClose)
    if touches
        observed := true
        firstTouch := true
bool show = inside and activeDay == key
plot(show ? refOpen : na, "Prior custom-session open", color=color.new(color.gray, 50), style=plot.style_linebr)
plot(show ? refHigh : na, "Prior custom-session high", color=color.new(color.green, 30), style=plot.style_linebr)
plot(show ? refLow : na, "Prior custom-session low", color=color.new(color.red, 30), style=plot.style_linebr)
plot(show ? refClose : na, "Gap-fill reference - prior custom-session close", color=color.orange, linewidth=2, style=plot.style_linebr)
plot(show ? todayOpen : na, "Current session open", color=color.blue, style=plot.style_linebr)
plot(show ? signedGap : na, "Signed gap in price units", display=display.data_window)
plotshape(newGap, title="Qualifying open recognized at bar close", style=shape.diamond, location=location.abovebar, color=color.teal, size=size.tiny)
plotshape(firstTouch, title="First observed reach of prior close", style=shape.circle, location=location.belowbar, color=color.orange, size=size.tiny)
alertcondition(newGap, "New session gap observation", "Confirmed opening-bar gap observation. Descriptive only; not an entry or fill.")
alertcondition(firstTouch, "First prior-close reach", "A completed bar has reached or crossed the prior custom-session close. Not a verified execution.")

Replay checklist

  1. Compile in TradingView before using the indicator and resolve any reported errors.
  2. Load at least two complete sessions and compare the accumulated OHLC with independently checked intraday bars using the same cutoff.
  3. Advance through 09:35 and verify the frozen opening value, prior direction, and boundary classification.
  4. Find examples of an opening-bar reach, a later reach, no reach, exact one-unit gaps, and exact prior-level openings.
  5. Test missing opening bars, a missing middle bar, an absent final bar, and an early close; document which later references are suppressed.
  6. Reload and compare confirmed markers. Configure named alerts for once-per-bar-close delivery; treat them as observations.

Three controlled experiments

These are our proposed studies, not results supplied by the book. Keep a candidate-level ledger and preserve no-event sessions.

Question and hypothesisChangeHold constant / measureWhat results could mean
Does cutoff choice change the event population? Hypothesis: 16:00 and 16:15 references produce different gap sizes and reach counts.Session cutoff onlySame instrument, raw contract series, dates, five-minute feed, and absolute gap threshold. Record gap size, opening band, qualifying count, first-reach time, and no-reach count.Differences demonstrate definition sensitivity, not which cutoff is intrinsically better.
Does location add information beyond gap size? Hypothesis: some broad opening bands retain different reach frequencies after size matching.Broad zone classification versus size-only groupingSame cutoff, dates, direction, gap-size bins, and event deadline. Record per-bin counts and reach rates; preserve boundary/doji groups. Evaluate on later locked data.A persistent difference may justify deeper study; small cells and regime imbalance can explain apparent effects.
Does target extension compensate for lower hit frequency? Hypothesis: extension trades off hit rate against payoff.Target 0.75 / 1.00 / 1.25 of gap distance from a predefined entry referenceSame eligible candidates, explicit assumed execution, stop model, cutoff, costs, and ambiguity rule. Record target events separately from cost-aware manual P/L, adverse excursion, and coverage.Higher hit rate can still have lower expectancy. This needs a separate execution study; the indicator supplies none of its returns.

For return studies, predeclare order submission time, fill assumptions, stop/target activation, end-of-day handling, costs, and cases where both levels are crossed within one bar. Use finer data or mark those outcomes ambiguous; do not choose whichever sequence makes a variant look better. Do not reuse the same evaluation segment to search many thresholds.

Four reusable worksheets

Copy these into a journal. Distinguish observed values, unknowns, assumptions, and verified executions.

A. Session observation

FieldRecord
IdentityInstrument, contract, date, feed, timezone, adjustment/roll convention
Session09:30 start; chosen cutoff; complete bars? Early-close or missing-data flag
Prior valuesOpen, high, low, close; date of reference; prior direction
Opening valuesOpen; signed/absolute gap; percentage or frozen volatility normalization
ClassificationBroad band; exact-boundary status; doji; rule version
EventFirst reach bar and recognition time; no reach; missing data; no assumed execution

B. Trade and risk plan

FieldRecord
ScopeFictional, hypothetical historical, or verified live record; do not mix labels
EligibilityPredeclared band, size threshold, calendar rule, and decision timestamp
EntrySubmission time, order type, assumed/verified fill, and reason for price difference
RiskStop distance, dollar multiplier, cost allowance, budget, integer quantity
ExitsTarget, extensions, partial weights, time cutoff, activation times
OutcomePer-leg quantities, prices, costs, ambiguity, gaps, realized P/L if actually supported

C. Research design

FieldRecord
QuestionFalsifiable hypothesis, baseline, one changed variable
SampleFixed instrument/date interval; all eligible sessions; excluded-data rules
DefinitionsCutoff, gap formula, zone boundaries, event versus trade outcome
DevelopmentVariants attempted and selection rule; lock date
EvaluationUntouched interval; counts, uncertainty, costs if P/L studied
ConclusionWhat would refute the hypothesis? Missing evidence and next independent check

D. Review and process audit

FieldRecord
CoverageEligible, taken, skipped, no-trigger, and unknown-data counts
TimingAny final-day information used before available? Opening print treated as fill?
ExecutionDeviations from plan, costs, bracket timing, and contract sizing
EvidenceFull-fill events separated from profitable exits; weighted partial outcomes
Risk responseLoss/drawdown threshold, pause rule, and documented action
Next revisionOne justified change on development data; preserve evaluation history

Capstone: build a 30-session gap audit

Select one instrument and 30 consecutive ordinary sessions before revealing outcomes. Thirty sessions is a manageable learning task, not proof of an edge or a minimum that guarantees reliability. Use more data for substantive inference.

  1. Complete the observation worksheet for all 30 sessions, retaining zero/small gaps and rejected-data days in the coverage log.
  2. Classify location before advancing the replay. Compare two cutoff definitions on the same data and explain any changes.
  3. Audit three book cases using known-before-entry / decisions / later-explanations columns. Include the filled-but-losing case and the stopped fade.
  4. Create two original fictional risk plans, one fade and one later setup, with positive stop distances, cost-aware quantities, and adverse-execution scenarios.
  5. Use one controlled experiment and distinguish descriptive reach counts from any separately modeled trade results.
  6. Write a short conclusion naming one supported observation, one alternative explanation, and the evidence still needed.
CriterionPointsRequired evidence
Definitions0–2Correct session, gap, outcome, and boundary conventions
Source understanding0–2All chapter groups addressed; historical claims and missing private rules identified
Calculations0–2Correct expectancy, weighted exits, fill-based reward/risk, and cost-aware sizing
Data integrity0–2Consecutive population, missing data, no-lookahead timing, and no invented executions
Interpretation0–2No claim of proven profits; a locked future comparison and uncertainty stated

Aim for at least 8/10 with no fabricated-fill or future-information errors. Revise any zero-scoring area before expanding the study. The rubric measures understanding and documentation, not readiness to trade.

Final Takeaway

Andrews’ strongest teaching point is that frequency of success, loss size, and exit distance must be evaluated together. Gap location provides a way to organize the question, while the book’s historical tables and selected cases provide hypotheses to investigate. The useful next step is a clean, timestamped study that keeps threshold events separate from executable trade outcomes.


Risk Disclosure: This material is for educational and research purposes only and is not financial or investment advice. Trading, including leveraged futures trading, can result in substantial losses. Historical research, hypothetical examples, and indicators do not establish future profitability or reproduce live execution. Commissions, spreads, slippage, liquidity, gaps, halts, contract rolls, order behavior, and market changes can materially affect results. Planned stop-risk is not a guarantee of maximum loss.

This is an independent educational companion and is not affiliated with, sponsored by, endorsed by, or authorized by Scott Andrews or the publisher.

As an Amazon Associate I earn from qualifying purchases.