Deep learning with long short-term memory networks for financial market predictions

Long short-term memory (LSTM) networks are a state-of-the-art technique for sequence learning. They are less commonly applied to financial time series predictions, yet inherently suitable for this domain. We deploy LSTM networks for predicting out-of-sample directional movements for the constituent stocks of the S&P 500 from 1992 until 2015. With daily returns of 0.46 percent and a Sharpe ratio of 5.8 prior to transaction costs, we find LSTM networks to outperform memory-free classification methods, i.e., a random forest (RAF), a deep neural net (DNN), and a logistic regression classifier (LOG). The outperformance relative to the general market is very clear from 1992 to 2009, but as of 2010, excess returns seem to have been arbitraged away with LSTM profitability fluctuating around zero after transaction costs. We further unveil sources of profitability, thereby shedding light into the black box of artificial neural networks. Specifically, we find one common pattern among the stocks selected for trading – they exhibit high volatility and a short-term reversal return profile. Leveraging these findings, we are able to formalize a rules-based short-term reversal strategy that yields 0.23 percent prior to transaction costs. Further regression analysis unveils low exposure of the LSTM returns to common sources of systematic risk – also compared to the three benchmark models.

[1]  Jürgen Schmidhuber,et al.  Learning to Forget: Continual Prediction with LSTM , 2000, Neural Computation.

[2]  Jürgen Schmidhuber,et al.  Long Short-Term Memory , 1997, Neural Computation.

[3]  Lakhmi C. Jain,et al.  Recurrent Neural Networks: Design and Applications , 1999 .

[4]  Nicolas Huck,et al.  Pairs trading and outranking: The multi-step-ahead forecasting case , 2010, Eur. J. Oper. Res..

[5]  Wes McKinney,et al.  Data Structures for Statistical Computing in Python , 2010, SciPy.

[6]  Yoshua Bengio,et al.  Maxout Networks , 2013, ICML.

[7]  M. Avellaneda,et al.  Statistical Arbitrage in the U.S. Equities Market , 2008 .

[8]  Hossein Rad,et al.  The Profitability of Pairs Trading Strategies: Distance, Cointegration, and Copula Methods , 2015 .

[9]  Kimon P. Valavanis,et al.  Surveying stock market forecasting techniques - Part II: Soft computing methods , 2009, Expert Syst. Appl..

[10]  Heiko Jacobs,et al.  What Explains the Dynamics of 100 Anomalies , 2015 .

[11]  Timofei Bogomolov,et al.  Pairs trading based on statistical variability of the spread process , 2013 .

[12]  Sheridan Titman,et al.  On Persistence in Mutual Fund Performance , 1997 .

[13]  Zoubin Ghahramani,et al.  A Theoretically Grounded Application of Dropout in Recurrent Neural Networks , 2015, NIPS.

[14]  Ruoxuan Xiong,et al.  Deep Learning Stock Volatility with Google Domestic Trends , 2015, 1512.04916.

[15]  Diego Klabjan,et al.  Implementing Deep Neural Networks for Financial Market Prediction on the Intel Xeon Phi , 2015 .

[16]  Jürgen Schmidhuber,et al.  Deep learning in neural networks: An overview , 2014, Neural Networks.

[17]  Malcolm P. Baker,et al.  Benchmarks as Limits to Arbitrage: Understanding the Low-Volatility Anomaly , 2010 .

[18]  E. Fama,et al.  Multifactor Explanations of Asset Pricing Anomalies , 1996 .

[19]  Guigang Zhang,et al.  Deep Learning , 2016, Int. J. Semantic Comput..

[20]  Leo Breiman,et al.  Random Forests , 2001, Machine Learning.

[21]  Geoffrey E. Hinton,et al.  Speech recognition with deep recurrent neural networks , 2013, 2013 IEEE International Conference on Acoustics, Speech and Signal Processing.

[22]  Turan G. Bali,et al.  Maxing Out: Stocks as Lotteries and the Cross-Section of Expected Returns , 2009 .

[23]  Clive W. J. Granger,et al.  Strategies for Modelling Nonlinear Time‐Series Relationships* , 1993 .

[24]  Gaël Varoquaux,et al.  Scikit-learn: Machine Learning in Python , 2011, J. Mach. Learn. Res..

[25]  Narasimhan Jegadeesh,et al.  Returns to Buying Winners and Selling Losers: Implications for Stock Market Efficiency , 1993 .

[26]  Howard Chan,et al.  Short-term contrarian investing--is it profitable? ... Yes and No , 2003 .

[27]  E. Fama EFFICIENT CAPITAL MARKETS: A REVIEW OF THEORY AND EMPIRICAL WORK* , 1970 .

