Skip to main content

GEX Computation

The core analytic layer computes dealer gamma exposure from option-chain open interest, locally and transparently — no opaque vendor numbers.

OutputMeaning
Call wallStrike with the largest positive gamma concentration above spot
Put wallStrike with the largest negative gamma concentration below spot
Gamma flipPrice level where net dealer gamma crosses zero
Normalized GEXExposure expressed on a comparable scale across tickers and time

Computation uses a risk-free rate from FRED, and a calibration step compares computed levels against external reference observations and warns on drift.


Signal Rules

Level-driven entry and exit rules evaluate each reconstructed snapshot. Rules are defined per ticker with explicit, sweepable parameters (for example a wall-buffer distance), so behaviour is tunable and reproducible rather than hard-coded.


Backtest Engine

The engine replays reconstructed snapshots through the signal rules and records simulated trades.

  • Baseline controls — every GEX-rule run is measured against baseline strategies (such as buy-and-hold) so an edge has to be demonstrated, not assumed.
  • Single-parameter sweep — runs a rule across a range of values for one parameter to test whether performance is stable or a fragile peak.
  • Reporting — a run summary, a trade list, and a gate verdict render to an operator-facing report.

Go-Live Gate

The decision to ever route a live order is delegated to a six-condition evaluator. A passing verdict on every target ticker is the only go signal for Phase 2; anything less keeps the project research-only.

#Condition
aTrade count meets a per-ticker floor and the bootstrap confidence interval on per-trade expectancy is strictly positive
bMean expectancy comfortably exceeds the round-trip cost of trading
cMaximum drawdown stays under the configured ceiling
dRisk-adjusted return clears the best baseline, with an escape clause for buy-and-hold tailwinds
ePerformance is stable across the parameter sweep
fTemporal stability — trades are spread across the window and both halves agree in sign with the full window

The gate is the project’s central discipline: it converts “this looks promising” into a falsifiable, per-condition verdict that has to hold before live execution is unlocked.


Notebooks

Three Jupyter notebooks support inspection workflows:

  • Per-trade inspection — a GEX-state timeline with trade entries and exits overlaid.
  • Equity curve — an equity curve with drawdown shading and a separate drawdown panel.
  • Sweep view — P&L, a Sortino approximation, and max drawdown plotted across a single-parameter sweep.

Each notebook builds its own synthetic in-memory fixture, so it runs end-to-end without credentials. An integration test executes all three and scans the rendered output for credential leaks; nbstripout clears output cells on commit.


Tooling & Quality

  • Python 3.12+ with uv for dependency management.
  • Reproducibility — seeded runs make backtests deterministically replayable.
  • Secrets — SOPS + age for the master key, encrypted-at-rest credentials in Phase 2.
  • Pre-commit — notebook-output stripping and an .env/database commit guard, enforced locally.

Role

Sole designer and implementer: the GEX computation and calibration, the per-ticker signal rules, the backtest engine with baseline controls and parameter sweeps, the falsification-first go-live gate, and the credential-safety and environment-resolution layer that keeps live execution fenced off until the evidence justifies it.