Skip to content

Walk-forward optimization API to Portfolio#850

Open
kothurisindhu2000 wants to merge 3 commits into
polakowo:masterfrom
kothurisindhu2000:walk-forward-integration
Open

Walk-forward optimization API to Portfolio#850
kothurisindhu2000 wants to merge 3 commits into
polakowo:masterfrom
kothurisindhu2000:walk-forward-integration

Conversation

@kothurisindhu2000
Copy link
Copy Markdown

This PR introduces a native walk-forward analysis method to the Portfolio class.

The new method enables time-based train/test splitting directly within vectorbt, allowing users to evaluate strategy performance in a more realistic way without relying on external scripts.

Key points:

  • Added Portfolio.walk_forward() method
  • Supports rolling train/test windows
  • Avoids data leakage by enforcing strict temporal ordering
  • Works with vectorbt's internal returns pipeline
  • Added tests to validate behavior

This feature integrates with existing Portfolio APIs and does not break current functionality.

@app2let
Copy link
Copy Markdown

app2let commented May 6, 2026

Just wonder… you guys do such fancy stuff like walk forward optimisation…. On another hand vbt can not yet handle such simple stuff as negative prices, forward contracts rolling or currency or units conversion…. Should not effort go into implementing the basics before turning to fancy optimisations?
Just wonder…

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