Skip to content

The OPTIONS QUANT page from public option chains; version 1.2.0 - #23

Merged
wJubran merged 1 commit into
mainfrom
claude/sharp-wozniak-49jry7
Oct 17, 2026
Merged

wJubran merged 1 commit into
mainfrom
claude/sharp-wozniak-49jry7

Conversation

@wJubran

@wJubran wJubran commented Oct 17, 2026

Copy link
Copy Markdown
Owner

What and why

Options Quant was the last page with no producer: it showed nothing out of the box. The terminal now writes {T}_options.json itself. The new module is backend/local_analysis/options.py, and it runs as a new options phase in the local runner. Files are rebuilt every 15 minutes while New York trades and every 2 hours otherwise.

Source and coverage

  • Assets: US500, USTEC, XAUUSD, XAGUSD and XTIUSD, built from the SPY, QQQ, GLD, SLV and USO option chains.
  • Chains come from Yahoo through yfinance. No key is needed; the quotes are delayed about 15 minutes.
  • Expiries: today's 0-DTE until 16:00 New York, the next 8 expiries after today (the swing set), and the next 2 monthlies.

Implied vols

  • Yahoo's IVs are cleaned first: out-of-range values are dropped, and so are its failed solves (exact powers of two such as 0.5).
  • Each expiry then gets one smile, built from the out-of-the-money side.

What the file contains

  • GEX: dealers are assumed long calls and short puts; units are $ per 1% move.
  • Flip: the price where total swing GEX changes sign.
  • Walls: the call wall is above spot and the put wall below.
  • Other levels: HVL (the strike with the most gamma), max pain, and the expected move (ATM straddle).
  • Volatility: 25-delta skew with its velocity, and 30-day IV compared with 30-day realized volatility.
  • Ratios: put/call ratios.
  • Dealer flows: dealer scenarios and the dealer-delta profile, in ETF shares.
  • Ladders and entropy: the structural and gravity ladders, and the entropy card.
  • 0-DTE: today's expiry gets its own blocks.
  • History: the session history series reset at 09:30 New York.

Ladders. The structural and gravity ladders are the UI's own options_0dte_derivations.js, ported line for line, including JavaScript rounding.

Price space. The file uses levels_space: "broker". Every level is multiplied by feed price ÷ ETF price, both taken at the time of the ETF quote. The 5-minute bar at that time is used when the quote is older than 10 minutes, so overnight futures moves don't shift the levels. cfd_ratio_used carries the ratio, as the UI expects.

Not computed yet: the Heat Map surface (probfield), Retail Trap and Vanna/Charm. The READMEs say so.

Also in this PR

  • The version moves to 1.2.0 in VERSION and both package.json files.
  • The CHANGELOG section is now [1.2.0], so the release can be published after merge.

How it was tested

  • python -m pytest in backend/: 215 passed on Python 3.13, 5 of them new (tests/test_options.py). The new tests use a synthetic SPY-like chain, a fake feed at 10× the ETF price, and no network calls. They check:
    • the New York clock and the expiry choice;
    • that walls, flip, spot and expected move land in feed prices;
    • that the stack's aggregate strikes stay in ETF strikes;
    • put skew above call skew;
    • the ±1% / ±0.5% scenarios;
    • the 21-level structural and 18-level gravity ladders, with the spot level flagged;
    • that 0-DTE blocks are present before the close and null after it, and that history is not extended after hours;
    • the cadence, another producer's file being left alone, and an offline download;
    • the route serving the file with _conversion_source: broker_native.
  • A real bug was found and fixed by the tests: the 25-delta put strike lookup had the delta direction reversed.
  • ruff check --select E9,F63,F7,F82 . is clean.
  • Not done: a live yfinance download. Yahoo is blocked in this environment, so the chain format was taken from yfinance's source (Ticker.option_chain).
  • Not done: the UI was not opened in a browser with these files.

Screenshots

None.


Generated by Claude Code

The terminal now writes {T}_options.json for US500, USTEC, XAUUSD,
XAGUSD and XTIUSD from the SPY, QQQ, GLD, SLV and USO option chains
(yfinance), every 15 minutes while New York trades. It covers GEX, the
gamma flip, walls, max pain, HVL, expected move, 25-delta skew, IV
against realized vol, put/call ratios, dealer scenarios, the structural
and gravity ladders (the UI's own formulas, ported) and the entropy
card, for the swing expiries and today's 0-DTE. Levels are in the feed's
price space.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01649i4SjUGvhXrPV3AiNhHN
@wJubran
wJubran merged commit 527b84e into main Oct 17, 2026
6 checks passed
wJubran added a commit that referenced this pull request Oct 18, 2026
The OPTIONS QUANT page from public option chains; version 1.2.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants