Skip to content

/analysis: Speculator series and a flow-z strip on the Positioning Index panel - #142

Merged
mspinola merged 1 commit into
mainfrom
claude/cot-speculator-series
Sep 27, 2026
Merged

mspinola merged 1 commit into
mainfrom
claude/cot-speculator-series

Conversation

@mspinola

Copy link
Copy Markdown
Owner

The cot-analyzer half of "Scope, restated v2" (cotmetrics docs/handoffs/2026-09-26-cot-flow-states-cross-universe.md): one role series per market, added to the existing Positioning Index panel on /analysis, and nothing else. Replaces the withdrawn Flow view (#140, closed). Draft until mspinola/cotmetrics#52 (0.15.0) merges.

What the panel gains (raw basis, single-market stack):

  • Speculator (members): the positioning index of the cohorts cotmetrics' FlowRoles table measures as this market's speculator, at the same per-symbol lookback as the Legacy lines. Gold and Corn: Managed Money. Euro: Asset Manager + Leveraged Funds. Palette slot 5, distinct from the three Legacy legs in every palette.
  • One flow-z strip under the lines, inside the panel below 0: the speculator net's weekly change over its own 52-week sd, blue buying, red selling, zero close to the background, clipped at 3. A "flow z" tick names it; the hover gives the z and the net contracts.
  • Retail as a label: Legacy Non-Reportable is the same data as retail, so rather than a duplicate line the panel says how retail behaves on the market (from the same table). ZT, the one market with no speculator role, gets no line or strip and the label says Non-Commercial stands in.

Unchanged: the % of OI and Raw vs %OI variants, the market grid view, every other panel. The page asks cotmetrics for the series only when a raw index panel is drawn.

One behaviour change outside the panel's own code: the clientside autoscale now leaves an axis alone if it carries a heatmap. Fitting the index axis to its lines in a zoomed window cut the strip off, so the index panel now keeps its 0 to 100 scale on zoom (Exposure already pins its index panels the same way).

Verification: suite 909 passed (897 on main), 12 new store-free tests in tests/test_speculator_traces.py (frames built through cotmetrics' own functions; one drives the real stack callback with a stub indexer and checks the % of OI panel does not fetch); ruff clean. Looked at in the running app on Gold, Corn and Euro. check_dep_floors stays red until cotmetrics#52 merges.

Not built (outside the requested scope): the Legacy back-fill of the speculator series before 2006.

🤖 Generated with Claude Code

…dex panel

"Scope, restated v2" (cotmetrics cross-universe handoff): one role series per
market, added to the existing panel, nothing else.

- The raw-basis Positioning Index panel gains "Speculator (<members>)", the
  positioning index of the cohorts cotmetrics' FlowRoles table measures as the
  market's speculator (Managed Money on Gold and Corn, Asset Manager plus
  Leveraged Funds on the Euro), at the same per-symbol lookback, in palette
  slot 5, which differs from the three Legacy legs in every palette.
- One strip under the lines, inside the panel below its zero: the speculator
  net's weekly change over its own 52-week sd, blue buying, red selling, zero
  near the background, clipped at 3; a "flow z" tick names it.
- Retail is a label, not a line: Legacy Non-Reportable is the same data, so
  the panel says how retail behaves on the market (moves with price, does not,
  moves against it) from the same table. Where the table names no speculator
  (ZT) there is no line or strip and the label says Non-Commercial stands in.
- Fetched only when a raw index panel is drawn (CotIndexer.get_speculator_data);
  the % of OI and grid views are unchanged.
- The clientside autoscale leaves an axis carrying a heatmap alone: fitting the
  index axis to the lines in a zoomed window cut the strip off. The index
  panel therefore keeps 0 to 100 on zoom.

cotmetrics floor 0.15.0 (mspinola/cotmetrics#52).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@mspinola
mspinola marked this pull request as ready for review September 27, 2026 00:30
@mspinola
mspinola merged commit 2d33270 into main Sep 27, 2026
3 of 6 checks passed
@mspinola
mspinola deleted the claude/cot-speculator-series branch September 27, 2026 00:30
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