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 / decision | Current behavior | Trader interpretation | Potential tuning |
|---|---|---|---|
| Requested DTE | UI 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 timestamp | Latest 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 source | Prefer 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 rate | RF_RATE = 0.045. | Used in Black-Scholes and Breeden-Litzenberger discounting. | Make curve-based or configurable by currency/tenor. |
| Delta-to-strike conversion | Black-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 fit | Cubic 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 thresholds | Gate 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 lookback | Probability 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 band | Current percentile +/- 15 points. | Selects historical observations similar to today. | Narrow for purity, widen for sample size. |
| Forward-return horizon | dte_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 likelihood | Gaussian 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 test | Split 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 weights | Stable 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 approximation | touch ~= 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 filters | DTE 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
- Check density quality first. If the vanilla density is degraded, ignore conditional, touch, and candidate outputs.
- Read vanilla density as the market-implied baseline.
- Read current gamma regime and stationarity before trusting conditional adjustments.
- Compare conditional mean shift and shape versus vanilla.
- Use touch probabilities as approximate path-risk levels, not exact barrier probabilities.
- 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...