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

Transformers versus LSTMs for electronic trading

Author

Listed:
  • Paul Bilokon
  • Yitao Qiu

Abstract

With the rapid development of artificial intelligence, long short term memory (LSTM), one kind of recurrent neural network (RNN), has been widely applied in time series prediction. Like RNN, Transformer is designed to handle the sequential data. As Transformer achieved great success in Natural Language Processing (NLP), researchers got interested in Transformer's performance on time series prediction, and plenty of Transformer-based solutions on long time series forecasting have come out recently. However, when it comes to financial time series prediction, LSTM is still a dominant architecture. Therefore, the question this study wants to answer is: whether the Transformer-based model can be applied in financial time series prediction and beat LSTM. To answer this question, various LSTM-based and Transformer-based models are compared on multiple financial prediction tasks based on high-frequency limit order book data. A new LSTM-based model called DLSTM is built and new architecture for the Transformer-based model is designed to adapt for financial prediction. The experiment result reflects that the Transformer-based model only has the limited advantage in absolute price sequence prediction. The LSTM-based models show better and more robust performance on difference sequence prediction, such as price difference and price movement.

Suggested Citation

  • Paul Bilokon & Yitao Qiu, 2023. "Transformers versus LSTMs for electronic trading," Papers 2309.11400, arXiv.org.
  • Handle: RePEc:arx:papers:2309.11400
    as

    Download full text from publisher

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

    References listed on IDEAS

    as
    1. Sangyeon Kim & Myungjoo Kang, 2019. "Financial series prediction using Attention LSTM," Papers 1902.10877, arXiv.org.
    2. Wei Bao & Jun Yue & Yulei Rao, 2017. "A deep learning framework for financial time series using stacked autoencoders and long-short term memory," PLOS ONE, Public Library of Science, vol. 12(7), pages 1-24, July.
    3. Guillaume Chevillon, 2007. "Direct Multi‐Step Estimation And Forecasting," Journal of Economic Surveys, Wiley Blackwell, vol. 21(4), pages 746-785, September.
    4. Jim Gatheral & Roel Oomen, 2010. "Zero-intelligence realized variance estimation," Finance and Stochastics, Springer, vol. 14(2), pages 249-283, April.
    5. Justin Sirignano & Rama Cont, 2018. "Universal features of price formation in financial markets: perspectives from Deep Learning," Papers 1803.06917, arXiv.org.
    6. Justin Sirignano & Rama Cont, 2018. "Universal features of price formation in financial markets: perspectives from Deep Learning," Working Papers hal-01754054, HAL.
    7. Fama, Eugene F, 1970. "Efficient Capital Markets: A Review of Theory and Empirical Work," Journal of Finance, American Finance Association, vol. 25(2), pages 383-417, May.
    8. Fazl Barez & Paul Bilokon & Arthur Gervais & Nikita Lisitsyn, 2023. "Exploring the Advantages of Transformers for High-Frequency Trading," Papers 2302.13850, arXiv.org.
    9. Priyank Sonkiya & Vikas Bajpai & Anukriti Bansal, 2021. "Stock price prediction using BERT and GAN," Papers 2107.09055, arXiv.org.
    10. 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.
    11. Zihao Zhang & Stefan Zohren, 2021. "Multi-Horizon Forecasting for Limit Order Books: Novel Deep Learning Approaches and Hardware Acceleration using Intelligent Processing Units," Papers 2105.10430, arXiv.org, revised Aug 2021.
    Full references (including those not matched with items on IDEAS)

    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. Zihao Zhang & Stefan Zohren & Stephen Roberts, 2018. "DeepLOB: Deep Convolutional Neural Networks for Limit Order Books," Papers 1808.03668, arXiv.org, revised Jan 2020.
    2. 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.
    3. Qi Zhao, 2020. "A Deep Learning Framework for Predicting Digital Asset Price Movement from Trade-by-trade Data," Papers 2010.07404, arXiv.org.
    4. Ahmet Murat Ozbayoglu & Mehmet Ugur Gudelek & Omer Berat Sezer, 2020. "Deep Learning for Financial Applications : A Survey," Papers 2002.05786, arXiv.org.
    5. 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.
    6. Ehsan Hoseinzade & Saman Haratizadeh & Arash Khoeini, 2019. "U-CNNpred: A Universal CNN-based Predictor for Stock Markets," Papers 1911.12540, arXiv.org.
    7. Firuz Kamalov, 2019. "Forecasting significant stock price changes using neural networks," Papers 1912.08791, arXiv.org.
    8. Ehsan Hoseinzade & Saman Haratizadeh, 2018. "CNNPred: CNN-based stock market prediction using several data sources," Papers 1810.08923, arXiv.org.
    9. Bryan Lim & Stefan Zohren & Stephen Roberts, 2019. "Enhancing Time Series Momentum Strategies Using Deep Neural Networks," Papers 1904.04912, arXiv.org, revised Sep 2020.
    10. Hyungjun Park & Min Kyu Sim & Dong Gu Choi, 2019. "An intelligent financial portfolio trading strategy using deep Q-learning," Papers 1907.03665, arXiv.org, revised Nov 2019.
    11. Montserrat Reyna Miranda & Ricardo Massa Roldán & Vicente Gómez Salcido, 2022. "Neuro-wavelet Model for price prediction in high-frequency data in the Mexican Stock market," Remef - Revista Mexicana de Economía y Finanzas Nueva Época REMEF (The Mexican Journal of Economics and Finance), Instituto Mexicano de Ejecutivos de Finanzas, IMEF, vol. 17(1), pages 1-23, Enero - M.
    12. U, JuHyok & Lu, PengYu & Kim, ChungSong & Ryu, UnSok & Pak, KyongSok, 2020. "A new LSTM based reversal point prediction method using upward/downward reversal point feature sets," Chaos, Solitons & Fractals, Elsevier, vol. 132(C).
    13. Kieran Wood & Stephen Roberts & Stefan Zohren, 2021. "Slow Momentum with Fast Reversion: A Trading Strategy Using Deep Learning and Changepoint Detection," Papers 2105.13727, arXiv.org, revised Dec 2021.
    14. Ivan Peñaloza & Pablo Padilla, 2022. "A Pricing Method in a Constrained Market with Differential Informational Frameworks," Computational Economics, Springer;Society for Computational Economics, vol. 60(3), pages 1055-1100, 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. Ymir Makinen & Juho Kanniainen & Moncef Gabbouj & Alexandros Iosifidis, 2018. "Forecasting of Jump Arrivals in Stock Prices: New Attention-based Network Architecture using Limit Order Book Data," Papers 1810.10845, arXiv.org.
    17. James Wallbridge, 2020. "Transformers for Limit Order Books," Papers 2003.00130, arXiv.org.
    18. Amin Aminimehr & Ali Raoofi & Akbar Aminimehr & Amirhossein Aminimehr, 2022. "A Comprehensive Study of Market Prediction from Efficient Market Hypothesis up to Late Intelligent Market Prediction Approaches," Computational Economics, Springer;Society for Computational Economics, vol. 60(2), pages 781-815, August.
    19. Taewook Kim & Ha Young Kim, 2019. "Forecasting stock prices with a feature fusion LSTM-CNN model using different representations of the same data," PLOS ONE, Public Library of Science, vol. 14(2), pages 1-23, February.
    20. Ben Moews, 2023. "On random number generators and practical market efficiency," Papers 2305.17419, arXiv.org, revised Jul 2023.

    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:2309.11400. 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.