ritvikgupta199 / Portfolio-Optimisation-using-Clustering

Portfolio Optimisation using Clustering via Ball Mapper Algorithm and MPT

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Two stage Portfolio Optimisation using Ball Mapper Algorithm

Report

For Clustering

cd BallMapper
g++ ball.cpp -o ball
./ball <year> <qtr> <eps>

where <year> and <qtr> are the quarter for which clustering is to be done and <eps> is the epsilon parameter for the Ball Mapper Algorithm.

For Portfolio Optimisation

cd MeanVariance
python3 max_sharpe.py --year <year> --quarter <qtr> --select_num <select_num>
python3 meanvar.py --year <year> --quarter <qtr> --model <model>
python3 eval_portfolio.py --year <year> --quarter <qtr> --dir <dir> --model <model>

Here,

  • <year> and <qtr> are the quarter using which the clusters have been created
  • <select_num> is the number of stocks to be picked from each cluster based on Sharpe ratio
  • <model> is "max_sharpe" or "min_vol" based on the optimisation objective
  • <dir> is the location where the evaluation graphs are saved

For evaluating the method for each of the avaliable quarters, run run.sh.

Data sources

About

Portfolio Optimisation using Clustering via Ball Mapper Algorithm and MPT


Languages

Language:R 47.9%Language:Jupyter Notebook 30.2%Language:C++ 14.8%Language:Python 6.7%Language:Shell 0.4%