[28]  Harrison G. Hong,et al.  Speculative Betas , 2012 .

[29]  Other Contributors Are Indicated Where They Contribute Python Software Foundation , 2017 .

[30]  Diego Klabjan,et al.  Implementing deep neural networks for financial market prediction on the Intel Xeon Phi , 2015, WHPCF@SC.

[31]  William N. Goetzmann,et al.  Pairs Trading: Performance of a Relative Value Arbitrage Rule , 1998 .

[32]  Martin Weber,et al.  On the Determinants of Pairs Trading Profitability , 2014 .

[33]  Andrea Frazzini,et al.  Betting Against Beta , 2010 .

[34]  Narasimhan Jegadeesh,et al.  Evidence of Predictable Behavior of Security Returns , 1990 .

[35]  Efstratios F. Georgopoulos,et al.  Forecasting foreign exchange rates with adaptive neural networks using radial-basis functions and Particle Swarm Optimization , 2013, Eur. J. Oper. Res..

[36]  Martín Abadi,et al.  TensorFlow: Large-Scale Machine Learning on Heterogeneous Distributed Systems , 2016, ArXiv.

[37]  Vinesh Jha Timing Equity Quant Positions with Short-Horizon Alphas , 2016 .

[38]  Lawrence Takeuchi,et al.  Applying Deep Learning to Enhance Momentum Trading Strategies in Stocks , 2013 .

[39]  Harrison G. Hong,et al.  Speculative Betas: Speculative Betas , 2016 .

[40]  A. Lo,et al.  When are Contrarian Profits Due to Stock Market Overreaction? , 1989 .

[41]  B. LeBaron Some Relations between Volatility and Serial Correlations in Stock Market Returns , 1992 .

[42]  Geoffrey E. Hinton,et al.  Deep Learning , 2015, Nature.

[43]  Greg N. Gregoriou Handbook of short selling , 2011 .

[44]  Rand Kwong Yew Low,et al.  The profitability of pairs trading strategies: distance, cointegration and copula methods , 2016 .

[45]  Brian H. Boyer,et al.  Expected Idiosyncratic Skewness , 2009 .

[46]  John R. M. Hand,et al.  The Characteristics that Provide Independent Information about Average U.S. Monthly Stock Returns , 2016 .

[47]  John R. M. Hand,et al.  The supraview of return predictive signals , 2013 .

[48]  Nicolas Huck,et al.  Pairs selection and outranking: An application to the S&P 100 index , 2009, Eur. J. Oper. Res..

[49]  Alex Graves,et al.  Generating Sequences With Recurrent Neural Networks , 2013, ArXiv.

[50]  Ah Chung Tsoi,et al.  Noisy Time Series Prediction using Recurrent Neural Networks and Grammatical Inference , 2001, Machine Learning.

[51]  Andrew W. Senior,et al.  Long Short-Term Memory Based Recurrent Neural Network Architectures for Large Vocabulary Speech Recognition , 2014, ArXiv.

[52]  Gautam Kaul,et al.  Mean Reversion in Short-Horizon Expected Returns , 1989 .

[53]  Matthew Clegg,et al.  Pairs trading with partial cointegration , 2018 .

[54]  Jürgen Schmidhuber,et al.  Framewise phoneme classification with bidirectional LSTM and other neural network architectures , 2005, Neural Networks.

[55]  Alok Kumar Who Gambles in the Stock Market? , 2008 .

[56]  Spyros Skouras,et al.  A tug of war: Overnight versus intraday expected returns , 2019, Journal of Financial Economics.

[57]  Adam V. Reed,et al.  Short-Selling Risk , 2016 .

[58]  Nicolas Huck,et al.  Deep neural networks, gradient-boosted trees, random forests: Statistical arbitrage on the S&P 500 , 2017, Eur. J. Oper. Res..

[59]  Burton G. Malkiel,et al.  A Random Walk Down Wall Street: The Time-Tested Strategy for Successful Investing , 2020 .

[60]  Gaël Varoquaux,et al.  The NumPy Array: A Structure for Efficient Numerical Computation , 2011, Computing in Science & Engineering.

[61]  F. Diebold,et al.  Comparing Predictive Accuracy , 1994, Business Cycles.

[62]  R Core Team,et al.  R: A language and environment for statistical computing. , 2014 .

[63]  Kien Wei Siah,et al.  Stock Market Prediction through Technical and Public Sentiment Analysis , 2015 .

[64]  Sheridan Titman,et al.  Overreaction, Delayed Reaction, and Contrarian Profits , 1995 .