Skip to content

fix(technical): snap missing fib start_date to the date nearest start_date - #7583

Open
Bortlesboat wants to merge 1 commit into
openbq-org:developfrom
Bortlesboat:fix/fib-start-date-nearest-lookup
Open

Bortlesboat wants to merge 1 commit into
openbq-org:developfrom
Bortlesboat:fix/fib-start-date-nearest-lookup

Conversation

@Bortlesboat

@Bortlesboat Bortlesboat commented Jul 12, 2026 •

Copy link
Copy Markdown
Contributor

Why

When calculate_fib_levels receives a start date outside the price index, it searches for the nearest end_date instead. With a Saturday start and an exact trading-day end, both endpoints collapse to the end date and every Fibonacci level has the same price.

What

Resolve the missing start date against start_date. The regression checks that January 6, 2024 snaps to Friday January 5, preserves the requested end date, and produces a nonzero price span.

Refreshed against the v5 develop tree at bbf1ab20; the regression now lives in tests/test_helpers.py.

Validation

  • Regression fails on the current base: the start endpoint becomes March 22 instead of January 5.
  • All 588 technical-extension unit tests pass with the fix.
  • Extension-wide ruff lint/format and ty checks pass.
  • Source distribution and wheel build pass with uv build --no-sources.

Validated locally on Windows / Python 3.11. No live provider calls were required.

@deeleeramone

Copy link
Copy Markdown
Collaborator

Hi @Bortlesboat, thanks for the PR. Can you please check the #7489 to verify if the issue still exists there? The technical extension has been refactored, so lots of the code has changed upstream. Thanks!

@Bortlesboat

Copy link
Copy Markdown
Contributor Author

Hi @deeleeramone, thanks for the pointer — just re-checked against current develop (post-#7489).

The bug is still there: calculate_fib_levels stayed in openbb_technical/helpers.py through the refactor, and the start-date branch still does the nearest lookup with end_date:

https://github.com/OpenBB-finance/OpenBB/blob/develop/openbb_platform/extensions/technical/openbb_technical/helpers.py#L569-L571

So any start_date that isn't an exact index entry (weekend/holiday) still collapses the retracement to the end date and every fib level comes back equal. I've updated the branch to current develop — the one-line fix and the regression test apply cleanly.

@Bortlesboat
Bortlesboat force-pushed the fix/fib-start-date-nearest-lookup branch from e4f51dc to 8040ea3 Compare September 30, 2026 04:04

This branch has not been deployed

No deployments
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.

2 participants