https://github.com/bce99/clustertrade
πAn unsupervised ML algo trading strategy using K-means clustering and EfficientFrontier max sharpe ratio optimization
https://github.com/bce99/clustertrade
algorithmic-trading efficientfrontier k-means-clustering unsupervised-machine-learning
Last synced: 4 months ago
JSON representation
πAn unsupervised ML algo trading strategy using K-means clustering and EfficientFrontier max sharpe ratio optimization
- Host: GitHub
- URL: https://github.com/bce99/clustertrade
- Owner: bce99
- Created: 2024-08-05T07:23:32.000Z (11 months ago)
- Default Branch: main
- Last Pushed: 2024-08-07T06:07:37.000Z (11 months ago)
- Last Synced: 2025-01-09T12:28:47.732Z (6 months ago)
- Topics: algorithmic-trading, efficientfrontier, k-means-clustering, unsupervised-machine-learning
- Language: Jupyter Notebook
- Homepage:
- Size: 4.06 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## Unsupervised Learning Trading Strategy
* Download/Load SP500 stocks prices data.
* Calculate different features and indicators on each stock.
* Aggregate on monthly level and filter top 150 most liquid stocks.
* Calculate Monthly Returns for different time-horizons.
* Download Fama-French Factors and Calculate Rolling Factor Betas.
* For each month fit a K-Means Clustering Algorithm to group similar assets based on their features.
* For each month select assets based on the cluster and form a portfolio based on Efficient Frontier max sharpe ratio optimization.
* Visualize Portfolio returns and compare to SP500 returns.
## All Packages Needed:
pandas, numpy, matplotlib, statsmodels, pandas_datareader, datetime, yfinance, sklearn, PyPortfolioOpt