Repository navigation
registry: stitch the 1998 grain re-code at scale 0.2 - #123
Merged
Merged
Conversation
ZC, ZS, ZW, ZO and KE gain a hist_codes predecessor (002601, 005601, 001601, 004601, 001611) at scale 0.2. The five CBOT/KCBT grains re-coded at the 1997/1998 year boundary and the registry carried only the new codes, so the store's grain history began 1998-01-06 although the CFTC publishes it from 1986-01-15. The old codes are the same contracts reported in thousands of bushels rather than contracts (5,000 bu each): every position column is divisible by 5 on 99.3 to 100% of pre-1998 rows and on none after, open interest drops 5.0 to 5.7x at the seam (oats 3.8x, a real move), and trader counts do not move. No overlap week. get_cot now returns the primary frame untouched when no predecessor file is present, so a symbol with hist_codes behaves exactly as before until the producer writes the new files. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
3 tasks done
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
ZC,ZS,ZW,ZOandKEgain ahist_codespredecessor at scale0.2:002601,005601,001601,004601,001611. The five CBOT/KCBT grains re-coded at the 1997/1998 year boundary and the registry carried only the new codes, so the store's grain history began 1998-01-06 although the CFTC publishes it from 1986-01-15.deacot1986_2016bundle:Unreleased / Added.Test plan
tests/test_registry.py::test_grain_predecessors_scaled_to_contracts: the five mappings at 0.2, and ZM / ZL / ZR still single-coderuff check src tests scriptscleanCOTDATA_STORE:cftc.update(codes=[the ten codes])thenget_cotfor each symbol gives 1986-01-15 to 2026-10-06, no duplicate dates, one code label, and a level-continuous seam (ZW OI 93,742 on 1997-12-30 to 97,105 on 1998-01-06; KE 45,071 to 45,252)Deployment
The producer writes the five new per-code files on its next
--cotrun after the Windows box pulls this. Until thenget_cotreturns the post-1998 series exactly as before (a missing predecessor file is skipped). The 08:10 catch-up syncs both replicas unconditionally, so the files reach the Mac the morning after the pull.🤖 Generated with Claude Code