Skip to content

📈An unsupervised ML algo trading strategy using K-means clustering and EfficientFrontier max sharpe ratio optimization

Notifications You must be signed in to change notification settings

bce99/ClusterTrade

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 

Repository files navigation

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

About

📈An unsupervised ML algo trading strategy using K-means clustering and EfficientFrontier max sharpe ratio optimization

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published