Skip to content

Computing a solution for the optimal mean-variance tradeoff (maximising Sharpe Ratio) of a portfolio according to MPT.

Notifications You must be signed in to change notification settings

cmitsucor/MarkowitzPortfolioOptimization

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MarkowitzPortfolioOptimization

Computing a solution for the optimal mean-variance tradeoff (maximising Sharpe Ratio) of a portfolio according to MPT.

This repository contains code that allows you to extract the composition and performance of any exchange-traded fund and attempt to allocate its constituent assets differently, according to the mean-variance optimization framework.

Algorithms supported:

  • Unconstrained optimization
  • Constrained (sum weights = 1) optimization
  • Short-selling constrained optimization

Blog-like Description:

https://towardsdatascience.com/beating-the-etf-portfolio-optimisation-using-python-and-some-linear-algebra-e48d0e0e44f

Instructions

Data/ETF/ should have two .csv files for the benchmark fund: one with performance and one with composition
Data/Stocks/ should have all the stock files downloaded from Kaggle

Required libraries:

  • pandas
  • numpy
  • matplotlib
  • time
  • os
  • shutil
  • datetime
  • (pdb)
  • scipy

About

Computing a solution for the optimal mean-variance tradeoff (maximising Sharpe Ratio) of a portfolio according to MPT.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%