$

Technical Analysis Ontology

This document defines the fundamental concepts and relationships in Ghost’s technical analysis system. It establishes the shared vocabulary that all agents use.


Core Concepts

1. Memory Types

Technical analysis reads three types of market memory. (Momentum is a timing layer, not a memory type — it tells you WHEN to act within the structure the other three define.)

Memory TypeAgentWhat It CapturesPersistence
StructuralFibWhere price reversed beforeLong (months/years)
TrendMADirection and trend strengthMedium (weeks/months)
PositioningVWAPWhere participants are positionedShort (days/weeks)

Relationship: Structural memory creates the framework, trend memory shows movement within that framework, positioning memory reveals who is trapped or defending.

2. Levels

A level is a price where market behavior is expected to change.

Level Taxonomy:
├── Support (price expected to bounce)
│   ├── Structural (Fib retracements, prior lows)
│   ├── Dynamic (moving averages, trendlines)
│   └── Positioning (VWAP where buyers defend)
├── Resistance (price expected to reject)
│   ├── Structural (Fib extensions, prior highs)
│   ├── Dynamic (moving averages, trendlines)
│   └── Positioning (VWAP where trapped sellers exit)
└── Neutral (inflection points)
    └── Pivots, mid-points, value areas

Level Strength is determined by:

3. Confluence

Confluence occurs when multiple independent sources identify the same price zone.

Confluence Strength (Fib — computed by _calculate_confluence_zones() in timeframe_fibs.py):
├── STRONG:    3+ timeframes, OR 2+ with monthly, OR 10+ fibs from 2+ timeframes
├── MODERATE:  2 timeframes, OR 5+ fibs clustered
└── WEAK:      Single timeframe only
Clustering tolerance: 0.75% — levels within this % of cluster midpoint are grouped.
Pre-calculated from ALL stored fibs, filtered to near-price zones for agent prompts.

Confluence Strength (Cross-Agent):
├── STRONG:    3+ agents agree (Fib + MA + VWAP)
├── MODERATE:  2 agents agree
└── WEAK:      Single agent only

Confluence Types:

4. Epochs

An epoch is a meaningful price movement worth measuring.

Epoch Requirements:
├── Magnitude: Minimum move size (varies by timeframe)
│   ├── Monthly: 30%+ moves
│   ├── Weekly: 15%+ moves
│   ├── Daily: 5-15% moves
│   └── Intraday: Session ranges (no minimum)
├── Duration: Sustained movement (not noise)
└── Significance: Clear swing high/low boundaries

Epoch Anatomy:


⚠️ THE 50% RULE (CRITICAL)

The 50% level is REFERENCE ONLY — it is NOT a structural level.

LevelStatusUsage
38.2%StructuralList in key S/R
50%ReferenceUse only to describe location (“price between 50% and 61.8%“)
61.8%Structural (Golden Ratio)The real floor/ceiling — always list

Do NOT list 50% in “key support/resistance” outputs. The 61.8% golden ratio is the true structural level. See FIB_HERMENEUTICS.md for full details.


5. Regime

A regime describes the current market state.

Regime Types:
├── Trend Regime (from MA)
│   ├── Bullish: Price > stacked MAs
│   ├── Bearish: Price < inverted MAs
│   └── Tangled: MAs interleaved (choppy)
├── Session Regime (from VWAP)
│   ├── Buyers control: Closes above VWAP
│   ├── Sellers control: Closes below VWAP
│   └── Contested: Mixed closes
└── Momentum Regime (from Momentum)
    ├── Strong bullish: MACD > 0, histogram expanding
    ├── Strong bearish: MACD < 0, histogram expanding
    └── Transitional: Crossover imminent

6. Positioning

Positioning maps where market participants are located relative to price.

Position States:
├── Trapped (underwater)
│   ├── Location: AVWAP above current price
│   ├── Behavior: Will sell rallies to escape
│   └── Creates: Supply/resistance
├── Defending (profitable)
│   ├── Location: AVWAP below current price
│   ├── Behavior: Will buy dips to add
│   └── Creates: Demand/support
└── Neutral
    ├── Location: AVWAP near current price
    └── Behavior: Unpredictable

7. Signals

A signal is an actionable indication from an indicator.

Signal Taxonomy:
├── Momentum Signals
│   ├── Divergence (price vs indicator disagreement)
│   ├── Crossover (indicator lines crossing)
│   ├── Extreme (overbought/oversold)
│   └── Squeeze (volatility compression)
├── Structural Signals
│   ├── Level test (price at key level)
│   ├── Breakout (level violated)
│   └── Rejection (level defended)
└── Timing Signals
    ├── Confirmation (multiple signals align)
    ├── Warning (early reversal sign)
    └── Invalidation (thesis broken)

8. Pattern Memory (Playbooks)

A playbook is a Bayesian model of a recurring market pattern, calibrated from historical instances. Where Fib, MA, and VWAP agents read real-time market memory (structural, trend, positioning), playbooks read compounded historical memory — what has happened on prior sessions that match today’s setup, and what that implies for today’s outcome probability.

