Home

Awesome

FinML: A Practical Machine Learning Framework for Dynamic Stock Selection

Abstract:

Stock recommendation is vital to investment companies and investors. However, no single stock selection strategy will always win while analysts may not have enough time to check all S&P 500 stocks (the Standard & Poor’s 500). In this paper, we propose a practical scheme that recommends stocks from S&P 500 using machine learning. Our basic idea is to buy and hold the top 20% stocks dynamically. First, we select representative stock indicators with good explanatory power. Secondly, we take five frequently used machine learning methods, including linear regression, ridge regression, stepwise regression, random forest and generalized boosted regression, to model stock indicators and quarterly log-return in a rolling window. Thirdly, we choose the model with the lowest Mean Square Error in each period to rank stocks. Finally, we test the selected stocks by conducting portfolio allocation methods such as equally weighted, mean- variance, and minimum-variance. Our empirical results show that the proposed scheme outperforms the long-only strategy on the S&P 500 index in terms of Sharpe ratio and cumulative returns.

Index Term:

Stock recommendation, fundamental value investing, machine learning, model selection, risk management

Project summary:

<img src=figs/chart10_insample.PNG width="500">

<img src=figs/chart11_overallPerformance.PNG width="500">

Data:

Retrieved from WRDS (Wharton Research Data Services), Compustat Industrial [27 years daily and quarterly Data]

<img src=figs/chart1_datasetPeriod.PNG width="500">

Code:

Focasting Model:


python3 fundamental_run_model.py \
  -sector_name sector10 \
  -fundamental Data/fundamental_final_table.xlsx \
  -sector Data/1-focasting_data/sector10_clean.xlsx 

Portfolio Allocation:

Back-testing Model:

An IEEE TrustCom 2018 Paper (http://www.cloud-conf.net/trustcom18/)

Hongyang Yang, Xiao-Yang Liu, and Qingwei Wu. 2018. A practical machine learn-ing approach for dynamic stock recommendation. In IEEE TrustCom/BiDataSE,2018.1693–1697. Download from (https://ieeexplore.ieee.org/abstract/document/8456121) and (https://ssrn.com/abstract=3302088)