Repository navigation
Conversation
…with the counterparty row The Disaggregated and TFF page drew levels only: net, percent of OI, the range index, a level z-score, momentum, legs, spreading and trader counts. The gold flow-state study and its 42-market replication (cotmetrics docs/design/cot-flows.md) showed that the picture a single week's bar chart cannot give is the cohort-by-week heatmap of each cohort's weekly change scaled by its own trailing 52-week standard deviation, and cotmetrics 0.15.0 (#52 there) now computes that family inside get_category_data. This draws it, and computes nothing. One new id in CATEGORY_SPECS, appended last so the persisted selector order is unchanged, DEFAULT_PLOTS untouched. The overlay builder draws ONE go.Heatmap: rows are the selected cohorts in report order plus the counterparty composite row always, whatever the checklist says, because the newsletter failure the study came from was a chart that named only one side of each transfer. The composite's tick label is the bare word "Counterparty" and its members are named in the hover, since plotly's automargin sized every panel in the stack to the long label. z is clipped for display at three sigma; the colour scale runs from the validated diverging pair through a grey midpoint composited from DIM_TEXT over the background (a dead band under one sigma erased the multi-week runs the panel exists to show; polarity never borrows an identity palette slot). The hover is pre-rendered per cell (the heatmap's own z format printed a raw float under unified hover in plotly 6.9): cohort, "positions as of <weekday> <date>" read from the index rather than a hard-coded Tuesday, the net change in contracts with both legs, and the z against the cohort's own 52-week sd; thin cohorts say to read the count. No colorbar (the stack's right margin clips one; the panel label states the scale), no price overlay, no secondary axis. The facet builder draws a one-row heatmap per category cell with the tick labels off (the row is already named by the axis title) and no gap between cells (a facet column is a fraction of the figure width). The gap is also off on phones. The window is fixed at 52 weeks inside cotmetrics and rides in the column name, so the page's Lookback control does not move it; the panel label says so. Nothing here attaches a forward return, the words mover, biggest move and unusual are held out by a test (the Home board's movers rank index-point changes of the Legacy Commercial leg, a different quantity), and the state vocabulary stays out of this panel; that is the strip and caption of the next PR. Verified in the running app against the cotmetrics 0.15.0 tree: overlay and facet layouts on Gold, the unified hover box in the stack, and the 375 px phone width. 19 new tests, all store-free; the analyzer suite is 916 passed. The cotmetrics floor moves to 0.15.0 (category_traces imports cotmetrics.flows, which does not exist at 0.14.x, and use_pages imports every page at boot), so CI stays red on check_dep_floors until #52 merges in cotmetrics and the editable install is refreshed. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This was referenced Sep 26, 2026
Merged
Scoped by the "Scope, restated" block of cotmetrics docs/handoffs/2026-09-26-cot-flow-states-cross-universe.md: PR 2 is the three-panel view in docs/analysis/2026-09-26-cot-view-proposed-gold.png and nothing else. The Weekly Flow panel in the plot selector (previous commit) is taken back out; category_traces.py and its tests are main's again. components/flow_traces.py, drawn when Layout is "Flow view": - price with open interest dotted on a second axis; - a heatmap with cotmetrics' rows for the market (attrs["flow_rows"]): one Commercials row for Producer/Merchant plus Swap Dealers on GC, SI, PL, PA, every category its own row elsewhere; each cell the net change over the cohort's own 52-week sd, the app's diverging pair, clipped at 3; a triangle where that row's index is in its top or bottom decile that week (flows.level_marks); the state name only in the cell hover, with "a vocabulary label, not a signal"; - the same rows' positioning index at the tuned lookback, shaded at the decile cutoffs; - one time axis, opening on 104 weeks (52 on a phone), dates under the bottom panel; the plot selector and Cols grey out. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Owner
Author
|
Stopped: "Scope, restated v2" (cotmetrics handoff, 2026-09-26 evening) withdraws the multi-row heatmap and the Flow view. What replaces it is a Speculator series and one flow-z strip on the existing Positioning Index panel of /analysis, in a new PR from main. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR 2 of cotmetrics
docs/design/cot-flows.md, as scoped by the "Scope, restated" block ofdocs/handoffs/2026-09-26-cot-flow-states-cross-universe.md: the three-panel view indocs/analysis/2026-09-26-cot-view-proposed-gold.png, ported to /categories, and nothing else. Draft until mspinola/cotmetrics#52 (0.15.0) merges, because it reads columns that release adds; the floor moves to 0.15.0 here.What it adds. A third Layout choice on /categories, Flow view, beside Overlay and Small multiples (
components/flow_traces.py). Three full-width panels on one time axis:Opens on 104 weeks (52 on a phone), dates under the bottom panel; the plot selector and Cols grey out while it is chosen. The page computes nothing: flows, z, indexes and markers are cotmetrics'.
Not in this PR (out of scope per the block): the state strip, the week-in-words caption, flow rows in small multiples, a stack panel in the plot selector, the cross-asset board, and a Legacy back-fill of history before 2006 (irrelevant to a 104-week window). The earlier commit on this branch added a Weekly Flow panel to the plot selector; the second commit takes it back out, so
category_traces.pyis main's again. #141 is closed as superseded.Verification. Suite 912 passed (897 on main), 15 new store-free tests in
tests/test_flow_traces.pywhose frames go through cotmetrics' ownbuild_category_frameandbuild_flow_frame; ruff clean. Looked at in the running app on Gold (four rows, matching the mockup) and Corn (five rows, no merge).check_dep_floorsstays red until #52 merges.Differences from the mockup: colours are the app's validated diverging pair rather than red/blue; no colorbar (the title states the scale); the level is the tuned lookback (26 weeks on Gold) rather than 3 years, so the index panel is busier and about a third of Gold's weeks sit in a decile.
🤖 Generated with Claude Code