Reference/Probability And Regime Calculation Flow

Probability And Regime Calculation Flow

This diagram shows how IV surface snapshots, spot history, and stored gamma history feed the probability engine and regime-conditioned density calculations.

Trader-facing model map

This is the full probability model read from a trader's perspective. It separates market inputs, model transformations, quality gates, conditional overlays, and tradable-screen outputs. The most important interpretation rule is that vanilla density is the market-implied anchor; conditional density is a regime overlay whose weight depends on historical stationarity.

Rendering diagram...

Parameter and tuning map

Parameter / decisionCurrent behaviorTrader interpretationPotential tuning
Requested DTEUI requests 7d or 30d density; backend selects nearest available DTE bucket.Choose the horizon for terminal distribution and forward-return conditioning.Add selectable DTEs or force exact-tenor availability.
Surface timestampLatest usable timestamp inside latest iv_surface snapshot.Ensures one coherent market surface, not a mix of stale hourly surfaces.Allow historical/as-of timestamp selection for replay.
Spot sourcePrefer surface underlyingPrice / indexPrice; fallback to nearest gex_hourly spot.Delta inversion and Black-Scholes pricing are anchored to synchronized price when possible.Choose index vs underlying explicitly, or require surface price.
Risk-free rateRF_RATE = 0.045.Used in Black-Scholes and Breeden-Litzenberger discounting.Make curve-based or configurable by currency/tenor.
Delta-to-strike conversionBlack-Scholes delta inversion when actual strike is missing.X-axis is implied terminal price / implied strike, not necessarily listed instrument strike.Use listed option quotes/strikes or a fitted arbitrage-free smile when available.
Density fitCubic spline over call prices, second derivative, quality gated.Produces vanilla risk-neutral density if call curve is smooth and convex enough.Replace with SVI/SABR/arbitrage-free fit or quote-based call-price interpolation.
Density quality thresholdsGate monotonicity, convexity, negative-density fraction, zero gaps, and local peaks.Bad surface means no authoritative probability output.Tighten/loosen thresholds; expose diagnostics in admin view.
Regime lookbackProbability page uses 730d gex_hourly history.Defines the historical sample for current gamma percentile and conditional returns.90d/180d/365d/730d selectable lookback.
Regime buckets<25 short gamma, 25-75 neutral, >75 long gamma by percentile.Describes whether current gamma state is historically low, middle, or high.Use terciles/quintiles, absolute thresholds, or live strike-level GEX features.
Matching bandCurrent percentile +/- 15 points.Selects historical observations similar to today.Narrow for purity, widen for sample size.
Forward-return horizondte_target * 24 hours.Conditional likelihood is matched to the same horizon as the distribution.Use fixed 1d/7d/30d or expiry-aware trading-hour horizons.
Empirical likelihoodGaussian likelihood from matched historical return mean/stdev.Tilts vanilla density toward historically similar gamma-regime outcomes.Replace with KDE, mixture model, bootstrap, or tail-aware likelihood.
Stationarity testSplit matched returns; KS test plus mean-shift threshold.Decides whether historical conditioning is still trustworthy.Tune KS threshold, mean-shift bps threshold, split method, or rolling windows.
Blend weightsStable 1.0, insufficient 0.70, unstable 0.45.Controls how strongly conditional view can override vanilla.Make blend continuous from diagnostics or trader-selectable confidence modes.
Touch approximationtouch ~= min(1, 2 * finish probability).Fast path-risk approximation, not barrier pricing.Replace with GBM barrier formula, Monte Carlo, or local-vol path simulation.
Candidate screen filtersDTE tolerance, min OI, budget, max positions, objective.Converts density into construction candidates after liquidity filters.Tune budget, OI threshold, DTE window, objective, and edge/risk constraints.

Trader reading order

  1. Check density quality first. If the vanilla density is degraded, ignore conditional, touch, and candidate outputs.
  2. Read vanilla density as the market-implied baseline.
  3. Read current gamma regime and stationarity before trusting conditional adjustments.
  4. Compare conditional mean shift and shape versus vanilla.
  5. Use touch probabilities as approximate path-risk levels, not exact barrier probabilities.
  6. Treat candidate-screen rows as construction diagnostics only after density quality, stationarity, and liquidity filters are acceptable.

Model confidence gate

Rendering diagram...

Probability flow

Rendering diagram...