v8.6.1
v8.6.1
Patch release with a critical fix for walk-forward backtest summaries.
Bug fixes
- fix(backtesting): aggregate
summary.jsonacross all walk-forward runs (#511, #512) —Backtest.save()andBacktest.merge()now always rebuildbacktest_summaryfrom the currentbacktest_runs. Previously, multi-window walk-forward backtests silently wrote a single-window summary to disk. Also fixes B1–B5 from the issue:total_loss/total_loss_percentagenow use gross-loss magnitude semantics (sum(abs(net_gain))over losing trades) and divide byinitial_unallocated._compound_percentage_returnsnow expects/returns decimals, consistent with the rest of the framework (the earlier whole-percentage assumption silently produced results off by ~100× in multi-window aggregations).create_backtest_metricsnow populatestrading_symbol,initial_unallocated, andbacktest_date_range_nameon per-run metrics so downstream aggregation has the context it needs.- Documented
total_growth*(legacy alias oftotal_net_gain*) andaverage_*(time-weighted means across windows) field semantics.
Recalculating existing on-disk results
Backtest folders produced by older versions of the framework can be rebuilt in-place using the public recalculate_backtests() API:
from pathlib import Path
from investing_algorithm_framework import Backtest, recalculate_backtests
ROOT = Path("./backtest_results")
backtest_dirs = [p.parent for p in ROOT.rglob("runs") if p.is_dir()]
backtests = [Backtest.open(d) for d in backtest_dirs]
recalculate_backtests(backtests)
for bt, d in zip(backtests, backtest_dirs):
bt.save(d)Full diff: v8.6.0...v8.6.1