Skip to content

codezart44/portfolio-opt

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Portfolio Optimization

Description

Portfolio Optimization project, conducted at Stanford University under supervision of Prof. Stephen P. Boyd and research members:

The goal of this project is to identify and formulate simple methods for portfolio constructions that yields long-term decent and consistent returns. The project employs methods of: volatility control through Markowitz and volatility scaling, alpha generation through return prediction and asset ranking, strategies and meta strategies.

Data

All data is publicly available through APIs provided by Yahoo Finance and Federal Reserve Economic Data (FRED). Our asset universe consists of a semi-broad basket of selected ETFs, long-only, and all assets are well known and highly liquid.

Results

Results found from this study do not gurantee future financial sucess, however provide soft empirical proof of what is likely to continue being solid long term investment strategies. We benchmark results against the classic 60/40 portfolio (consisting of 60% SPY and 40% AGG) and measure portfolio performance in terms of sharpe primarily. Other important metrics include: annualized return, annualized volatility, total return, and maximum drawdown. These results are derived from a 20 years long backtest between 2004-01-03 and 2024-12-31. Each year is assumed to have 252 trading days.

Environment Setup

python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
pip install -e .

Create a new scripts/env.sh file where you export your FRED API key to the environment. You can order a FRED API key from here.

export FRED_API_KEY="your_key_here"

Then download data and process risk with the setup command.

source setup.sh

Oskar Edén Wallberg (& Alexander Karolin)

About

Convex Optimization and Machine Learning for Robustness in Portfolio Optimization and Consistent Long-Term Returns

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors