IDEAS home Printed from https://ideas.repec.org/p/arx/papers/2004.10178.html
   My bibliography  Save this paper

Forecasting directional movements of stock prices for intraday trading using LSTM and random forests

Author

Listed:
  • Pushpendu Ghosh
  • Ariel Neufeld
  • Jajati Keshari Sahoo

Abstract

We employ both random forests and LSTM networks (more precisely CuDNNLSTM) as training methodologies to analyze their effectiveness in forecasting out-of-sample directional movements of constituent stocks of the S&P 500 from January 1993 till December 2018 for intraday trading. We introduce a multi-feature setting consisting not only of the returns with respect to the closing prices, but also with respect to the opening prices and intraday returns. As trading strategy, we use Krauss et al. (2017) and Fischer & Krauss (2018) as benchmark. On each trading day, we buy the 10 stocks with the highest probability and sell short the 10 stocks with the lowest probability to outperform the market in terms of intraday returns -- all with equal monetary weight. Our empirical results show that the multi-feature setting provides a daily return, prior to transaction costs, of 0.64% using LSTM networks, and 0.54% using random forests. Hence we outperform the single-feature setting in Fischer & Krauss (2018) and Krauss et al. (2017) consisting only of the daily returns with respect to the closing prices, having corresponding daily returns of 0.41% and of 0.39% with respect to LSTM and random forests, respectively.

