Repository navigation
Read and update the market-hours.json market hours database - #795
Merged
Merged
Conversation
- The daily update downloads market-hours.json and market-hours-database.json, each on its own: a file that can't be downloaded or read keeps its local copy and doesn't stop the other - market-hours.json is read first, in the version of its format the CLI supports, and market-hours-database.json when it doesn't exist - Its entries are grouped by security type and each one is for a market and one or more tickers, where * is every ticker of the market without an entry of its own Co-Authored-By: Claude Fable 5.2 <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.
LEAN moves its market hours database to a new file,
Data/market-hours/market-hours.json(QuantConnect/Lean#10287).market-hours-database.json, the file it replaces, stays in LEAN for a short time and is then deleted.What changes
market-hours.jsonandmarket-hours-database.json, each on its own. A file that can't be downloaded, or that the CLI can't read, keeps its local copy and doesn't stop the other one from updating. A file that doesn't exist in LEAN is not an error: LEAN has only one of the two when it is ahead of or behind this version of the CLI.market-hours.jsonis read first, in the version of its format the CLI supports, andmarket-hours-database.jsonwhen it doesn't exist. When the file doesn't hold that version, the error says to update the CLI.*is every ticker of the market without an entry of its own. The CLI keeps looking them up as<security type>-<market>-<ticker>, so the code that uses the database doesn't change.Order of merging
This works before and after the LEAN pull request is merged, and after
market-hours-database.jsonis deleted from LEAN.How has this been tested
New tests cover:
market-hours.json, andmarket-hours-database.jsonwhen it doesn't exist.The whole test suite ran locally on this commit: 2,963 passed, 75 skipped.
Related pull requests
🤖 Generated with Claude Code