EconPapers    
Economics at your fingertips  
 

A comparison of LSTM and GRU architectures with novel walk-forward approach to algorithmic investment strategy

Illia Baranochnikov and Robert Ślepaczuk
Additional contact information
Illia Baranochnikov: University of Warsaw, Faculty of Economic Sciences; Quantitative Finance Research Group

No 2022-21, Working Papers from Faculty of Economic Sciences, University of Warsaw

Abstract: The aim of this work is to build a profitable algorithmic investment strategy on various types of assets. The algorithm is built using recurrent neural networks (LSTM and GRU) as the primary source of signals to buy/sell financial instruments. LSTM and GRU architectures are compared in terms of obtaining the best results and beating the market. The algorithm is tested for four financial instruments (Bitcoin, Tesla, Brent Oil and Gold) on daily and hourly data frequencies. The out-of-sample period is from 1 January 2021 to 1 April 2022. A walk-forward process is responsible for training models and selecting the best model to forecast asset prices in the future. Ten model architectures with various hyperparameters are trained during each step of the walk-forward process. The model architecture with the highest Information Ratio (IR*) in the validation period is used for forecasting in the out-of-sample period. For each strategy, the performance metrics are calculated based on which the profitability of the algorithm is evaluated. At the end, a detailed sensitivity analysis with regards to the main hyperparameters is conducted. The results reveal that LSTM outperforms GRU in most of the cases and that investment strategy built based on LSTM/GRU architecture is able to beat the market only on 50% of tested cases.

Keywords: deep learning; recurrent neural networks; algorithm; trading strategy; LSTM; GRU; walk-forward process (search for similar items in EconPapers)
JEL-codes: C14 C4 C45 C53 C58 G13 (search for similar items in EconPapers)
Pages: 38 pages
Date: 2022
New Economics Papers: this item is included in nep-big and nep-cmp
References: View references in EconPapers View complete reference list from CitEc
Citations: View citations in EconPapers (4)

Downloads: (external link)
https://www.wne.uw.edu.pl/download_file/1910/0 First version, 2022 (application/pdf)

Related works:
This item may be available elsewhere in EconPapers: Search for items with the same title.

Export reference: BibTeX RIS (EndNote, ProCite, RefMan) HTML/Text

Persistent link: https://EconPapers.repec.org/RePEc:war:wpaper:2022-21

Access Statistics for this paper

More papers in Working Papers from Faculty of Economic Sciences, University of Warsaw Contact information at EDIRC.
Bibliographic data for series maintained by Marcin Bąba ().

 
Page updated 2025-04-02
Handle: RePEc:war:wpaper:2022-21