Fix backtest date restrictions and handle missing recent candles gracefully #526
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.
Problem
Currently, Jesse has two restrictions that prevent users from easily backtesting with the most recent data:
Cannot select today's date: Jesse throws an
InvalidDateRangeerror when trying to backtest up to today's date, forcing users to manually select "yesterday" as the finish date. This is inconvenient and confusing.Fails when recent candles are missing: When selecting a date range where the most recent candles haven't been imported yet (e.g., selecting today when the last candle is from a few hours ago), Jesse throws a
CandleNotFoundInDatabaseerror instead of just using the available data.Solution
This PR removes these unnecessary restrictions to improve the user experience:
1. Allow Future Dates
2. Auto-Adjust to Available Data
Benefits
Test Plan
Note on CI Failures
The CI failures are pre-existing issues unrelated to this PR. The tests are failing due to missing
raydependency for Python 3.13, which is a known issue in the master branch.