Skip to content

/analysis: Commercial flow strip on the Positioning Index panel; Speculator line removed - #144

Merged
mspinola merged 1 commit into
mainfrom
claude/commercial-flow-strip
Sep 27, 2026
Merged

mspinola merged 1 commit into
mainfrom
claude/commercial-flow-strip

Conversation

@mspinola

Copy link
Copy Markdown
Owner

Replaces the Speculator line and its strip (from #142) on the /analysis Positioning Index panel with a Commercial flow strip. Needs mspinola/cotmetrics#53 (0.15.1) merged first; the floor moves to 0.15.1.

Why. The Speculator line's weekly flow tracked Legacy Non-Commercial at 0.81 to 0.96 on physicals and major currencies (docs/analysis/2026-09-26-cot-roles-vs-legacy-propadj.csv in cotmetrics), so on most markets it repeated the blue line; where it differed (equity index, Treasuries) the gap described composition, which a sentence says better. The strip moves to the leg every setup in the app is triggered on: the Commercial index at an extreme, and on equities the only leg utils.is_setup reads.

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

  • The three Legacy lines as before, no fourth line.
  • One strip below the index's zero: the Commercial leg's weekly net change over its own 52-week sd, blue when commercials net buy, red when they net sell, zero near the background, clipped at 3. A "flow z" tick names it; its hover gives the z and contracts.
  • The Commercial line's hover carries the week's flow beside the index: Commercial : 96 · flow z +0.94 (net +13,537 contracts).
  • A one-line note, only where there is something market-specific: "Equities: setups read Commercial only" and how retail (Non-Reportable) behaves on the market.

The % of OI and Raw vs %OI variants and the grid view are unchanged. Supersedes #143.

Verification: suite 907 passed, 10 store-free tests in tests/test_flow_strip.py (one drives the real stack callback), ruff clean. Looked at in the running app on Gold (hover above; note "retail (Non-Reportable) moves with price here") and S&P 500 (note "Equities: setups read Commercial only, retail (Non-Reportable) does not move with price here").

🤖 Generated with Claude Code

…tor line removed

The Speculator line tracked Legacy Non-Commercial at 0.81 to 0.96 on physicals
and major currencies, so on most markets it repeated the blue line; where it
differed (equity index, Treasuries) it described composition, better said in
words. The strip moves to the Legacy Commercial leg: every setup is triggered
by the Commercial index at an extreme, and on equities it is the only leg the
gate reads.

- components/flow_strip.py (was speculator_traces.py): the Commercial leg's
  weekly flow z below the index panel's zero, blue buying, red selling,
  clipped at 3; the Commercial line's hover carries the week's flow beside its
  index ("96 · flow z +0.94 (net +13,537 contracts)"); a one-line note says
  equity setups read Commercials only and how retail behaves on the market.
- Reads CotIndexer.get_commercial_flow_data (cotmetrics 0.15.1, floor moved);
  fetched only for a raw index panel. SPECULATOR_SLOT removed.
- Supersedes #143 (the Speculator-line hover).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@mspinola
mspinola marked this pull request as ready for review September 27, 2026 02:26
@mspinola
mspinola merged commit c058f15 into main Sep 27, 2026
3 of 6 checks passed
@mspinola
mspinola deleted the claude/commercial-flow-strip branch September 27, 2026 02:26
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