What a Playbook Is

A playbook is a versioned YAML artifact per ticker module that encodes:

FieldWhat it captures
Definition criteriaRules used to identify historical instances from OHLCV data. NOT predictive signals — they are definitional and have likelihood ratio of 1.0 by construction.
PriorBase rate of the pattern firing on any given session (empirical frequency across YTD trading days).
SignalsObservable features with Bayesian likelihood ratios per signal. Mechanical signals have likelihood_if_fires and likelihood_if_no_fire computed from data. Narrative signals have neither — the LLM evaluates them qualitatively at runtime.
Historical outcomesAggregate outcome counts across instances (e.g., recovered at T+2, reached intraday high at T+5) used to compute posterior outcome rate.
Historical instancesEach with per-signal tri-state values (present/absent/unknown) and outcome measurements. Audit trail plus calibration data.
Failure conditionsDocumented known failure modes (e.g., “Q4 earnings overhang breaks the accumulation thesis”) that modify LLM interpretation when detected.
CorrelationsPairwise overlap with other playbooks. Some correlations are structural (1.0 when one playbook is a derived view of another) vs empirical.

Loaded playbooks produce two numbers at runtime: posterior firing probability (how likely this pattern is active today, computed via Bayes from the prior and the observed signals) and posterior recovery rate (given the pattern is active, what’s the historical rate of the desired outcome, computed via Beta-Binomial shrinkage).

Signals: Mechanical vs Narrative

Playbook signals divide into two types, each with different handling in the Bayesian inference layer:

Signal TypeAvailabilityBayes handlingExamples
Mechanicalyfinance, options_chain, intraday_flow — computable from dataIncluded in posterior math via likelihood ratiosprior_day_keltner_squeeze, gamma_environment_negative, range_position_lower_third
Narrativellm_runtime — evaluated qualitatively by LLM at runtimeSkipped from posterior math. Tracked per-instance as audit trail only.new_narrative_cover, weekend_binary_risk, catalyst_follow_through

The schema enforces this split. Mechanical signals MUST have both likelihoods set. Narrative signals MUST NOT have likelihoods. The inference layer skips narrative signals by signal_type check, not by absence from the conditions dict — they’re passed through to the prompt as context for the LLM consumer.

This separation preserves epistemic honesty. Bayesian math is for computable, likelihood-calibrated signals. Qualitative judgment (e.g., “is this a real catalyst?”) belongs in the LLM’s interpretive layer, not in a likelihood ratio pulled out of thin air.

The Tri-State Model

Each historical instance records per-signal values as a tri-state:

StateMeaningBayes handling
presentSignal was directly observed in the instanceContributes positive likelihood ratio
absentSignal was directly observed NOT to be presentContributes negative likelihood ratio
unknownSignal could not be observed (data unavailable, outside research window)Skipped entirely. Does NOT contribute negative likelihood.

The critical distinction is between absent and unknown. Marking a signal absent when we can’t actually observe it would systematically bias posteriors downward — the playbook would be penalized for our inability to see the signal. The unknown state preserves the option: “we don’t know, don’t count it either way.”

This matters most when historical data is uneven. The early VST stop mine instances (Jan-Mar 2026) have options/flow signals marked unknown because GCS reports only go back to April. The Apr 2 and Apr 9 instances have them present because the reports exist. The likelihood estimation counts known instances (present + absent) in the denominator, not total. This is an epistemic choice, not a convenience — it’s the honest treatment of missing data.

Calibration Regimes

Playbooks fall into one of three calibration regimes, determined by what data is available and how the negative pool is defined:

RegimeDescriptionNegative poolExample
1. Broad-market discriminationCalibrated against the broad YTD non-instance pool. Strong individual likelihood ratios possible when the pattern is common enough.All YTD trading sessions NOT matching the positive criterionpre_mine_setup (9 positives vs 58 negatives), narrative_cover_rotation (5 positives vs 63 negatives)
2. Within-population discriminationCalibrated within a conditioned population by outcome. Small samples with transparent weakness. Functions as a context flag rather than a high-discrimination signal.Members of the conditioned population with the OPPOSITE outcomerecovery_t_plus_2 (5 mines recovered vs 3 mines failed), mirror_session_pair (5 vs 3)
3. Live-capture onlyPublic historical data does not show the pattern — must be observed in real time via broker-grade feeds. Deferred to the Research Backlog until live capture accumulates enough instances.To be determined once calibration data existsmine_t1_shakeout (pre-market wick not visible in yfinance), capitulation_catalyst_gap (3 seed instances, below threshold)

The regime determines the shape of discrimination and the appropriate expectations for the LLM consumer. A Regime 1 playbook firing at 70% posterior is a strong directional signal. A Regime 2 playbook firing at 70% posterior is a weaker context flag. The LLM should reason differently about them.

Definition Criteria vs Signals — The Critical Distinction

Every playbook has a definition_criteria field separate from its signals list. This distinction is easy to conflate and produces degenerate playbooks if confused.

