IDEAS home Printed from https://ideas.repec.org/p/war/wpaper/2022-29.html
   My bibliography  Save this paper

The efficiency of various types of input layers of LSTM model in investment strategies on S&P500 index

Author

Listed:
  • Thi Thu Giang Nguyen

    (University of Warsaw, Faculty of Economic Sciences, Quantitative Finance Research Group)

  • Robert Ślepaczuk

    (University of Warsaw, Faculty of Economic Sciences, Quantitative Finance Research Group, Department of Quantitative Finance)

Abstract

The study compares the use of various Long Short-Term Memory (LSTM) variants to conventional technical indicators for trading the S&P 500 index between 2011 and 2022. Two methods were used to test each strategy: a fixed training data set from 2001–2010 and a rolling train–test window. Due to the input sensitivity of LSTM models, we concentrated on data processing and hyperparameter tuning to find the best model. Instead of using the traditional MSE function, we used the Mean Absolute Directional Loss (MADL) function based on recent research to enhance model performance. The models were assessed using the Information Ratio and the Modified Information Ratio, which considers the maximum drawdown and the sign of the annualized return compounded (ARC). LSTM models' performance was compared to benchmark strategies using the SMA, MACD, RSI, and Buy&Hold strategies. We rejected the hypothesis that algorithmic investment strategy using signals from LSTM model consisting only from daily returns in its input layer is more efficient. However, we could not reject the hypothesis that signals generated by LSTM model combining daily returns and technical indicators in its input layer are more efficient. The LSTM Extended model that combined daily returns with MACD and RSI in the input layer generated a better result than Buy&Hold and other strategies using a single technical indicator. The results of the sensitivity analysis show how sensitive this model is to inputs like sequence length, batch size, technical indicators, and the length of the rolling train - test window.

