Repository navigation
fix(backtest): paginate native crypto history within endpoint bounds - #345
Closed
Niubility-SunLight wants to merge 2 commits into
Closed
Niubility-SunLight wants to merge 2 commits into
Niubility-SunLight wants to merge 2 commits into
Conversation
Signed-off-by: lliang.liu <lliang.liu@shunwang.com>
Signed-off-by: lliang.liu <lliang.liu@shunwang.com>
|
Collaborator
|
Thanks for the detailed report and test coverage. We have now addressed the same native crypto history pagination and endpoint-boundary issue in main through #343, using the integrated implementation that also covers the surrounding research and market-data changes. Merging this PR now would duplicate and overlap with the current code paths, so I’m closing it as already addressed. We appreciate the contribution and the clear reproduction details. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.



Summary
Gate BTC/USDT 4H backtests failed with
strategyV2.noMarketDatawhen the requested history plus warm-up crossed the 1,000-candle page boundary. Native pagination constructed an inclusive 1,001-point request. Fetch bounded pages using each endpoint's capacity and boundary semantics, then normalize and validate complete coverage.Changes
Test plan
cd backend_api_python python -m pytest tests/test_native_crypto_public_client.py tests/test_crypto_history_pagination.py tests/test_crypto_kline_exchange_matrix.py tests/test_crypto_timeframe_resample.py tests/test_strategy_v2_market_data.py tests/test_market_data_failure_contract.py tests/test_gate_public_market_provider.py tests/test_backtest_limits.py -q --disable-warningspython -m ruff check app scripts testspython scripts/backend_quality_check.pypython scripts/check_docs.pyfrom the repository rootgit diff --checkCompatibility
No HTTP contracts, migrations, or runtime dependencies changed. Warm-up calculations, engine workload limits, venue scoping, download budgets, and coverage checks remain intact. Pagination does not bypass exchange history retention or add an HTX archival data source. Both commits include DCO sign-offs.
Related issue
User report: 2026-08-29 through 2026-11-02 worked, but starting one day earlier failed on Gate BTC/USDT 4H. This PR covers both reported dates and a one-year window.