Definition criteria are the rules used to IDENTIFY historical instances of the pattern. They are not predictive signals. By construction, every positive instance satisfies the definition criteria with probability 1. Including them as signals would produce likelihood ratios of 1.0 / likelihood_if_no_fire — tautological, overconfident, and uninformative.

Signals are observable features that VARY across instances and discriminate positive vs negative pools. They are the things the Bayesian layer actually reasons over.

Example — pre_mine_setup:

The recovery_t_plus_2 review caught a tautology where a signal was equivalent to the outcome metric by construction — same failure mode, different expression. Always verify empirically that signals have non-degenerate likelihood ratios before shipping a playbook.

Sister Playbooks and Directional Symmetry

Many market patterns have directional mirrors that the initial framing misses. A stop mine runs both ways — long-side (rally→fade, trap longs) and short-side (flush→squeeze, trap shorts) are mechanically symmetric but structurally distinct (close in opposite quartiles). If a playbook is built for one direction, the mirror should be scanned explicitly:

Original playbookDirectional mirror
pre_mine_setup (long-side, rally→fade, close bottom quartile)short_mine_setup (short-side, flush→squeeze, close top quartile)
recovery_t_plus_2 (long-side recovery to upside)Possible short_mine_recovery_t_plus_2 sister — not yet built

Sister playbooks have disjoint populations (no session can be both by criterion) but share the same mechanical principle. They are documented as a matched pair in the library and may be consolidated into a single symmetric playbook in a future refactor.

Cross-Playbook Coupling

Playbooks are not always independent. Some are derived views of others — they operate on the same underlying population with different evaluation timing or different outcome framing. Their correlation is structurally 1.0, not 0.78.

Example: recovery_t_plus_2 is a derived view of pre_mine_setup. Every instance of recovery_t_plus_2 is BY DEFINITION an instance of pre_mine_setup (the 9 mine dates are the same). They evaluate at different T_offsets (T+0 for setup, T+2 for recovery) and predict different outcomes (the mine pattern vs the recovery pattern), but they are coupled through their shared population.

The LLM consumer must treat coupled playbooks as a pair, not as independent signals. The correlations field in each playbook’s YAML captures this explicitly — a value of 1.0 means “this playbook is structurally derived from the referenced one; do not double-count their posteriors.”

The Research Backlog Lifecycle

Not every observed pattern becomes a playbook. Patterns that fail empirical verification enter a Research Backlog — a holding area for candidates that require more data or a different approach.

Observed pattern


Empirical scan on YTD data

  ├─ 0-2 instances ────────► Research Backlog (defer, grow via live capture)

  ├─ 3-4 instances ────────► Regime 2 consideration OR Research Backlog

  └─ 5+ instances ─────────► Build queue (graduates to the library)

The Research Backlog entries are documented with: the pattern description, the seed instances (if any), the specific obstacle to formalization, and a clear maturity path. Sub-task F’s online feedback loop captures live instances over time. When a backlog entry accumulates enough data, it graduates to a real playbook via a future build session.

The backlog is a first-class knowledge artifact, not a todo list. It represents empirically-validated observations that the current data can’t yet support as formal playbooks — valuable knowledge held in escrow.

Scale Invariance — playbooks operate at multiple timeframes

Pattern memory is scale-invariant. The same accumulation pattern (bait → distribution → structural support → catalyst exit) operates at multiple timeframes — intraday, single-session, multi-day, multi-week, multi-month — with scale-specific criterion thresholds. This is exactly parallel to Fib retracements operating at multiple epochs (monthly / weekly / daily / intraday) with epoch-specific magnitude thresholds.

The Phase 2 playbooks (pre_mine_setup, recovery_t_plus_2, mirror_session_pair, short_mine_setup, narrative_cover_rotation) are valid pattern detectors at the single-session scale. They are not wrong — they are scale-specific instances of a broader canonical pattern.

The canonical playbook (Phase 2.5: accumulation_stop_harvest, authored AFTER Phase 2 push) is a meta-playbook that:

Why this matters: the execution asymmetry between scales is large. Multi-day-scale entry at structural support → exit at catalyst gap open captures 5-8x the return of single-session entry → T+1 swing exit, with the multi-day entry actually being lower-risk because it sits at multi-year structural support rather than intermediate session support.

The epistemic rule: when a pattern’s empirical criterion fails to match an observed event, do NOT immediately conclude “not the pattern.” First ask: “Is this the same pattern at a different scale?” Pattern criteria are scale-specific by design. A criterion built for single-session OHLCV cannot validate or invalidate the same pattern operating at multi-day or weekly scale.

The Jan 7-9 2026 VST event is the canonical example. Pre-compaction analysis classified it as “capitulation, not a stop mine” because Jan 7 had no morning rally (open=high), failing the single-session criterion. The corrected reading: the bait happened on Jan 6 (+4.05% on 1.5x volume — the multi-day-scale “morning”), Jan 7-8 was the distribution phase, the structural support was the multi-year log trendline at $149, and Jan 9 was the catalyst exit (Vistra-Meta direct PPA, gap open +15.8%). Same pattern, different clock.

