Skip to content

fix(market): use completed candles for live analysis - #69

Merged
KageRyo merged 1 commit into
mainfrom
feature/66-closed-live-candles
Oct 11, 2026
Merged

KageRyo merged 1 commit into
mainfrom
feature/66-closed-live-candles

Conversation

@KageRyo

@KageRyo KageRyo commented Oct 11, 2026

Copy link
Copy Markdown
Owner

Summary

Closes #66.

Live CLI analysis and Discord /predict now use exactly the requested number of completed candles. For a four-hour candle starting at 12:00 UTC, a 14:00 snapshot excludes it and a 16:00 snapshot includes it. One UTC snapshot governs both pages and all retries; a missing window raises an error with requested and available closed counts.

The first page requests one extra row where possible, with at most one older page to retain support for 1,000 completed candles. Shared interval arithmetic handles fixed minutes, daily, weekly, and calendar months while preserving backtest import paths and error types. Historical retrieval and persisted datasets retain their existing behavior. Both READMEs and the Unreleased changelog describe the defaults; package version remains 4.1.5 pending a separate release.

Validation

  • ruff check .
  • ruff format --check .
  • pyright
  • pytest — 165 passed, 85.58% coverage
  • python -m build and python -m twine check --strict — wheel and sdist passed
  • Boundary, calendar month, 42/180/1000-window, duplicate/empty/nonadvancing page, and once-per-call clock/retry regressions
  • Real adapter → service → CLI/Discord tests using raw fake API data; negative control with old filtering fails all five new integration cases

Checklist

  • Branch follows feature/<issue>-<description>.
  • No credentials, .env files, or generated market data were committed.
  • English and 正體中文 documentation are aligned when relevant.
  • Outputs remain clearly labelled as informational, not financial advice.

@sonarqubecloud

Copy link
Copy Markdown

@KageRyo
KageRyo merged commit c3fdb8c into main Oct 11, 2026
13 checks passed
@KageRyo
KageRyo deleted the feature/66-closed-live-candles branch October 11, 2026 09:39
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.

fix(market): avoid using unclosed Bybit candles for default live analysis

1 participant