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. 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.
    4. 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. 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. 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.
    3. 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.
    4. Paul Bilokon & Yitao Qiu, 2023. "Transformers versus LSTMs for electronic trading," Papers 2309.11400, arXiv.org.
    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. 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.
    7. Sina Montazeri & Akram Mirzaeinia & Haseebullah Jumakhan & Amir Mirzaeinia, 2024. "CNN-DRL for Scalable Actions in Finance," Papers 2401.06179, arXiv.org.
    8. Rad, Hossein & Low, Rand Kwong Yew & Miffre, Joëlle & Faff, Robert, 2023. "The commodity risk premium and neural networks," Journal of Empirical Finance, Elsevier, vol. 74(C).
    9. 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.
    10. Kentaro Imajo & Kentaro Minami & Katsuya Ito & Kei Nakagawa, 2020. "Deep Portfolio Optimization via Distributional Prediction of Residual Factors," Papers 2012.07245, arXiv.org.
    11. James Wallbridge, 2020. "Transformers for Limit Order Books," Papers 2003.00130, arXiv.org.
    12. Burka, Dávid & Puppe, Clemens & Szepesváry, László & Tasnádi, Attila, 2022. "Voting: A machine learning approach," European Journal of Operational Research, Elsevier, vol. 299(3), pages 1003-1017.
    13. Charl Maree & Christian W. Omlin, 2022. "Balancing Profit, Risk, and Sustainability for Portfolio Management," Papers 2207.02134, arXiv.org.
    14. Chi Chen & Li Zhao & Wei Cao & Jiang Bian & Chunxiao Xing, 2020. "Trimming the Sail: A Second-order Learning Paradigm for Stock Prediction," Papers 2002.06878, arXiv.org.
    15. Pick-Soon Ling & Ruzita Abdul-Rahim, 2017. "Market Efficiency Based on Unconventional Technical Trading Strategies in Malaysian Stock Market," International Journal of Economics and Financial Issues, Econjournals, vol. 7(3), pages 88-96.
    16. Lijun Wang & Haizhong An & Xiaohua Xia & Xiaojia Liu & Xiaoqi Sun & Xuan Huang, 2014. "Generating Moving Average Trading Rules on the Oil Futures Market with Genetic Algorithms," Mathematical Problems in Engineering, Hindawi, vol. 2014, pages 1-10, May.
    17. Barua, Ronil & Sharma, Anil K., 2022. "Dynamic Black Litterman portfolios with views derived via CNN-BiLSTM predictions," Finance Research Letters, Elsevier, vol. 49(C).
    18. Zhou, Hao & Kalev, Petko S., 2019. "Algorithmic and high frequency trading in Asia-Pacific, now and the future," Pacific-Basin Finance Journal, Elsevier, vol. 53(C), pages 186-207.
    19. Tania Morris & Jules Comeau, 2020. "Portfolio creation using artificial neural networks and classification probabilities: a Canadian study," Financial Markets and Portfolio Management, Springer;Swiss Society for Financial Market Research, vol. 34(2), pages 133-163, June.
    20. Bartosz Bieganowski & Robert Ślepaczuk, 2024. "Supervised Autoencoder MLP for Financial Time Series Forecasting," Working Papers 2024-03, Faculty of Economic Sciences, University of Warsaw.

    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.