See docs/PLAYBOOK_METHODOLOGY.md for builder-side guidance on scale-invariant playbook design and docs/PHASE_2_5_CANONICAL_PLAYBOOK_BRIEFING.md for the canonical author’s brief.


Relationships

Memory Hierarchy

          Structural Memory (Fib)

                 │ provides framework for

           Trend Memory (MA)

                 │ shows movement within

        Positioning Memory (VWAP)

                 │ reveals participants within

           Timing Layer (Momentum)

Level-Confluence Relationship

Level ──────────────────────────┐
  │                             │
  │ multiple levels at          │ confirmed by
  │ same price create           │ momentum
  │                             │
  ▼                             ▼
Confluence Zone ◄──────────── Signal

  │ strength determines

Conviction Level

Agent Synthesis Flow

┌─────────────────────────────────────────────────────────────┐
│                    Technical Director                        │
│                                                             │
│  Fib Reading ──┐                                            │
│                │                                            │
│  MA Reading ───┼──► Confluence Detection ──► Trade Plan    │
│                │                                            │
│  VWAP Reading ─┤                                            │
│                │                                            │
│  Momentum ─────┘                                            │
└─────────────────────────────────────────────────────────────┘

structural_reading → trade_plan

Each agent outputs a structural_reading object. The exact fields vary by agent, but all include a thesis (1-2 sentence interpretation):

AgentKey structural_reading Fields
Fibcurrent_position, confluence_zones, golden_ratios, structure_quality, next_tests, structural_thesis
MAtrend_regime, extension_status, dynamic_sr, monthly_context, thesis
VWAPpositioning_map, session_regime, accumulation_distribution, trapped_cohorts, thesis
Momentumdivergence_status, sentiment_extreme, momentum_regime, volatility_state, indicator_confluence, thesis

See each agent’s *_HERMENEUTICS.md doc for the full output schema.

The Technical Director consumes all four outputs and produces a trade_plan:

structural_reading (Fib)               trade_plan (Director output)
┌─────────────────────────┐            ┌─────────────────────────┐
│ current_position        │            │ long_zones              │
│ confluence_zones        │ ────────►  │   primary_buy_zone      │
│ golden_ratios           │            │   secondary_buy_zone    │
│ structure_quality       │            │ profit_zones            │
│ next_tests              │            │ risk_management         │
│ structural_thesis       │            │ timing                  │
└─────────────────────────┘            │ agent_evidence          │
         +                             │ chain_of_thought        │
structural_reading (MA)                │ confidence              │
┌─────────────────────────┐            └─────────────────────────┘
│ trend_regime            │
│ extension_status        │ ────────►
│ dynamic_sr              │
│ monthly_context         │
└─────────────────────────┘
         +
structural_reading (VWAP)
┌─────────────────────────┐
│ positioning_map         │
│ session_regime          │ ────────►
│ trapped_cohorts         │
│ accumulation_distrib    │
└─────────────────────────┘
         +
structural_reading (Momentum)
┌─────────────────────────┐
│ divergence_status       │
│ sentiment_extreme       │ ────────►
│ momentum_regime         │
│ indicator_confluence    │
└─────────────────────────┘

The Director cites each agent’s contribution in agent_evidence and chain_of_thought fields.


Concept Definitions

Price Action Concepts

ConceptDefinitionExample
Swing HighLocal maximum with lower highs on both sidesPeak before a pullback
Swing LowLocal minimum with higher lows on both sidesTrough before a rally
Higher HighSwing high above prior swing highUptrend confirmation
Lower LowSwing low below prior swing lowDowntrend confirmation
RetracementPullback within a larger move38.2% pullback in uptrend
ExtensionMove beyond prior swing161.8% extension target

Technical Structure Concepts

ConceptDefinitionExample
SupportPrice level where buying emergesFib 61.8% holds on test
ResistancePrice level where selling emergesPrior high rejected
BreakoutPrice moves through level with momentumClose above resistance
BreakdownPrice moves below level with momentumClose below support
False BreakLevel violated then reclaimedWick below support, close above
RetestPrice returns to broken levelResistance becomes support

Indicator Concepts

ConceptDefinitionExample
DivergencePrice and indicator disagreeHigher price, lower RSI
ConfirmationPrice and indicator agreeHigher price, higher RSI
OverboughtIndicator at upper extremeRSI > 70
OversoldIndicator at lower extremeRSI < 30
CrossoverTwo lines intersectMACD crosses signal line
SqueezeVolatility contractsBollinger inside Keltner

Positioning Concepts

ConceptDefinitionExample
Trapped LongBuyer underwater, wants outBought at AVWAP above price
Defending LongBuyer profitable, will addBought at AVWAP below price
AccumulationInstitutions buyingRising AVWAP slope
DistributionInstitutions sellingFalling AVWAP slope
Session BiasWho controlled the sessionClose vs VWAP position

Market Environment Instruments — The Quartet

