MarkowitzPortfolioOptimization
Computing a solution for the optimal mean-variance tradeoff (maximising Sharpe Ratio) of a portfolio according to MPT.
Install / Use
/learn @rshemet/MarkowitzPortfolioOptimizationREADME
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
Related Skills
node-connect
347.9kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
108.7kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
347.9kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
347.9kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
