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

Linking microblogging sentiments to stock price movement: An application of GPT-4

Author

Listed:
  • Rick Steinert
  • Saskia Altmann

Abstract

This paper investigates the potential improvement of the GPT-4 Language Learning Model (LLM) in comparison to BERT for modeling same-day daily stock price movements of Apple and Tesla in 2017, based on sentiment analysis of microblogging messages. We recorded daily adjusted closing prices and translated them into up-down movements. Sentiment for each day was extracted from messages on the Stocktwits platform using both LLMs. We develop a novel method to engineer a comprehensive prompt for contextual sentiment analysis which unlocks the true capabilities of modern LLM. This enables us to carefully retrieve sentiments, perceived advantages or disadvantages, and the relevance towards the analyzed company. Logistic regression is used to evaluate whether the extracted message contents reflect stock price movements. As a result, GPT-4 exhibited substantial accuracy, outperforming BERT in five out of six months and substantially exceeding a naive buy-and-hold strategy, reaching a peak accuracy of 71.47 % in May. The study also highlights the importance of prompt engineering in obtaining desired outputs from GPT-4's contextual abilities. However, the costs of deploying GPT-4 and the need for fine-tuning prompts highlight some practical considerations for its use.

Suggested Citation

  • Rick Steinert & Saskia Altmann, 2023. "Linking microblogging sentiments to stock price movement: An application of GPT-4," Papers 2308.16771, arXiv.org.
  • Handle: RePEc:arx:papers:2308.16771
    as

    Download full text from publisher

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

    References listed on IDEAS

    as
    1. Steve Y. Yang & Sheung Yin Kevin Mo & Anqi Liu, 2015. "Twitter financial community sentiment and its predictive relationship to stock market movement," Quantitative Finance, Taylor & Francis Journals, vol. 15(10), pages 1637-1656, October.
    2. Markus Leippold, 2023. "Sentiment Spin: Attacking Financial Sentiment with GPT-3," Swiss Finance Institute Research Paper Series 23-11, Swiss Finance Institute.
    3. Haohan Zhang & Fengrui Hua & Chengjin Xu & Hao Kong & Ruiting Zuo & Jian Guo, 2023. "Unveiling the Potential of Sentiment: Can Large Language Models Predict Chinese Stock Price Movements?," Papers 2306.14222, arXiv.org, revised May 2024.
    4. 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.
    5. Alejandro Lopez-Lira & Yuehua Tang, 2023. "Can ChatGPT Forecast Stock Price Movements? Return Predictability and Large Language Models," Papers 2304.07619, arXiv.org, revised Sep 2024.
    6. Leippold, Markus, 2023. "Sentiment spin: Attacking financial sentiment with GPT-3," Finance Research Letters, Elsevier, vol. 55(PB).
    7. Jiang, Hao & Li, Sophia Zhengzi & Wang, Hao, 2021. "Pervasive underreaction: Evidence from high-frequency data," Journal of Financial Economics, Elsevier, vol. 141(2), pages 573-599.
    8. Gabriele Ranco & Darko Aleksovski & Guido Caldarelli & Miha Grčar & Igor Mozetič, 2015. "The Effects of Twitter Sentiment on Stock Price Returns," PLOS ONE, Public Library of Science, vol. 10(9), pages 1-21, September.
    9. Mukul Jaggi & Priyanka Mandal & Shreya Narang & Usman Naseem & Matloob Khushi, 2021. "Text Mining of Stocktwits Data for Predicting Stock Prices," Papers 2103.16388, arXiv.org.
    10. R. Cont, 2001. "Empirical properties of asset returns: stylized facts and statistical issues," Quantitative Finance, Taylor & Francis Journals, vol. 1(2), pages 223-236.
    11. Guillaume Coqueret, 2020. "Stock-specific sentiment and return predictability," Quantitative Finance, Taylor & Francis Journals, vol. 20(9), pages 1531-1551, September.
    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. Yuqi Nie & Yaxuan Kong & Xiaowen Dong & John M. Mulvey & H. Vincent Poor & Qingsong Wen & Stefan Zohren, 2024. "A Survey of Large Language Models for Financial Applications: Progress, Prospects and Challenges," Papers 2406.11903, arXiv.org.
    2. Deborah Miori & Constantin Petrov, 2023. "Narratives from GPT-derived Networks of News, and a link to Financial Markets Dislocations," Papers 2311.14419, arXiv.org.

    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. Liping Wang & Jiawei Li & Lifan Zhao & Zhizhuo Kou & Xiaohan Wang & Xinyi Zhu & Hao Wang & Yanyan Shen & Lei Chen, 2023. "Methods for Acquiring and Incorporating Knowledge into Stock Price Prediction: A Survey," Papers 2308.04947, arXiv.org.
    2. Zachary McGurk & Adam Nowak & Joshua C. Hall, 2020. "Stock returns and investor sentiment: textual analysis and social media," Journal of Economics and Finance, Springer;Academy of Economics and Finance, vol. 44(3), pages 458-485, July.
    3. Yuqi Nie & Yaxuan Kong & Xiaowen Dong & John M. Mulvey & H. Vincent Poor & Qingsong Wen & Stefan Zohren, 2024. "A Survey of Large Language Models for Financial Applications: Progress, Prospects and Challenges," Papers 2406.11903, arXiv.org.
    4. Yousaf, Imran & Youssef, Manel & Goodell, John W., 2022. "Quantile connectedness between sentiment and financial markets: Evidence from the S&P 500 twitter sentiment index," International Review of Financial Analysis, Elsevier, vol. 83(C).
    5. Muchnik, Lev & Bunde, Armin & Havlin, Shlomo, 2009. "Long term memory in extreme returns of financial time series," Physica A: Statistical Mechanics and its Applications, Elsevier, vol. 388(19), pages 4145-4150.
    6. Bariviera, Aurelio F. & Font-Ferrer, Alejandro & Sorrosal-Forradellas, M. Teresa & Rosso, Osvaldo A., 2019. "An information theory perspective on the informational efficiency of gold price," The North American Journal of Economics and Finance, Elsevier, vol. 50(C).
    7. Klein, A. & Urbig, D. & Kirn, S., 2008. "Who Drives the Market? Estimating a Heterogeneous Agent-based Financial Market Model Using a Neural Network Approach," MPRA Paper 14433, University Library of Munich, Germany.
    8. David Vidal-Tomás & Simone Alfarano, 2020. "An agent-based early warning indicator for financial market instability," Journal of Economic Interaction and Coordination, Springer;Society for Economic Science with Heterogeneous Interacting Agents, vol. 15(1), pages 49-87, January.
    9. Semei Coronado-Ram'irez & Pedro Celso-Arellano & Omar Rojas, 2014. "Adaptive Market Efficiency of Agricultural Commodity Futures Contracts," Papers 1412.8017, arXiv.org, revised Mar 2015.
    10. Sandrine Jacob Leal & Mauro Napoletano & Andrea Roventini & Giorgio Fagiolo, 2016. "Rock around the clock: An agent-based model of low- and high-frequency trading," Journal of Evolutionary Economics, Springer, vol. 26(1), pages 49-76, March.
    11. Makowiec, D. & Gnaciński, P. & Miklaszewski, W., 2004. "Amplified imitation in percolation model of stock market," Physica A: Statistical Mechanics and its Applications, Elsevier, vol. 331(1), pages 269-278.
    12. Neto, David, 2021. "Are Google searches making the Bitcoin market run amok? A tail event analysis," The North American Journal of Economics and Finance, Elsevier, vol. 57(C).
    13. Oussama Tilfani & My Youssef El Boukfaoui, 2020. "Multifractal Analysis of African Stock Markets During the 2007–2008 US Crisis," Review of Pacific Basin Financial Markets and Policies (RPBFMP), World Scientific Publishing Co. Pte. Ltd., vol. 22(04), pages 1-31, January.
    14. Yudong Wang & Chongfeng Wu, 2013. "Efficiency of Crude Oil Futures Markets: New Evidence from Multifractal Detrending Moving Average Analysis," Computational Economics, Springer;Society for Computational Economics, vol. 42(4), pages 393-414, December.
    15. Paul Handro & Bogdan Dima, 2024. "Analyzing Financial Markets Efficiency: Insights from a Bibliometric and Content Review," Journal of Financial Studies, Institute of Financial Studies, vol. 16(9), pages 119-175, May.
    16. Junshu Jiang & Jordan Richards & Raphael Huser & David Bolin, 2024. "The Efficient Tail Hypothesis: An Extreme Value Perspective on Market Efficiency," Papers 2408.06661, arXiv.org.
    17. Smales, Lee A., 2023. "Classification of RBA monetary policy announcements using ChatGPT," Finance Research Letters, Elsevier, vol. 58(PC).
    18. Torsten Trimborn & Philipp Otte & Simon Cramer & Maximilian Beikirch & Emma Pabich & Martin Frank, 2020. "SABCEMM: A Simulator for Agent-Based Computational Economic Market Models," Computational Economics, Springer;Society for Computational Economics, vol. 55(2), pages 707-744, February.
    19. Onali, Enrico & Goddard, John, 2011. "Are European equity markets efficient? New evidence from fractal analysis," International Review of Financial Analysis, Elsevier, vol. 20(2), pages 59-67, April.
    20. repec:spo:wpmain:info:hdl:2441/f6h8764enu2lskk9p4oq9ig8k is not listed on IDEAS
    21. Andrea Di Iura & Giulia Terenzi, 2022. "A Bayesian analysis of gain-loss asymmetry," SN Business & Economics, Springer, vol. 2(5), pages 1-23, May.

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