Stop skipping valuation days with partial quote gaps#760
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: edd428b3a3
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if !missing_quotes.is_empty() { | ||
| debug!( | ||
| "Quote gap for {:?} on {} (account '{}'). Skipping day.", | ||
| missing_quotes_with_gap, current_date, account_id_clone | ||
| "Quote gap for {:?} on {} (account '{}').", | ||
| missing_quotes, current_date, account_id_clone | ||
| ); |
There was a problem hiding this comment.
Skip valuation when a day has no quotes for all holdings
This block now logs missing quotes but always continues, so a date with no quotes for any quotable position is persisted as a real valuation where investments are valued at zero (because calculate_investment_market_value_acct treats missing quotes as zero). That creates artificial drawdowns at the start of history (before first available quote) or after quote backfill gaps, which is materially different from “partial gap” handling. Please keep the partial-gap change, but still guard the full-gap case (e.g., empty quotes_for_current_date with quotable positions) and skip that day.
Useful? React with 👍 / 👎.
…age (#683) When an asset had quotes somewhere but not for a specific date, the entire day was skipped from valuation history. This caused massive timeline gaps, especially for assets with sparse quote data. The calculator already values missing quotes at ZERO, so we now let those days through instead of dropping them entirely. https://claude.ai/code/session_01ANyY7nakN8jB5RduN9PKqg
edd428b to
71f7282
Compare
When ALL quotable positions lack quotes on a day, skip it to avoid recording a fake zero-value valuation. When only SOME are missing, proceed and let the calculator value those at zero — this prevents the timeline gaps reported in #683 without introducing artificial drawdowns. https://claude.ai/code/session_01ANyY7nakN8jB5RduN9PKqg
Description
This change modifies the valuation service to no longer skip entire days when quote gaps are detected. Previously, if any asset with quotes elsewhere was missing a quote for a specific date, the entire day's valuation would be skipped, creating gaps in the valuation timeline.
Changes Made
None(skips the day) when quote gaps are detectedRationale
The valuation calculator already handles missing quotes by valuing them at ZERO. Skipping entire days due to partial quote gaps creates unnecessary gaps in the valuation timeline. This change allows the valuation to proceed with zero-valued positions for missing quotes, which is preferable to losing the entire day's data. The health check system will still detect and flag assets with no quotes at all.
Addresses #683.
Checklist
Contributor License Agreement.
By submitting this PR, I agree to the
CLA.
https://claude.ai/code/session_01ANyY7nakN8jB5RduN9PKqg