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

Quantformer: from attention to profit with a quantitative transformer trading strategy

Author

Listed:
  • Zhaofeng Zhang
  • Banghao Chen
  • Shengxin Zhu
  • Nicolas Langren'e

Abstract

In traditional quantitative trading practice, navigating the complicated and dynamic financial market presents a persistent challenge. Fully capturing various market variables, including long-term information, as well as essential signals that may lead to profit remains a difficult task for learning algorithms. In order to tackle this challenge, this paper introduces quantformer, an enhanced neural network architecture based on transformers, to build investment factors. By transfer learning from sentiment analysis, quantformer not only exploits its original inherent advantages in capturing long-range dependencies and modeling complex data relationships, but is also able to solve tasks with numerical inputs and accurately forecast future returns over a given period. This work collects more than 5,000,000 rolling data of 4,601 stocks in the Chinese capital market from 2010 to 2019. The results of this study demonstrated the model's superior performance in predicting stock trends compared with other 100 factor-based quantitative strategies. Notably, the model's innovative use of transformer-liked model to establish factors, in conjunction with market sentiment information, has been shown to enhance the accuracy of trading signals significantly, thereby offering promising implications for the future of quantitative trading strategies.

Suggested Citation

  • Zhaofeng Zhang & Banghao Chen & Shengxin Zhu & Nicolas Langren'e, 2024. "Quantformer: from attention to profit with a quantitative transformer trading strategy," Papers 2404.00424, arXiv.org, revised Oct 2024.
  • Handle: RePEc:arx:papers:2404.00424
    as

    Download full text from publisher

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

    References listed on IDEAS

    as
    1. Alec N. Kercheval & Yuan Zhang, 2015. "Modelling high-frequency limit order book dynamics with support vector machines," Quantitative Finance, Taylor & Francis Journals, vol. 15(8), pages 1315-1329, August.
    2. Fama, Eugene F. & French, Kenneth R., 2015. "A five-factor asset pricing model," Journal of Financial Economics, Elsevier, vol. 116(1), pages 1-22.
    3. Diamond, Peter A., 1971. "A model of price adjustment," Journal of Economic Theory, Elsevier, vol. 3(2), pages 156-168, June.
    4. Fama, Eugene F. & French, Kenneth R., 1993. "Common risk factors in the returns on stocks and bonds," Journal of Financial Economics, Elsevier, vol. 33(1), pages 3-56, February.
    5. William F. Sharpe, 1964. "Capital Asset Prices: A Theory Of Market Equilibrium Under Conditions Of Risk," Journal of Finance, American Finance Association, vol. 19(3), pages 425-442, September.
    6. Shijie Wu & Ozan Irsoy & Steven Lu & Vadim Dabravolski & Mark Dredze & Sebastian Gehrmann & Prabhanjan Kambadur & David Rosenberg & Gideon Mann, 2023. "BloombergGPT: A Large Language Model for Finance," Papers 2303.17564, arXiv.org, revised Dec 2023.
    7. 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.
    8. 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.
    9. Yanhui Chen & Hanhui Zhao & Ziyu Li & Jinrong Lu, 2020. "A dynamic analysis of the relationship between investor sentiment and stock market realized volatility: Evidence from China," PLOS ONE, Public Library of Science, vol. 15(12), pages 1-18, December.
    10. Haritha P H & Abdul Rishad, 2020. "An empirical examination of investor sentiment and stock market volatility: evidence from India," Financial Innovation, Springer;Southwestern University of Finance and Economics, vol. 6(1), pages 1-15, December.
    11. 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)

    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. 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.
    2. Kentaro Imajo & Kentaro Minami & Katsuya Ito & Kei Nakagawa, 2020. "Deep Portfolio Optimization via Distributional Prediction of Residual Factors," Papers 2012.07245, arXiv.org.
    3. Vitor Azevedo & Christopher Hoegner, 2023. "Enhancing stock market anomalies with machine learning," Review of Quantitative Finance and Accounting, Springer, vol. 60(1), pages 195-230, January.
    4. Jujie Wang & Zhenzhen Zhuang & Liu Feng, 2022. "Intelligent Optimization Based Multi-Factor Deep Learning Stock Selection Model and Quantitative Trading Strategy," Mathematics, MDPI, vol. 10(4), pages 1-19, February.
    5. Muhammad Ateeq ur REHMAN & Masood AHMAD & Furman ALI & Habib AHMAD, 2024. "Expose the Hidden : Investor Sentiment and Anomaly Strategies in Emerging Market," Journal for Economic Forecasting, Institute for Economic Forecasting, vol. 0(4), pages 63-81, December.
    6. 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.
    7. Shi, Huai-Long & Zhou, Wei-Xing, 2022. "Factor volatility spillover and its implications on factor premia," Journal of International Financial Markets, Institutions and Money, Elsevier, vol. 80(C).
    8. Bo-Hung Chiou & Shen-Ho Chang, 2020. "Influence of Investment Efficiency by Managers and Accounting Conservatism on Idiosyncratic Risks to Investors," Advances in Management and Applied Economics, SCIENPRESS Ltd, vol. 10(1), pages 1-8.
    9. Cakici, Nusret & Zaremba, Adam, 2022. "Salience theory and the cross-section of stock returns: International and further evidence," Journal of Financial Economics, Elsevier, vol. 146(2), pages 689-725.
    10. Zhong, Angel, 2018. "Idiosyncratic volatility in the Australian equity market," Pacific-Basin Finance Journal, Elsevier, vol. 50(C), pages 105-125.
    11. Bradrania, Reza & Veron, Jose Francisco, 2023. "The beta anomaly in the Australian stock market and the lottery demand," Pacific-Basin Finance Journal, Elsevier, vol. 77(C).
    12. Ciciretti, Rocco & Dalò, Ambrogio & Dam, Lammertjan, 2023. "The contributions of betas versus characteristics to the ESG premium," Journal of Empirical Finance, Elsevier, vol. 71(C), pages 104-124.
    13. Carmine De Franco & Johann Nicolle & Huyên Pham, 2019. "Dealing with Drift Uncertainty: A Bayesian Learning Approach," Risks, MDPI, vol. 7(1), pages 1-18, January.
    14. Yu Wang & Haicheng Shu, 2019. "Evaluating the Performance of Factor Pricing Models for Different Stock Market Trends: Evidence from China," Working Papers 2019-10-10, Wang Yanan Institute for Studies in Economics (WISE), Xiamen University.
    15. Sara Kelly Anzinger & Chinmoy Ghosh & Milena Petrova, 2017. "The Other Side of Value: The Effect of Quality on Price and Return in Real Estate," The Journal of Real Estate Finance and Economics, Springer, vol. 54(3), pages 429-457, April.
    16. Shiyang Huang & Xin Liu & Dong Lou & Christopher Polk, 2024. "The Booms and Busts of Beta Arbitrage," Management Science, INFORMS, vol. 70(8), pages 5367-5385, August.
    17. Czapkiewicz, Anna & Wójtowicz, Tomasz & Zaremba, Adam, 2023. "Idiosyncratic risk and cross-section of stock returns in emerging European markets," Economic Modelling, Elsevier, vol. 124(C).
    18. Pedro Reis & Ana Paula Serra & Jo~ao Gama, 2025. "The Role of Deep Learning in Financial Asset Management: A Systematic Review," Papers 2503.01591, arXiv.org.
    19. Linnenluecke, Martina K. & Chen, Xiaoyan & Ling, Xin & Smith, Tom & Zhu, Yushu, 2017. "Research in finance: A review of influential publications and a research agenda," Pacific-Basin Finance Journal, Elsevier, vol. 43(C), pages 188-199.
    20. Cong Wang, 2024. "Stock return prediction with multiple measures using neural network models," Financial Innovation, Springer;Southwestern University of Finance and Economics, vol. 10(1), pages 1-34, December.

    More about this item

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