Testing long short-term memory recurrent neural networks based Deep learning trading model for S&P 500 index - Heinonen, Jari-Pekka (My University, 2023)
The rapid development of computational power and machine learning methods in recent years, have also turned increasing interest towards financial applications, including stock market prediction tasks. Stock price prediction is a complicated and difficult task, since market time series are naturally noisy, non-stationary, nonparametric, non-linear, and deterministic chaotic systems [1]. It is therefore challenging to effectively and efficiently predict the future price. Plethora of deep learning architectures have been developed to tackle the problem of time series forecasting. The goal of this research is to test LSTM model on liquid S&P500 stock index and extend the variety of applied features, and the extended sample period to span from 9/1997 to 10/2018. The LSTM network was compared against equally weighted market portfolio. The performance of the LSTM model was measured by making daily out of sample predictions for the period spanning from 9/1997 to 10/2018. These predictions were used to construct a trading strategy, and this strategy’s return characteristics against market and randomly constructed portfolio were examined. The classification accuracy of LSTM model was worse than previously reported, but the model still contained statistically significant predicting power, and the null hypothesis of the model randomly suggesting allocations, were rejected. The LSTM model delivered 33,4% annual return for the whole sample period, with 1.273 Sharpe ratio and 0.664 Sortino ratio compared to 0.632 and 0.266 in the equally weighted market portfolio. We also analyzed the drivers of the LSTM strategy, and found out that the strategy was mainly driven by the long leg. When the Fama and French 5 factors were used as control variables, the strategy did not have statistically significant loadings on any risk factor beta. Both long and short leg were found to have a highly statistically significant loading on HML factor, but the R2’s of the models were very close to zero. The strategy seems to therefore been generating alpha, or be driven by some unknown factors. Despite its high computational costs and and black-box type nature, LSTM network seems to be suitable method for predicting directions of the stock returns.
Keywords: LSTM, Neural Networks, Stock market, SP500