Suggested Citation

  • Pushpendu Ghosh & Ariel Neufeld & Jajati Keshari Sahoo, 2020. "Forecasting directional movements of stock prices for intraday trading using LSTM and random forests," Papers 2004.10178, arXiv.org, revised Jun 2021.
  • Handle: RePEc:arx:papers:2004.10178
    as

    Download full text from publisher

    File URL: http://arxiv.org/pdf/2004.10178
    File Function: Latest version
    Download Restriction: no
    ---><---

    References listed on IDEAS

    as
    1. Krauss, Christopher & Do, Xuan Anh & Huck, Nicolas, 2017. "Deep neural networks, gradient-boosted trees, random forests: Statistical arbitrage on the S&P 500," European Journal of Operational Research, Elsevier, vol. 259(2), pages 689-702.
    2. Sima Siami-Namini & Akbar Siami Namin, 2018. "Forecasting Economics and Financial Time Series: ARIMA vs. LSTM," Papers 1803.06386, arXiv.org.
    3. Huck, Nicolas, 2009. "Pairs selection and outranking: An application to the S&P 100 index," European Journal of Operational Research, Elsevier, vol. 196(2), pages 819-825, July.
    4. Huck, Nicolas, 2010. "Pairs trading and outranking: The multi-step-ahead forecasting case," European Journal of Operational Research, Elsevier, vol. 207(3), pages 1702-1716, December.
    5. Marco Avellaneda & Jeong-Hyun Lee, 2010. "Statistical arbitrage in the US equities market," Quantitative Finance, Taylor & Francis Journals, vol. 10(7), pages 761-782.
    6. Christopher Krauss & Anh Do & Nicolas Huck, 2017. "Deep neural networks, gradient-boosted trees, random forests: Statistical arbitrage on the S&P 500," Post-Print hal-01768895, HAL.
    7. Fischer, Thomas & Krauss, Christopher, 2018. "Deep learning with long short-term memory networks for financial market predictions," European Journal of Operational Research, Elsevier, vol. 270(2), pages 654-669.
    Full references (including those not matched with items on IDEAS)

    Citations

    Citations are extracted by the CitEc Project, subscribe to its RSS feed for this item.
    as


    Cited by:

    1. Illia Baranochnikov & Robert Ślepaczuk, 2022. "A comparison of LSTM and GRU architectures with novel walk-forward approach to algorithmic investment strategy," Working Papers 2022-21, Faculty of Economic Sciences, University of Warsaw.
    2. Yue-Jun Zhang & Han Zhang & Rangan Gupta, 2021. "Forecasting the Artificial Intelligence Index Returns: A Hybrid Approach," Working Papers 202182, University of Pretoria, Department of Economics.
    3. Wei Liu & Yoshihisa Suzuki & Shuyi Du, 2024. "Forecasting the Stock Price of Listed Innovative SMEs Using Machine Learning Methods Based on Bayesian optimization: Evidence from China," Computational Economics, Springer;Society for Computational Economics, vol. 63(5), pages 2035-2068, May.
    4. Ahmed, Shamima & Alshater, Muneer M. & Ammari, Anis El & Hammami, Helmi, 2022. "Artificial intelligence and machine learning in finance: A bibliometric review," Research in International Business and Finance, Elsevier, vol. 61(C).
    5. Jonathan Ansari & Eva Lutkebohmert & Ariel Neufeld & Julian Sester, 2022. "Improved Robust Price Bounds for Multi-Asset Derivatives under Market-Implied Dependence Information," Papers 2204.01071, arXiv.org, revised Sep 2023.
    6. Hanauer, Matthias X. & Kononova, Marina & Rapp, Marc Steffen, 2022. "Boosting agnostic fundamental analysis: Using machine learning to identify mispricing in European stock markets," Finance Research Letters, Elsevier, vol. 48(C).
    7. Ariel Neufeld & Julian Sester & Daiying Yin, 2022. "Detecting data-driven robust statistical arbitrage strategies with deep neural networks," Papers 2203.03179, arXiv.org, revised Feb 2024.
    8. Sadorsky, Perry, 2022. "Forecasting solar stock prices using tree-based machine learning classification: How important are silver prices?," The North American Journal of Economics and Finance, Elsevier, vol. 61(C).
    9. Stefan Tsokov & Milena Lazarova & Adelina Aleksieva-Petrova, 2022. "A Hybrid Spatiotemporal Deep Model Based on CNN and LSTM for Air Pollution Prediction," Sustainability, MDPI, vol. 14(9), pages 1-38, April.

    Most related items

    These are the items that most often cite the same works as this one and are cited by the same works as this one.
    1. Ghosh, Pushpendu & Neufeld, Ariel & Sahoo, Jajati Keshari, 2022. "Forecasting directional movements of stock prices for intraday trading using LSTM and random forests," Finance Research Letters, Elsevier, vol. 46(PA).
    2. Flori, Andrea & Regoli, Daniele, 2021. "Revealing Pairs-trading opportunities with long short-term memory networks," European Journal of Operational Research, Elsevier, vol. 295(2), pages 772-791.
    3. Huck, Nicolas, 2019. "Large data sets and machine learning: Applications to statistical arbitrage," European Journal of Operational Research, Elsevier, vol. 278(1), pages 330-342.
    4. Han, Chulwoo & He, Zhaodong & Toh, Alenson Jun Wei, 2023. "Pairs trading via unsupervised learning," European Journal of Operational Research, Elsevier, vol. 307(2), pages 929-947.
    5. Knoll, Julian & Stübinger, Johannes & Grottke, Michael, 2017. "Exploiting social media with higher-order Factorization Machines: Statistical arbitrage on high-frequency data of the S&P 500," FAU Discussion Papers in Economics 13/2017, Friedrich-Alexander University Erlangen-Nuremberg, Institute for Economics.
    6. Fischer, Thomas & Krauss, Christopher, 2017. "Deep learning with long short-term memory networks for financial market predictions," FAU Discussion Papers in Economics 11/2017, Friedrich-Alexander University Erlangen-Nuremberg, Institute for Economics.
    7. Rubesam, Alexandre, 2022. "Machine learning portfolios with equal risk contributions: Evidence from the Brazilian market," Emerging Markets Review, Elsevier, vol. 51(PB).
    8. Kim, A. & Yang, Y. & Lessmann, S. & Ma, T. & Sung, M.-C. & Johnson, J.E.V., 2020. "Can deep learning predict risky retail investors? A case study in financial risk behavior forecasting," European Journal of Operational Research, Elsevier, vol. 283(1), pages 217-234.
    9. Kolesnikova, A. & Yang, Y. & Lessmann, S. & Ma, T. & Sung, M.-C. & Johnson, J.E.V., 2019. "Can Deep Learning Predict Risky Retail Investors? A Case Study in Financial Risk Behavior Forecasting," IRTG 1792 Discussion Papers 2019-023, Humboldt University of Berlin, International Research Training Group 1792 "High Dimensional Nonstationary Time Series".
    10. Matthew Clegg & Christopher Krauss, 2018. "Pairs trading with partial cointegration," Quantitative Finance, Taylor & Francis Journals, vol. 18(1), pages 121-138, January.
    11. José Cerda & Nicolás Rojas-Morales & Marcel C. Minutolo & Werner Kristjanpoller, 2022. "High Frequency and Dynamic Pairs Trading with Ant Colony Optimization," Computational Economics, Springer;Society for Computational Economics, vol. 59(3), pages 1251-1275, March.
    12. Fischer, Thomas & Krauss, Christopher, 2018. "Deep learning with long short-term memory networks for financial market predictions," European Journal of Operational Research, Elsevier, vol. 270(2), pages 654-669.
    13. Thomas Günter Fischer & Christopher Krauss & Alexander Deinert, 2019. "Statistical Arbitrage in Cryptocurrency Markets," JRFM, MDPI, vol. 12(1), pages 1-15, February.
    14. Alexander Jakob Dautel & Wolfgang Karl Härdle & Stefan Lessmann & Hsin-Vonn Seow, 2020. "Forex exchange rate forecasting using deep recurrent neural networks," Digital Finance, Springer, vol. 2(1), pages 69-96, September.
    15. Kasper Johansson & Thomas Schmelzer & Stephen Boyd, 2024. "Finding Moving-Band Statistical Arbitrages via Convex-Concave Optimization," Papers 2402.08108, arXiv.org.
    16. Ha, Youngmin & Zhang, Hai, 2020. "Algorithmic trading for online portfolio selection under limited market liquidity," European Journal of Operational Research, Elsevier, vol. 286(3), pages 1033-1051.
    17. Fabian Waldow & Matthias Schnaubelt & Christopher Krauss & Thomas Günter Fischer, 2021. "Machine Learning in Futures Markets," JRFM, MDPI, vol. 14(3), pages 1-14, March.
    18. Omer Berat Sezer & Mehmet Ugur Gudelek & Ahmet Murat Ozbayoglu, 2019. "Financial Time Series Forecasting with Deep Learning : A Systematic Literature Review: 2005-2019," Papers 1911.13288, arXiv.org.
    19. Sang Il Lee & Seong Joon Yoo, 2017. "Threshold-Based Portfolio: The Role of the Threshold and Its Applications," Papers 1709.09822, arXiv.org, revised Aug 2018.
    20. Schnaubelt, Matthias & Fischer, Thomas G. & Krauss, Christopher, 2018. "Separating the signal from the noise - financial machine learning for Twitter," FAU Discussion Papers in Economics 14/2018, Friedrich-Alexander University Erlangen-Nuremberg, Institute for Economics.

    More about this item

    NEP fields

    This paper has been announced in the following NEP Reports:

    Statistics

    Access and download statistics

    Corrections

    All material on this site has been provided by the respective publishers and authors. You can help correct errors and omissions. When requesting a correction, please mention this item's handle: RePEc:arx:papers:2004.10178. See general information about how to correct material in RePEc.

    If you have authored this item and are not yet registered with RePEc, we encourage you to do it here. This allows to link your profile to this item. It also allows you to accept potential citations to this item that we are uncertain about.

    If CitEc recognized a bibliographic reference but did not link an item in RePEc to it, you can help with this form .

    If you know of missing items citing this one, you can help us creating those links by adding the relevant references in the same way as above, for each refering item. If you are a registered author of this item, you may also want to check the "citations" tab in your RePEc Author Service profile, as there may be some citations waiting for confirmation.

    For technical questions regarding this item, or to correct its authors, title, abstract, bibliographic or download information, contact: arXiv administrators (email available below). General contact details of provider: http://arxiv.org/ .

    Please note that corrections may take a couple of weeks to filter through the various RePEc services.

    IDEAS is a RePEc service. RePEc uses bibliographic data supplied by the respective publishers.