Skip to content
Open
Show file tree
Hide file tree
Changes from 16 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
297 changes: 190 additions & 107 deletions cookbook/1-RiskReturnModels.ipynb

Large diffs are not rendered by default.

3,907 changes: 2,005 additions & 1,902 deletions cookbook/2-Mean-Variance-Optimisation.ipynb

Large diffs are not rendered by default.

1,276 changes: 655 additions & 621 deletions cookbook/3-Advanced-Mean-Variance-Optimisation.ipynb

Large diffs are not rendered by default.

700 changes: 287 additions & 413 deletions cookbook/4-Black-Litterman-Allocation.ipynb

Large diffs are not rendered by default.

697 changes: 389 additions & 308 deletions cookbook/5-Hierarchical-Risk-Parity.ipynb

Large diffs are not rendered by default.

9,037 changes: 9,037 additions & 0 deletions cookbook/data/prices.csv

Large diffs are not rendered by default.

8,018 changes: 0 additions & 8,018 deletions cookbook/data/spy_prices.csv

This file was deleted.

8,797 changes: 0 additions & 8,797 deletions cookbook/data/stock_prices.csv

This file was deleted.

58 changes: 58 additions & 0 deletions cookbook/download_prices.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
import yfinance as yf

if __name__ == "__main__":
tickers = [
"AAPL",
"AMD",
"AMZN",
"BABA",
"BAC",
"BBY",
"GE",
"GM",
"GOOG",
"JPM",
"MA",
"META",
"PFE",
"RRC",
"SBUX",
"T",
"UAA",
"WMT",
"XOM",
"MSFT",
"KO",
"COST",
"LUV",
"UNH",
"ACN",
"DIS",
"GILD",
"F",
"TSLA",
"BLK",
"TM",
"JD",
"INTU",
"UL",
"CVS",
"NVDA",
"PBI",
"TGT",
"NAT",
"DPZ",
"MCD",
"SPY",
"FB",
"IBM",
"NFLX",
"QCOM",
"VZ",
]

data = yf.download(tickers, start="1990-01-01")["Close"]
prices = data.to_csv("data/prices.csv")

for ticker in tickers:
assert ticker in data.columns, f"Missing data for {ticker}"
3 changes: 1 addition & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ dependencies = [
#
all_extras = [
"matplotlib>=3.2.0",
"plotly>=5.0.0,<6",
"scikit-learn>=0.24.1",
"ecos>=2.0.14,<2.1",
"plotly>=5.0.0,<7",
Expand All @@ -64,7 +63,7 @@ all_extras = [
dev = [
"pytest>=9.0.0",
"pytest-cov>=7.0.0",
"yfinance>=0.2.66",
"ruff>=0.14.5",
]

# notebook tests
Expand Down