Skip to content

Stop skipping valuation days with partial quote gaps#760

Merged
afadil merged 2 commits intomainfrom
claude/fix-issue-683-93a6u
Mar 19, 2026
Merged

Stop skipping valuation days with partial quote gaps#760
afadil merged 2 commits intomainfrom
claude/fix-issue-683-93a6u

Conversation

@afadil
Copy link
Owner

@afadil afadil commented Mar 19, 2026

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

  • Removed the logic that returns None (skips the day) when quote gaps are detected
  • Removed the check that skips days when no quotes are available for quotable positions
  • Changed the behavior to log missing quotes for diagnostics but continue processing
  • Updated debug logging to reflect that we no longer skip days with partial quote coverage

Rationale

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

By submitting this PR, I agree to the
CLA.

https://claude.ai/code/session_01ANyY7nakN8jB5RduN9PKqg

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment on lines +308 to 312
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
);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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
@afadil afadil force-pushed the claude/fix-issue-683-93a6u branch from edd428b to 71f7282 Compare March 19, 2026 15:22
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
@afadil afadil merged commit 931a058 into main Mar 19, 2026
3 checks passed
@afadil afadil deleted the claude/fix-issue-683-93a6u branch March 19, 2026 16:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant