Skip to content

Put the max-pain star on the stored real strike; hints follow the monthly expiry - #134

Merged
mspinola merged 1 commit into
mainfrom
claude/max-pain-visualization-compare-60195f
Sep 18, 2026
Merged

mspinola merged 1 commit into
mainfrom
claude/max-pain-visualization-compare-60195f

Conversation

@mspinola

Copy link
Copy Markdown
Owner

Follows mspinola/cotmetrics#45 (merge that first; the hint text describes its behaviour).

Star on MaxPainStrike

The snapshot writer snaps the curve's minimum to a real strike and stores it as MaxPainStrike, but both options panels took the argmin of the 200-point simulated grid and never read that column, so the star, the dashed payout line, the delta arrow and the premium/discount bars could sit up to half a grid step off any real strike (7605.74 vs the stored 7603.93 on the 2026-09-17 ES snapshot). max_pain_point reads the stored strike and interpolates its payout off the curve; both panels go through it, so they agree. Rows without the column fall back to the grid argmin.

Residual: the heatmap's Max Pain Pull comes from cotmetrics.options_data.get_max_pain_for_symbol, which still takes the grid argmin. Not in this PR.

Hints and the default-off rationale

Updated for cotmetrics 0.14.0: snapshots are on the nearest open standard monthly, so the history panel rolls once a month rather than several times a week. It stays in DEFAULT_OFF_PLOTS because the stored series before 2026-09-18 is on the weeklies and has no stretch on one expiry yet; the comment now says exactly that.

docs/data_architecture.md documents the strike ladder file ({symbol}_options_strikes.parquet) that 0.14.0 starts writing; no panel reads it yet.

Tests

4 new in tests/test_max_pain_strike.py (store-free, parquet in tmp_path). Suite 879 passed; ruff 0.15.22 clean at src tests.

🤖 Generated with Claude Code

…thly expiry

The snapshot writer already snaps the curve's minimum to a strike the chain
actually has and stores it as `MaxPainStrike`, but both options panels took the
argmin of the 200-point simulated grid instead and never read that column, so
the star, the dashed payout line, the delta arrow and the premium/discount bars
could all sit up to half a grid step off any real strike (7605.74 against the
stored 7603.93 on yesterday's ES snapshot). One helper, `max_pain_point`, now
reads the stored strike and interpolates its payout off the curve, and both
panels go through it; rows written before the column existed fall back to the
grid argmin.

The two hints and the DEFAULT_OFF rationale follow cotmetrics 0.14.0
(mspinola/cotmetrics#45), where each snapshot is taken on the nearest open
standard monthly rather than the first expiry more than three days out. The
history panel stays opt-in: the roll is now monthly rather than several times a
week, but the stored series before 2026-09-18 is on the weeklies and has yet to
accumulate a stretch on one expiry. data_architecture.md gains the strike
ladder file that release starts writing, which no panel reads yet.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@mspinola
mspinola merged commit 3fe0863 into main Sep 18, 2026
3 checks passed
@mspinola
mspinola deleted the claude/max-pain-visualization-compare-60195f branch September 18, 2026 17:15
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.

1 participant