DOI - Vydavatelství Mendelovy univerzity v Brně

Identifikátory DOI

DOI: 10.11118/ecos2026_039

LARGE LANGUAGE MODEL AGENTS AS INVESTMENT ADVISORS: A BACKTESTED COMPARISON OF GPT-3.5, GPT-4 AND GPT-4-TURBO OVER INDIAN STOCK DATA

Ankit Tripathi1, Michaela Veselá1, Oldrich Trenz1
1 Department of Informatics, Faculty of Business and Economics, Mendel University in Brno, Zemědělská 1, 613 00 Brno, Czech Republic

This article asks whether an OpenAI GPT model can act as a conversational investment advisor when it reads structured stock data instead of free text. A pandas DataFrame of daily prices for Reliance Industries (RELIANCE.NS), spanning 1 April 2019 to 28 March 2024, was enriched with the signals of four hard-coded technical strategies: gap trading, trend following, Fibonacci retracement and mean reversion. Each strategy was backtested with Pyfolio, and three LangChain DataFrame agents wrapping GPT-3.5-Turbo, GPT-4 and GPT-4-Turbo answered the same seven plain-English questions. Trend following gave the highest backtest return (annual 13.60%, cumulative 86.60%), while Fibonacci retracement was the least risky (max drawdown only -1.10%, Omega ratio 6.33). The GPT-4-Turbo agent gave the most context-aware answers; GPT-3.5-Turbo was inconsistent and once misread a signal. The results hold for a single asset and a no-cost in-sample backtest, so they describe a feasibility study rather than live trading performance.

Klíčová slova: large language models, GPT agents, algorithmic trading, technical analysis, backtesting, Indian stock market

stránky: 356-362, online: 2026



Reference

  1. AKBAS, F., BOEHMER, E., JIANG, C., KOCH, P. D. 2022. Overnight returns, daytime reversals, and future stock returns. Journal of Financial Economics. 145(3), 850-875. https://doi.org/10.1016/j.jfineco.2021.09.019 Přejít k původnímu zdroji...
  2. BANIK, S., SHARMA, N., MANGLA, M., MOHANTY, S. N., SHITHARTH, S. 2022. LSTM based decision support system for swing trading in stock market. Knowledge-Based Systems. 239. https://doi.org/10.1016/j.knosys.2021.107994 Přejít k původnímu zdroji...
  3. DEVLIN, J., CHANG, M.-W., LEE, K., TOUTANOVA, K. 2019. BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding. arXiv:1810.04805. https://doi.org/10.48550/arXiv.1810.04805 Přejít k původnímu zdroji...
  4. EGGEBRECHT, P., LÜTKEBOHMERT, E. 2023. A Deep Trend-Following Trading Strategy for Equity Markets. The Journal of Financial Data Science. 5(1), 41-66. https://doi.org/10.3905/jfds.2023.1.120 Přejít k původnímu zdroji...
  5. HO, H.-W., HSIAO, Y.-J., LO, W.-C., YANG, N.-T. 2023. Momentum investing and a tale of intraday and overnight returns: Evidence from Taiwan. Pacific-Basin Finance Journal. 82. https://doi.org/10.1016/j.pacfin.2023.102151 Přejít k původnímu zdroji...
  6. KALYAN, K. S. 2024. A survey of GPT-3 family large language models including ChatGPT and GPT-4. Natural Language Processing Journal. 6, 100048. https://doi.org/10.1016/j.nlp.2023.100048 Přejít k původnímu zdroji...
  7. LEE, J., STEVENS, N., HAN, S. C., SONG, M. 2024. A Survey of Large Language Models in Finance (FinLLMs). arXiv:2402.02315 https://doi.org/10.48550/arXiv.2402.02315 Přejít k původnímu zdroji...
  8. LI, Y., WANG, S., DING, H., CHEN, H. 2023. Large Language Models in Finance: A Survey. In: ICAIF 2023 - 4th ACM International Conference on AI in Finance, pp. 374-382. https://doi.org/10.1145/3604237.3626869 Přejít k původnímu zdroji...
  9. MACEDO, L. L., GODINHO, P., ALVES, M. J. 2017. Mean-semivariance portfolio optimization with multiobjective evolutionary algorithms and technical analysis rules. Expert Systems with Applications. 79, 33-43. https://doi.org/10.1016/j.eswa.2017.02.033 Přejít k původnímu zdroji...
  10. PAN, T., YU, J., ZHENG, L., LI, Y. 2024. Application and Modeling of LLM in Quantitative Trading Using Deep Learning Strategies. Studies in Computational Intelligence. 1130, 671-678. https://doi.org/10.1007/978-3-031-50381-8_72 Přejít k původnímu zdroji...
  11. TRIPATHI, A. 2024. Automated trading system and artificial intelligence. Master's thesis, head: TRENZ, O. Brno: Mendel University in Brno.
  12. VASWANI, A., SHAZEER, N., PARMAR, N., USZKOREIT, J., JONES, L., GOMEZ, A. N., KAISER, L., POLOSUKHIN, I. 2023. Attention Is All You Need. arXiv:1706.03762 https://doi.org/10.48550/arXiv.1706.03762 Přejít k původnímu zdroji...
  13. WANG, L., MA, C., FENG, X., ZHANG, Z., YANG, H., ZHANG, J., CHEN, Z., TANG, J., CHEN, X., LIN, Y., ZHAO, W. X., WEI, Z. and WEN, J. 2024. A survey on large language model based autonomous agents. Frontiers of Computer Science. 18. https://doi.org/10.1007/s11704-024-40231-1 Přejít k původnímu zdroji...
  14. ZAKAMULIN, V., GINER, J. 2020. Trend following with momentum versus moving averages: a tale of differences. Quantitative Finance. 20(6), 985-1007. https://doi.org/10.1080/14697688.2020.1716057 Přejít k původnímu zdroji...