The series domain: published readings that are not prices, built from TradingView raw files (0.3.0) - #31
Merged
Conversation
… TradingView raw files (0.3.0)
A third domain beside equities and futures, for daily vendor readings with no
price behind them: the share of Nasdaq stocks above their 5-day average (the
AGI "FOMO" read), counts of new 52-week highs and lows, the Cboe put/call
ratios. Nothing adjusts them, so the domain has one tier, `raw`, which is the
stored frame; `Close` is the reading. Scoping: docs/design/
breadth-domain-scoping.md (Part B, now landed with a different vendor) and
cot-analyzer's docs/design/tradingview-breadth-scoping.md.
Registry: DOMAINS gains "series", PRICE_SOURCES gains "tradingview" (never
defaulted, like cboe), Symbol gains `tradingview`, `kind` (percent | count |
ratio, which fixes the validated range) and `anchors` (published readings the
build re-verifies). Series symbols default no Yahoo or Norgate ticker, so no
other producer can claim them. Eleven entries under Market Breadth and Options
Sentiment; NASDAQ_ means the Composite, the FOMO script's universe, not the
100. NASDAQ_FOMO_5D carries two anchors: 48.05 on 2026-07-29 (the EDGE report's
printed reading) and 32.23 on 2026-09-16 (pulled after the close on the
producer box and on a Mac, identical).
Tiers: DOMAIN_TIERS["series"] = ("raw",), stored flat like equities, derived
as the identity so the stored-or-derived partition stays total. Reader:
get_bars serves the frame as-is, refuses price tiers with a message naming
the domain, and refuses asof= (a published reading does not restate; end=
says what a vintage would say). available(), coverage_gaps and provenance
work unchanged.
Producer: providers/tradingview.py, stage 2 only. TradingView has no data
API; the feed reaches this stack through a claude.ai connector, so stage 1
is a Claude Code Desktop local routine on the Windows box writing the
connector's results verbatim under _raw/tradingview/<symbol>/<date>.json
(producer-internal, outside both syncs, which already exclude _raw). The
build reads only those files and refuses, naming the file and the bar:
- a file that is not the connector's JSON, or names another symbol or
interval;
- any bar that overlaps the store and differs in Close (the store is never
rewritten; a vendor restatement or a transcription slip is a human's to
resolve), and any bar two raw files disagree on;
- values outside the kind's range, non-integer counts, non-positive ratios,
non-increasing stamps, two bars on one session;
- an anchor that does not match;
- a newest bar older than the expected session (the latest weekday whose
16:30 ET close has passed), with nothing written: the routine's second
run is the retry. Exchange holidays are not modelled and are documented.
CLI: --build-tradingview and --expect-session (a date, or "none" for old
files); --bars --domain series is refused rather than silently doing nothing.
Session dates are the Eastern date of the vendor's open stamp.
Tests: the fixture is the ten-bar INDEX:NCFD file the routine wrote on the
box on 2026-09-16; every guard has a case that also checks nothing was
written; the expected-session rule is pinned across the week and the close;
the CLI exit codes follow the result.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
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.
Summary
Step 4 of the order of work in cot-analyzer's
docs/design/tradingview-breadth-scoping.md: theseriesdomain and the TradingView build step. Closes Part B ofdocs/design/breadth-domain-scoping.mdwith a different vendor than it planned.seriesholds daily vendor readings with no price behind them (FOMO share, new-highs/lows counts, put/call ratios). One tier,raw, stored flat like equities and served as-is;Closeis the reading.get_barsrefuses price tiers andasof=with messages naming why.available,coverage_gaps,provenancework unchanged.PRICE_SOURCESgainstradingview(never defaulted, likecboe);Symbolgainstradingview,kind(percent | count | ratio) andanchors. Series symbols default no Yahoo or Norgate ticker, so no other producer can claim them (checked: the Yahoo producer filters ons.yahoo). Eleven entries;NASDAQ_is the Composite, the FOMO script's universe.NASDAQ_FOMO_5Dcarries anchors 48.05 (2026-07-29, the EDGE report) and 32.23 (2026-09-16, box and Mac identical).providers/tradingview.pybuilds from raw JSON a Claude Code Desktop local routine on the Windows box writes verbatim under_raw/tradingview/(outside both syncs already). Guards, each refusing by file and bar and writing nothing: JSON shape and symbol; overlap agreement with the store and between files (the store is never rewritten); range bykind; strictly increasing stamps; registry anchors; a session gate (latest weekday past 16:30 ET) so a stale pull exits non-zero and the routine's second run retries.--build-tradingview,--expect-session YYYY-MM-DD|none;--bars --domain seriesis refused rather than silently doing nothing.Test plan
tests/test_series_domain.py(8) andtests/test_tradingview_build.py(34): the fixture is the box's ten-barINDEX:NCFDfile; every guard has a case that also checks nothing was written; expected-session pinned across the week and the close; CLI exit codes.ruff check src testsclean at 0.15.22.run-series.cmd, the routine instructions and allow rules, the backfill, and the verifier's freshness row (step 5 of the scoping doc).🤖 Generated with Claude Code