Skip to content

Portfolio Optimiser v1.1

Latest

Choose a tag to compare

@EFrion EFrion released this 20 Jul 13:05
· 3 commits to main since this release

Version 1.1 introduces modularisation, a cleaner architecture, a backtest module, and a significant usability upgrade:

  1. Modular Code Structure

Core logic is now split across:

  • portfolio_optimiser_v1.1.py (main script)
  • utils.py (core functions and definitions)
  • test_backtest.py (unit and sanity tests)
  1. Yahoo Finance Integration

No need to fetch your own historical data (but you still can if you prefer it that way!).

  • Automatic price data fetching from Yahoo Finance via the yfinance package.
  • Local caching added to avoid redundant downloads on re-runs (saves data in yahoo_cache/).
  1. Backtest Module with Key Metrics

The most important addition of this release!

  • Test strategies over time and calculate the cumulated P&L
  • Prints CAGR, annualised volatility, Sharpe/Sortino ratios and Max Drawdown for each asset.
  1. Test File Added: test_backtest.py

Contains unit tests and sanity checks for optimisation structure and numerical stability.
Useful for debugging edge cases or validating results after code updates