This github repository is the Group Project 2 of Group 5 of HKU DASE3115 Engineering economics and finance in 2025-2026 semester 1.
The task of the project is to invest 1 million US dollars on the 30 industry pofolios (of stocks) in the US stock market for the time horizon from October 2010 to September 2020 (120 months in total). The performance of strategies are being evaluated at the end of each month and entire time horizon, i.e., September 2020.
-
Average Monthly Return: The algorithm calculates the average return of all the industry pofolios using the previous data and ALL-IN to the portfolio with best calculated performance. The implementations are in
algorithms/average_monthly_return.py -
Same Period Maket Performance: The algorithm calculates the average return of all the industry pofolios same month in pervious years and ALL-IN to the portfolio with best calculated performance. The implementations are in
algorithms/same_period_maket_perf.py -
Do Nothing: This algorithm literally does nothing to improve its return and getting interest with the risk free rate (ie 2000001 – 1-month rates on CSRP )
-
Equally Weighted (Naive Method): This algorithm evenly distribute the money into all 30 industry pofolios. Assets are rearranged every month
-
Global Minimum Variance: This algorithm calculates the investment weight of all 30 assets using previous data to find out a combination with the lowest overall variance. The algorithm recalculates the weight every month and there is also a version which bans short sell. Variable
ignoreignores all the calculatd weight with the threshold lower than it. The implementations are inalgorithms/globalminvar.py -
Tangency Profolio: This algorithms calculates the investments weight of all 30 assets using previous data to find out a combination with the highest Sharpe ratio. The algorithm recalculates the weight every month and there is also a version which bans short sell. Variable
ignoreignores all the calculatd weight with the threshold lower than it. The implementations are inalgorithms/tangency.py
First, install python and install all the dependency by:
pip install -r requirements.txt
Then, run the program with provided datasets in datasets/
py main.py
To change the years of data and the ignorethreshold being calculated, change the YEAR_AVG and IGNORE_THRESHOLD value in main.py
YEAR_AVG = 30 ## Change this for different years of data used
IGNORE_THRESHOLD = 0.0 ##Change this for different threshold for small weights