Four instruments provide a complete environment read before looking at any individual ticker. Each is normalized and universal:

InstrumentWhat It MeasuresQuestion It AnswersData Function
Williams %RWhere close sits in the high-low range (0 to -100)Position — how far has the market fallen in its own range?get_williams_r() in ghost/tools/market_data.py
VIXImplied volatility of S&P 500 optionsSentiment — how scared are participants?get_vix_data() in ghost/tools/premarket.py
SurprisalAbsolute change in log-odds of prediction market probabilities (in nats)Information Velocity — how fast are beliefs changing?compute_deltas() in ghost/tools/prediction_markets.py
HurstDFA scaling exponent of log returns (0.0-1.0)Persistence — do moves continue or reverse?get_hurst_exponent() in ghost/tools/market_data.py

Position + Sentiment + Information Velocity + Persistence = full environment read.

The key insight: each instrument is universal. %R works on any range. VIX on any fear level. Surprisal regardless of catalyst (0.5 nats is 0.5 nats whether oil, tariffs, or Fed). Hurst classifies regime character (mean-reverting < 0.45, random ≈ 0.5, trending > 0.55) without requiring a price target.

The 1+1=3 reads:

Per-ticker Hurst: The mechanical snapshot also computes Hurst on each ticker’s own returns (ticker_hurst field). NVDA can be trending while SPY is mean-reverting — that’s a different trade than if both align. Per-ticker Hurst answers “does THIS NAME revert?” independently of broad market character.

Yield curve as rate path context: Not part of the quartet (it’s not directly a regime instrument), but the environment layer also fetches FRED 2Y/10Y yields with daily deltas. rate_path_delta_2y_bps shows the bond market’s forward repricing — useful for sectors where rate sensitivity matters (utilities, financials, REITs, growth tech). The Strategist gets this context as yield_curve_data with sector-specific interpretation.

Where they surface:

Market Breadth Concepts

ConceptDefinitionExample
Williams %RLarry Williams momentum oscillator measuring where close sits in the high-low range over a lookback period; 0 to -100 scaleSPY 14d %R: -92 = deeply oversold
Market Breadth RegimeComposite reading of SPY + QQQ Williams %R at 14d and 50d lookbacks — classifies the broad market as oversold, neutral, overbought, or divergentBoth SPY and QQQ 14d below -80 → oversold regime
Breadth TailwindWhen broad market is oversold, dip-buying has structural support from mean reversion forcesWilliams %R oversold + zone_status IN_PRIMARY = high conviction
Breadth HeadwindWhen broad market is overbought, buy zones may not hold because the rising tide is exhaustedWilliams %R overbought + zone entry = size down
Breadth DivergenceSPY and QQQ in different zones — one index oversold while the other overbought, signaling sector rotation rather than broad directionSPY oversold, QQQ neutral → rotation out of tech

Key Principle: Williams %R is a market-regime signal, not a ticker signal. It belongs alongside VIX as a broad environment read that modifies conviction on individual setups. Displayed in the report header next to VIX and tracked as williams_r_regime in the condition accuracy system.

Regime Classification:

RegimeConditionDip-Buying Implication
oversoldBoth SPY and QQQ 14d %R ≤ -80Strong tailwind — market washed out
leaning_oversoldOne index ≤ -80, other neutralModerate tailwind
neutralBoth between -80 and -20No broad signal
leaning_overboughtOne index ≥ -20, other neutralCaution
overboughtBoth SPY and QQQ 14d %R ≥ -20Headwind — zone may not hold
divergentOne oversold, one overboughtSector rotation — read carefully

Prediction Market Concepts

ConceptDefinitionExample
Logit TransformConverts probability percentage to log-odds: log(p / (1 - p)). Normalizes probability space so that changes near 50% (high uncertainty) are correctly weighted as more informative than changes near extremes50% → 0.0 logit, 80% → 1.39 logit, 95% → 2.94 logit
SurprisalAbsolute change in logit between two probability snapshots, measured in nats. The standard Bayesian measure of how much new information arrived50% → 55% = 0.20 nats; 90% → 95% = 0.59 nats
Signal StrengthClassification of surprisal magnitude. major (>0.5 nats) = regime change — cite in conflicts and flags. notable (>0.2 nats) = meaningful repositioning. Below = noiseCeasefire probability 30% → 45% = 0.62 nats = major
Information VelocityHow fast prediction market beliefs are updating — measured by surprisal per day. High velocity means the market is actively repricing a scenario3 consecutive days of >0.2 nats = sustained repricing
AccelerationDelta of logit deltas — whether belief updates are speeding up, slowing down, reversing, or flat. Computed on logit scale, not raw percentagesaccelerating = today’s logit delta > 1.3x yesterday’s; decelerating = <0.7x; reversal = direction flipped
Probability SnapshotDaily snapshot of all tracked prediction market probabilities, saved to Firestore (prediction_market_snapshots/{YYYY-MM-DD}). Enables multi-day delta computationSaved on first ghost run each trading day

