Skip to content

cotmetrics 0.15.1: Legacy Commercial weekly flow for the Positioning Index strip - #53

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

mspinola merged 1 commit into
mainfrom
claude/commercial-flow

Conversation

@mspinola

Copy link
Copy Markdown
Owner

The cotmetrics half of moving the /analysis Positioning Index strip from the Disaggregated/TFF speculator to the Legacy Commercial leg (decided 2026-09-26: every setup in the app is triggered by the Commercial index at an extreme, and on equities utils.is_setup reads only Commercials; the Speculator line is being removed as a near-duplicate of Non-Commercial on most markets).

  • flows.leg_flow_frame(net, prefix, source_code): one leg's weekly change and flow z (fixed 52-week window, min 26, no mean subtracted, NaN across missed weeks and contract switches).
  • CotIndexer.get_commercial_flow_data(name): the Commercial leg's frame, indexed by Date, with the market's flow_roles entry (the retail label) and is_equity in attrs.
  • Seam mask: the Legacy report has no per-row _Quotes code, so it comes from the market's Disaggregated or TFF frame (same report weeks from 2006; every known seam, RTY 2008 and 2017 and LBR 2023, is later), back-filled so pre-2006 rows read as one population.
  • Version 0.15.1 (0.15.0 was never tagged) so the analyzer's floor names a version with the method.

The speculator resolvers from #52 stay in place; nothing will read them after the analyzer PR.

Verification: store-free suite 521 passed, 4 skipped (four new tests plus one store-backed); on the live store Lumber's 2023 seam weeks are masked and Gold's speculator check still holds.

🤖 Generated with Claude Code

…dex strip (0.15.1)

The /analysis strip moves from the Disaggregated/TFF speculator 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.

- flows.leg_flow_frame(net, prefix, source_code): "<prefix> dNet" and
  "<prefix> Flow Z 52w" through weekly_change and flow_z.
- CotIndexer.get_commercial_flow_data(name): that frame for the Commercial
  leg, indexed by Date, with the market's flow_roles entry (for the retail
  label) and is_equity in attrs. The Legacy report carries no per-row _Quotes
  code, so the seam mask takes it from the market's Disaggregated or TFF frame
  (same report weeks from 2006; every known seam is later), back-filled so the
  pre-2006 rows read as one population. Verified on the live store: LBR's
  2023-02-21, 02-28 and 03-14 rows are masked.

The speculator resolvers stay; nothing in the analyzer will read them after its
matching PR. Version 0.15.0 was never tagged; 0.15.1 marks the new method so the
analyzer's floor names a version that has it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@mspinola
mspinola merged commit fc1f23e into main Sep 27, 2026
4 checks passed
@mspinola
mspinola deleted the claude/commercial-flow branch September 27, 2026 02:24
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