Monday, 10 April 2023

Portfolio Optimisation with Python

 Recently I have been busy so I have been neglecting this blog for a very long time. Just want to put out some new content. So there is this Python library called PyPortfolio that allows one to conduct Markowitz-style porfolio optimisation. I was very excited about it to discover it on the Computer Science YouTube channel and I created an IPython Notebook on Google Colab based on one of his videos - link to the video. 

After copying his code from the video, I noticed there were several mistakes regarding calculating returns so I changed those parts in my code. I also extended the content to include some extra constraints on stock allocation.

So, here is how you do portfolio optimisation with Python!

 https://github.com/wlsamchen01/Python_for_Stocks/blob/main/portfolio_optimization_v2.ipynb

 


No comments:

Post a Comment

Portfolio Optimisation with Python

 Recently I have been busy so I have been neglecting this blog for a very long time. Just want to put out some new content. So there is this...