Key Principle: Prediction market probabilities are real-money consensus prices on binary events. They outrank headlines and pundit opinions because participants have skin in the game. When headlines say “de-escalation” but ceasefire probability is <50%, the market is NOT pricing de-escalation. Surprisal-based ranking ensures a 2pt move at 5% probability correctly ranks above a 5pt move at 50% — the low-probability event update contains more information because the market was already very confident.

Options Structure Concepts

ConceptDefinitionExample
Max PainStrike where options holders lose mostPrice gravitates here at expiry
DTE (Days to Expiry)Days until options expiration0 DTE = TODAY, strongest magnet
Gamma FlipPrice where dealer net gamma = 0Behavior changes at this level
Structural FlipGamma flip from 1-45 DTE optionsMulti-day positioning bias
Tactical FlipGamma flip from 0DTE options onlyIntraday hedging pressure
Put WallLarge put OI below priceDealers buy dips here (support)
Call WallLarge call OI above priceDealers sell rips here (resistance)
Positive GammaNet long gamma environmentDealers dampen moves (stabilizing)
Negative GammaNet short gamma environmentDealers amplify moves (trending)
OI ConcentrationOI clustered vs diffuse at max pain>25% = strong magnet
Bridge EntryPut wall between Fib zones with positive gamma — dealers buy the sweep, creating mechanical support before the next structural level$155 put wall between primary ($158.42) and secondary ($152.98), gamma positive = stop mine catch
Stop MinePrice sweeps below known support to trigger stops, then reverses when mechanical support (put wall + positive gamma) arrests the flushSweep below $158.42 primary zone caught at $155 put wall, bounces back to entries

Catalyst Mechanism Concepts

ConceptDefinitionExample
Narrative CatalystNews event that changes sentiment; market may or may not reactAnalyst upgrade, earnings, geopolitical event
Mechanical CatalystForced flow event; buying/selling is guaranteed regardless of sentimentS&P 100 addition, ETF rebalancing, index reconstitution
Catalyst TypeClassification of active catalyst: accumulation, distribution, binary, or mechanicalcatalyst_type: mechanical for index addition

Key Principle: Narrative catalysts are probabilistic — the market can ignore them. Mechanical catalysts are deterministic — index funds must execute. When both are present (e.g., index addition during a selloff), mechanical flow provides a floor that narrative fear cannot override. The News Analyst classifies the type; the mechanical structure engine may detect the resulting flow as organic accumulation.

Catalyst Timing Asymmetry: When observable flow (volume, buying type, options positioning) precedes a narrative catalyst by days or weeks, the market priced the catalyst through information channels before the headline. This is not inside information — it’s observable logistics: military deployments visible via satellite, shipping data via AIS, insurance repricing via broker quotes, speculative positioning via CFTC. The calibration question: “Has a similar event happened before, and what did the market learn about what to price?” The probability question: “Each observable channel moves the market’s probability estimate of the downstream consequence — what’s the arc?” See NARRATIVE_FORENSICS.md.

Feedback Loop Concepts

ConceptDefinitionExample
Prompt RegimeVersion tag for a significant prompt strategy change"v6_mechanical_catalyst_2026-03-09" — added mechanical catalyst type for forced flow events (index adds, rebalancing)
Regime IsolationFeedback queries only return predictions from the current regimeOld predictions excluded automatically
Feedback ResetWipe predictions, guardrail stats, and scout scores for a clean slateghost feedback-reset --yes after a major prompt change
Williams %R RegimeMarket breadth condition tracked in feedback loop — oversold, neutral, overbought, divergent, etc.williams_r_regime: oversold when both SPY and QQQ 14d %R ≤ -80
Condition AccuracyHistorical accuracy under specific market conditions82% accuracy when sweep=completed + gamma=positive
Accuracy MultiplierScore adjustment based on condition accuracy1.18x boost for 82% accuracy, 0.70x floor for 45%
Flow-Adjusted ActivationFlow data upgrades WAIT_FOR_ZONE → BUY_NOW when institutional buying confirms near a zoneAbsorption ≥50, organic accumulation ≥60%, bullish delta → BUY_NOW [FLOW]
Flow Score BonusExtra points for confirmed institutional flow near zones+15 extreme flow, +8 strong flow
Scalp-Aware R:RScout uses better of swing/scalp R:R for scoringSwing R:R 0.19 + scalp R:R 3.9 → uses 3.9
Zone DefenseUnconditional historical test of whether daily candles held a zone — “did price hold here?”DEFENDED: 6/6 sessions held zone (25d lookback)
Zone TouchA recorded event when price enters or approaches a zone during a ghost run, stored in Firestore with market conditionsZone touch at $175.55 with gamma=negative, buying_type=organic
Zone Hold RateCondition-aware historical hold percentage — “did price hold here when conditions looked like this?”ZONE HOLD: ▲ 90% (10 touches, gamma_environment, buying_type) → 1.15x
Hold Rate MultiplierScore adjustment based on zone hold rate under matching conditions1.15x boost for 90% hold rate, 0.85x penalty for 43% hold rate
Pass DecayQuantified cost of inaction: what happens when a zone holds and you don’t trade? Measured from 2-year backtest corpus — retest rates, retest hold rates, EV of acting vs passing.EV act $1.49/sh, EV pass $0.00/sh, 22% never returns
Never Returns RatePercentage of held zones that never retest within 20 trading days. When this happens, the trade is gone — no second chance.NVDA 22%, VST 23%
Retest Hold RateWhen a held zone does come back, how often does it hold on the second touch? Degrades significantly from first touch — the structural support (shorts covering, accumulation) is spent.First touch 94%, retest 66% (NVDA)
Signal DensityRatio of ESSENTIAL content to total prompt tokensInterrogation measures this; target: minimize NOISE and PASS-THROUGH
Prompt InterrogationEval process where an LLM classifies its own inputs as ESSENTIAL/USEFUL/PASS-THROUGH/NOISESee INTERROGATION.md and scripts/interrogate/