Suggested Citation

  • Thi Thu Giang Nguyen & Robert Ślepaczuk, 2022. "The efficiency of various types of input layers of LSTM model in investment strategies on S&P500 index," Working Papers 2022-29, Faculty of Economic Sciences, University of Warsaw.
  • Handle: RePEc:war:wpaper:2022-29
    as

    Download full text from publisher

    File URL: https://www.wne.uw.edu.pl/download_file/2345/0
    File Function: First version, 2022
    Download Restriction: no
    ---><---

    References listed on IDEAS

    as
    1. Jian Wang & Junseok Kim, 2018. "Predicting Stock Price Trend Using MACD Optimized by Historical Volatility," Mathematical Problems in Engineering, Hindawi, vol. 2018, pages 1-12, December.
    2. Sangyeon Kim & Myungjoo Kang, 2019. "Financial series prediction using Attention LSTM," Papers 1902.10877, arXiv.org.
    3. 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.
    4. Terence Tai-Leung Chong & Wing-Kam Ng, 2008. "Technical analysis and the London stock exchange: testing the MACD and RSI rules using the FT30," Applied Economics Letters, Taylor & Francis Journals, vol. 15(14), pages 1111-1114.
    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. Rayadurgam, Vikram Chandramouli & Mangalagiri, Jayasree, 2023. "Does inclusion of GARCH variance in deep learning models improve financial contagion prediction?," Finance Research Letters, Elsevier, vol. 54(C).

    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. Sukono & Dedi Rosadi & Di Asih I Maruddani & Riza Andrian Ibrahim & Muhamad Deni Johansyah, 2024. "Mechanisms of Stock Selection and Its Capital Weighing in the Portfolio Design Based on the MACD-K-Means-Mean-VaR Model," Mathematics, MDPI, vol. 12(2), pages 1-22, January.
    2. Paul Bilokon & Yitao Qiu, 2023. "Transformers versus LSTMs for electronic trading," Papers 2309.11400, arXiv.org.
    3. Traianos-Ioannis Theodorou & Alexandros Zamichos & Michalis Skoumperdis & Anna Kougioumtzidou & Kalliopi Tsolaki & Dimitris Papadopoulos & Thanasis Patsios & George Papanikolaou & Athanasios Konstanti, 2021. "An AI-Enabled Stock Prediction Platform Combining News and Social Sensing with Financial Statements," Future Internet, MDPI, vol. 13(6), pages 1-22, May.
    4. Chen & Jo-Hui & Hussain & Sabbor & Chen & Fu-Ying, 2023. "The Relationship between VIX and Technical Indicator: The Analysis of Shared-Frailty Model," Journal of Applied Finance & Banking, SCIENPRESS Ltd, vol. 13(3), pages 1-5.
    5. Wei Dai & Yuan An & Wen Long, 2021. "Price change prediction of ultra high frequency financial data based on temporal convolutional network," Papers 2107.00261, arXiv.org.
    6. Shao, Zhen & Zheng, Qingru & Yang, Shanlin & Gao, Fei & Cheng, Manli & Zhang, Qiang & Liu, Chen, 2020. "Modeling and forecasting the electricity clearing price: A novel BELM based pattern classification framework and a comparative analytic study on multi-layer BELM and LSTM," Energy Economics, Elsevier, vol. 86(C).
    7. Kamaladdin Fataliyev & Aneesh Chivukula & Mukesh Prasad & Wei Liu, 2021. "Stock Market Analysis with Text Data: A Review," Papers 2106.12985, arXiv.org, revised Jul 2021.
    8. Giacomo di Tollo & Joseph Andria & Gianni Filograsso, 2023. "The Predictive Power of Social Media Sentiment: Evidence from Cryptocurrencies and Stock Markets Using NLP and Stochastic ANNs," Mathematics, MDPI, vol. 11(16), pages 1-18, August.
    9. Ghosh, Indranil & Chaudhuri, Tamal Datta & Alfaro-Cortés, Esteban & Gámez, Matías & García, Noelia, 2022. "A hybrid approach to forecasting futures prices with simultaneous consideration of optimality in ensemble feature selection and advanced artificial intelligence," Technological Forecasting and Social Change, Elsevier, vol. 181(C).
    10. Sina Montazeri & Akram Mirzaeinia & Haseebullah Jumakhan & Amir Mirzaeinia, 2024. "CNN-DRL for Scalable Actions in Finance," Papers 2401.06179, arXiv.org.
    11. Erdemlioglu, Deniz & Petitjean, Mikael & Vargas, Nicolas, 2021. "Market instability and technical trading at high frequency: Evidence from NASDAQ stocks," Economic Modelling, Elsevier, vol. 102(C).
    12. Alameer, Zakaria & Elaziz, Mohamed Abd & Ewees, Ahmed A. & Ye, Haiwang & Jianhua, Zhang, 2019. "Forecasting gold price fluctuations using improved multilayer perceptron neural network and whale optimization algorithm," Resources Policy, Elsevier, vol. 61(C), pages 250-260.
    13. Mst. Shapna Akter & Hossain Shahriar & Reaz Chowdhury & M. R. C. Mahdy, 2022. "Forecasting the Risk Factor of Frontier Markets: A Novel Stacking Ensemble of Neural Network Approach," Future Internet, MDPI, vol. 14(9), pages 1-23, August.
    14. Noura Metawa & Mohamemd I. Alghamdi & Ibrahim M. El-Hasnony & Mohamed Elhoseny, 2021. "Return Rate Prediction in Blockchain Financial Products Using Deep Learning," Sustainability, MDPI, vol. 13(21), pages 1-16, October.
    15. Kentaro Imajo & Kentaro Minami & Katsuya Ito & Kei Nakagawa, 2020. "Deep Portfolio Optimization via Distributional Prediction of Residual Factors," Papers 2012.07245, arXiv.org.
    16. Kailai Ni & Jianzhou Wang & Guangyu Tang & Danxiang Wei, 2019. "Research and Application of a Novel Hybrid Model Based on a Deep Neural Network for Electricity Load Forecasting: A Case Study in Australia," Energies, MDPI, vol. 12(13), pages 1-30, June.
    17. Jie Fang & Jianwu Lin & Shutao Xia & Yong Jiang & Zhikang Xia & Xiang Liu, 2020. "Neural Network-based Automatic Factor Construction," Papers 2008.06225, arXiv.org, revised Oct 2020.
    18. Michael McAleer & John Suen & Wing Keung Wong, 2016. "Profiteering from the Dot-Com Bubble, Subprime Crisis and Asian Financial Crisis," The Japanese Economic Review, Japanese Economic Association, vol. 67(3), pages 257-279, September.
    19. Qing, Xiangyun & Niu, Yugang, 2018. "Hourly day-ahead solar irradiance prediction using weather forecasts by LSTM," Energy, Elsevier, vol. 148(C), pages 461-468.
    20. James Wallbridge, 2020. "Transformers for Limit Order Books," Papers 2003.00130, arXiv.org.

    More about this item

    Keywords

    algorithmic investment strategies; machine learning; testing architecture; deep learning; recurrent neural networks; LSTM; technical indicators; forecasting financial-time series; technical indicators; hyperparameter tuning S&P 500 Index;
    All these keywords.

    JEL classification:

    • C15 - Mathematical and Quantitative Methods - - Econometric and Statistical Methods and Methodology: General - - - Statistical Simulation Methods: General
    • C45 - Mathematical and Quantitative Methods - - Econometric and Statistical Methods: Special Topics - - - Neural Networks and Related Topics
    • C52 - Mathematical and Quantitative Methods - - Econometric Modeling - - - Model Evaluation, Validation, and Selection
    • C53 - Mathematical and Quantitative Methods - - Econometric Modeling - - - Forecasting and Prediction Models; Simulation Methods
    • C58 - Mathematical and Quantitative Methods - - Econometric Modeling - - - Financial Econometrics
    • C61 - Mathematical and Quantitative Methods - - Mathematical Methods; Programming Models; Mathematical and Simulation Modeling - - - Optimization Techniques; Programming Models; Dynamic Analysis
    • G14 - Financial Economics - - General Financial Markets - - - Information and Market Efficiency; Event Studies; Insider Trading
    • G17 - Financial Economics - - General Financial Markets - - - Financial Forecasting and Simulation

    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:war:wpaper:2022-29. 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: Marcin Bąba (email available below). General contact details of provider: https://edirc.repec.org/data/fesuwpl.html .

    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.