Repository navigation
fix multibacktest example strategy import - #1419
Open
Geochelone666 wants to merge 2 commits into
Open
Geochelone666 wants to merge 2 commits into
Geochelone666 wants to merge 2 commits into
Conversation
|
Same kind of problem a few lines down, in |
- from backtesting.lib import plot_heatmaps (was backtesting.plot) - heamap -> heatmap typo fix
Author
|
Good catch, thanks! Fixed both:
- Changed `from backtesting.plot import plot_heatmaps` to `from
backtesting.lib import plot_heatmaps`
- Fixed the `heamap` -> `heatmap` typo
Pushed to the PR branch.
…On Mon, 05 Oct 2026 11:49:19 -0700, Arhan Canli ***@***.***> wrote:
arhancanli left a comment (kernc/backtesting.py#1419)
Same kind of problem a few lines down, in `MultiBacktest.optimize`'s docstring: it imports `from backtesting.plot import plot_heatmaps`, but there's no `backtesting.plot` module (on 0.6.6 that line raises `ModuleNotFoundError`); `plot_heatmaps` lives in `backtesting.lib`. The example also assigns `heamap` and then uses `heatmap`. With both fixed it works as written: `optimize` returns one column per dataset indexed by the parameter combination, so `plot_heatmaps(heatmap.mean(axis=1))` plots the cross-instrument average. Might be worth folding into this PR, with the same exec-the-docstring test.
--
Reply to this email directly or view it on GitHub:
#1419 (comment)
You are receiving this because you authored the thread.
Message ID: ***@***.***>
|
This branch has not been deployed
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.
move the existing SmaCross strategy from the test suite to backtesting.test so the documented import works. keep its fast/slow parameters and reuse it in the tests.
replace the optimization placeholder with a small parameter grid and add a regression test that runs the complete example.
Closes #1415
checks: 82 tests passed with MPLBACKEND=Agg, including the offline example and lib/utils tests; flake8 passed. mypy reports the same two _plotting.py errors on unchanged master.
AI assistance: used Codex to prepare and test this change.