Key Principle: When prompt strategy changes significantly, old predictions were made under different logic. Their accuracy patterns don’t reflect the new strategy. The regime system prevents this contamination without losing the data (old predictions are preserved, just filtered out).

Trading Philosophy Concepts

Ghost’s trading style has a specific philosophy that informs how analysis becomes action.

ConceptDefinitionExample
PrescientIdentifying setups BEFORE they trigger, then waiting for priceZones defined at 6am; at 2pm price reaches zone, you execute
Long-onlyOnly buy dips; profit from shorts coveringWe don’t short; we buy fear and sell to panicked shorts
Human-in-the-loopGhost provides analysis; human makes final callGhost says “BUY_NOW”; you verify and decide
Dip BuyerWait for price to come to zones; never chaseSetup at $165; price at $172 = WAIT, not “close enough”
Day Desk SynthesisAgent reads KB report + overlays live data + enrichmentTrader asks “what’s actionable?”; agent reads KB zones, checks should_reevaluate(), gives entry/target/stop. Zero LLM cost. See DAY_DESK_REFERENCE.md.

Key Principle: Prescient trading means the work happens BEFORE the trade. Analysis at 6am defines zones; execution at 2pm is mechanical (price hit zone = evaluate entry). Chasing is the opposite of prescient.

Entry Style Concepts

Every dip presents two valid entry framings. Ghost surfaces both; the trader decides which game to play.

ConceptDefinitionExample
Retest EntryBuy the orderly pullback to supportPrice pulls back to $167, buy the zone
Sweep EntryWait for support to break, buy the flush$167 breaks, buy panic at $164
Bridge EntryBuy at put wall between Fib zones when gamma is positive — mechanical support catches the sweepPrimary breaks, put wall at $155 catches sweep, buy the dealer floor
Trigger LevelThe support that will break (retest zone becomes trigger)$167.91 — if this breaks, sweep activates
Flush ZoneWhere panicked longs liquidateVWAP, POC, next support below trigger

Entry Style Characteristics:

AspectRetestSweepBridge
Entry ZonePrimary support zoneBelow broken support (VWAP/POC)Put wall between Fib zones
StopJust below entry zoneBelow flush zoneBottom of next zone below
TargetNext resistance / max painBack to broken levelBack to broken upper zone
R:RWider stop, further targetTighter risk, closer targetDepends on wall-to-zone distances
RiskSupport may not holdFlush may not happenPut wall fails (gamma flips, OI overwhelmed)
PsychologyBuy structureBuy panicBuy dealer mechanics

Key Principle: All three are valid. Ghost presents each with their respective levels and R:R. The trader decides based on tape read and risk tolerance.

RETEST:  Entry $167.91-$169.96 | Stop $167.00 | Target $175.50 | R:R 3.4
SWEEP:   If $167.91 breaks → Entry $164.73-$166.61 | Stop $164.00 | Target $167.91 | R:R 1.3
BRIDGE:  If $158.42 breaks → Put wall catch $155.00 (12,500 OI, γ+) | Target $158.42 | R:R 1.7

Execution Mode Concepts

Ghost supports two execution modes that apply to every setup. The same price level can be a scalp entry, a swing entry, or both.

ConceptDefinitionExample
ScalpShort-duration trade targeting mean reversionBuy overdone dip at $642, sell at VWAP $650
SwingMulti-day trade targeting structural levelsBuy golden ratio at $616, hold for $674
Overdone DipIntraday move that’s mechanically exhaustedDealer unwind into Friday close
Mean Reversion TargetWhere price snaps back to after overdone moveVWAP, POC, prior session VWAP
Structural TargetWhere price travels in a sustained moveFib extensions, prior highs

Mode Characteristics:

AspectScalpSwing
TimeframeMinutes to hoursDays to weeks
Stop LogicBelow OR low, air pocket, absorptionBelow structural level (golden ratio)
Target LogicVWAP, POC, mean reversionFib extensions, prior structure
R:R Threshold>1.0 acceptable>1.5 preferred
TriggerOverdone intraday movePrice at structural confluence
Thesis RequiredNo (mechanical setup)Yes (conviction to hold through noise)

Mode Relationship:

SCALP profits fund SWING conviction

Example path:
  1. Scalp $642 → $650 (bank $8)
  2. Scalp $635 → $645 (bank $10)
  3. Price reaches $616 (structural level)
  4. Swing entry with size (funded by scalp profits, clear head)

Key Principle: A name can have a scalp setup, a swing setup, both, or neither. Ghost should surface all applicable modes.

SituationWhat Ghost Shows
Overdone dip, not at structureSCALP only — mean reversion trade
At structure, not overdoneSWING only — wait for level test
Overdone dip INTO structureBOTH — scalp now, swing if continues
Neither overdone nor at structureWAIT — no setup

Documentation Boundary:

Weekly Expiration Cycle

Options mechanics vary by day of week:

Monday     Tuesday    Wednesday   Thursday    Friday
  │          │           │           │          │
  ▼          ▼           ▼           ▼          ▼
BUILD ──► ADJUST ────► ADJUST ───► PREPARE ─► UNWIND
  │          │           │           │          │
New OI    Positions   Positions   Pre-pin    Hedges
forming   adjust      mature      activity   close
DayDealer ModeMax Pain WeightTactical Flip
MondayBUILDINGLOWN/A
Tue-WedADJUSTINGLOW-MEDIUMN/A
ThursdayPREPARINGMEDIUM-HIGHPREVIEW
FridayUNWINDINGHIGHCRITICAL

Key Principle: The same data means different things depending on where you are in the weekly cycle. Friday’s 0DTE structure dies at close; Monday starts fresh.

Deep Dive: See OPTIONS_HERMENEUTICS.md for complete day-by-day interpretation rules, including:


Agent Responsibilities

AgentReadsOutputsKey Concepts
FibStructural memoryConfluence zones, golden ratiosEpoch, retracement, extension
MATrend memoryRegime, dynamic S/R, extensionStack, cluster, slope
VWAPPositioning memoryTrapped/defending, session regimeAVWAP, cohort, accumulation
MomentumTiming signalsDivergence, extremes, confluenceRSI, MACD, squeeze
DirectorAll of aboveSynthesized trade planConfluence, conviction

Two-Layer Architecture: Morning Analysts + Day Desk

Ghost operates as two layers with distinct roles:

Layer 1: Gemini Agents (Morning Analysts)

The multi-agent ensemble (Fib, MA, VWAP, Momentum, Directors, Strategist) runs as a batch analysis — typically once in the morning via ghost run or the 7 AM scheduled run. These agents:

Layer 2: Claude Code Agent (Day Desk)

The Claude Code agent is the trader’s primary interface throughout the day. It:

The Interaction Model

7 AM:    ghost run NVDA          → Gemini agents analyze → KB updated
         ghost run VST           → Gemini agents analyze → KB updated

Day:     Trader asks Claude Code  → Reads KB + calls tools ad hoc
         "What's actionable?"    → Reads all KB entries, reasons
         "Where's the zone?"    → Calls get_options_levels(), math
         "Did gamma flip?"      → Calls analyze_oi_gamma()
         "Price at $175, am I in?" → Math: $175 vs zones
         "Things changed, rerun" → ghost run NVDA (only when needed)

Signal Classification

80% of Ghost’s signals are deterministic — computed by tool functions with zero LLM cost. 20% are interpretive — require Gemini agent reasoning. See docs/SIGNAL_AUDIT.md for the full mapping.

TypeExamplesCostWhen computed
DeterministicRSI, MACD, MA stack, %R, VIX regime, gamma, max pain, surprisal, zone statusZero LLMAny time (ad hoc tool calls)
Interpretive”Which epochs matter?”, “Who’s trapped?”, “What’s the dominant narrative?”, entry/exit synthesisGemini LLM callMorning run (or on-demand rerun)

ghost mechanical TICKER

A zero-LLM-cost quantitative snapshot calling all deterministic tool functions. Returns structured data (zones, MA regime, momentum, options, flow, environment, ticker_hurst, enrichment) that Claude Code reads for instant triage. See docs/SIGNAL_AUDIT.md for the output schema.

Canonical Price Source

get_current_price(ticker) in ghost/tools/market_data.py is THE price function for all code paths. Uses 1-minute intraday history (reliable across all sessions including pre-market and after-hours). NEVER use fast_info.last_price, fast_info.previous_close, or stock.info["currentPrice"] — they return stale (prior close) data. This rule was earned through 3 incidents of bad analysis from stale prices. All internal price helpers (mechanical.py, full_stack.py, trigger.py) delegate to it.

When to Rerun the Full Stack

The full Gemini stack (ghost run) should only rerun when the thesis has changed — detected by has_thesis_changed() in the event detection layer, or when the trader explicitly asks. Signals that warrant a rerun:

Signals that do NOT warrant a rerun:


Anti-Concepts (What Things Are NOT)

Levels Are Not:

Confluence Is Not:

Signals Are Not:


Foundational

Per-Agent

Operational

Practice