Comparing Transformer-Based Sentiment Models for Technical-Filtered Trading Signal Generation on NASDAQ-100 Stocks
Keywords:
FinBERT, Relative Strength Index, Moving Average, Financial Sentiment Analysis , Trading StrategyAbstract
Predicting stock price movements remains challenging due to nonlinear, dynamic market behavior. News sentiment and technical indicators (RSI, moving averages) each show predictive value, but few studies integrate both within a single, robustly validated framework. This study proposes an algorithmic trading framework integrating daily news sentiment from four pre-trained transformer models (ProsusAI/finbert, nlptown/bert-base-multilingual-uncased-sentiment, yiyanghkust/finbert-tone, and soleimanian/financial-roberta-large-sentiment) with RSI and moving average filters to generate buy signals on 30 NASDAQ-100 stocks. Beyond standard backtesting, the framework is validated through five analyses: benchmark comparison, exit-rule sensitivity, look-ahead-bias alignment, statistical testing, and walk-forward validation. Over a 2-year simulation (57,434 news articles), buy signals were triggered when RSI fell below 40, price pulled back 0.5–5% below MA20, and price remained within 10% above MA50, with entry on day i+1 and a profit-triggered exit. All four models produced positive cumulative returns (123.33–187.84%, Sharpe Ratio 2.00–2.73), remaining profitable under transaction costs up to 0.3% per trade. Benchmarking showed roughly half the Maximum Drawdown of naive baselines despite lower raw returns, favoring selectivity over return maximization. The stop-loss/take-profit variant substantially reduced performance, while stricter news-timestamp alignment left results robust (Sharpe Ratio above 1.5). Statistical tests found three of six model-pair differences significant at the 5% level, though the two top-performing models are statistically indistinguishable (p = 0.546). Out-of-sample evaluation confirmed profitability in the most recent test segment, with acknowledged sub-period variability. These findings position news sentiment as an effective, risk-disciplined complement to technical analysis, with model selection depending on investor priorities.
References
[1] Q. Xiao and B. Ihnaini, “Stock trend prediction using sentiment analysis,” PeerJ Comput. Sci., vol. 9, 2023, doi: 10.7717/PEERJ-CS.1293.
[2] R. A. Yaqin et al., “Stock Price Forecasting Using LSTM with Cross-Validation,” vol. 3, no. 1, pp. 64–79, 2026, doi: 10.26740/vubeta.v3i1.45130.
[3] K. R. Dahal et al., “A comparative study on effect of news sentiment on stock price prediction with deep learning architecture,” PLoS One, vol. 18, no. 4 April, Apr. 2023, doi: 10.1371/journal.pone.0284695.
[4] J. Kim, H. S. Kim, and S. Y. Choi, “Forecasting the S&P 500 Index Using Mathematical-Based Sentiment Analysis and Deep Learning Models: A FinBERT Transformer Model and LSTM,” Axioms, vol. 12, no. 9, Sep. 2023, doi: 10.3390/axioms12090835.
[5] L. Ruan and H. Jiang, “Stock Price Prediction Using FinBERT-Enhanced Sentiment with SHAP Explainability and Differential Privacy,” Mathematics, vol. 13, no. 17, Sep. 2025, doi: 10.3390/math13172747.
[6] S. D. Mehra and S. D. Shetty, “Developing and testing a custom algorithmic trading strategy using exponential moving average, relative strength index, and sentiment analysis,” Journal of Autonomous Intelligence, vol. 7, no. 4, 2024, doi: 10.32629/jai.v7i4.1328.
[7] Y. Mun and N. Kim, “Leveraging Large Language Models for Sentiment Analysis and Investment Strategy Development in Financial Markets,” Journal of Theoretical and Applied Electronic Commerce Research , vol. 20, no. 2, Jun. 2025, doi: 10.3390/jtaer20020077.
[8] Y. Kim, S. Yoo, and S. Park, “A Rule-Based Stock Trading Recommendation System Using Sentiment Analysis and Technical Indicators,” Electronics (Switzerland), vol. 14, no. 4, Feb. 2025, doi: 10.3390/electronics14040773.
[9] O. Shobayo, S. Adeyemi-Longe, O. Popoola, and B. Ogunleye, “Innovative Sentiment Analysis and Prediction of Stock Price Using FinBERT, GPT-4 and Logistic Regression: A Data-Driven Approach,” Big Data and Cognitive Computing, vol. 8, no. 11, Nov. 2024, doi: 10.3390/bdcc8110143.
[10] R. Gómez-Martínez, M. L. Medrano-García, D. López-López, and J. Torres-Pruñonosa, “How Sentiment Indicators Improve Algorithmic Trading Performance,” Sage Open, vol. 15, no. 3, Jul. 2025, doi: 10.1177/21582440251369559.
[11] W. Chen, W. Liu, J. Zheng, and X. Zhang, “Leveraging large language model as news sentiment predictor in stock markets: a knowledge-enhanced strategy,” Discover Computing, vol. 28, no. 1, Dec. 2025, doi: 10.1007/s10791-025-09573-7.
[12] D. Araci, “FinBERT: Financial Sentiment Analysis with Pre-trained Language Models,” Aug. 2019, [Online]. Available: http://arxiv.org/abs/1908.10063
[13] N. L. P. Town, “ bert-base-multilingual-uncased-sentiment (Revision edd66ab) ,” 2023, Hugging Face . doi: 10.57967/hf/1515.
[14] A. H. Huang, H. Wang, and Y. Yang, “FinBERT: A Large Language Model for Extracting Information from Financial Text*,” Contemporary Accounting Research, vol. 40, no. 2, pp. 806–841, May 2023, doi: 10.1111/1911-3846.12832.
[15] P. Huang, Y. Ni, M. Y. Day, and Y. Chen, “Enhancing Investment Profitability: Study on Contrarian Technical Strategies in Brent Crude Oil Markets,” Energies (Basel)., vol. 18, no. 11, Jun. 2025, doi: 10.3390/en18112735.
[16] G. Cohen, “Polynomial Moving Regression Band Stocks Trading System,” Risks, vol. 12, no. 10, Oct. 2024, doi: 10.3390/risks12100166.
[17] M. P. Cristescu, C. Brândaș, D. A. Mara, and P. Ioana, “Fine-Tuning and Explaining FinBERT for Sector-Specific Financial News: A Reproducible Workflow,” Electronics (Switzerland), vol. 14, no. 23, Dec. 2025, doi: 10.3390/electronics14234680.
[18] H. H. Htun, M. Biehl, and N. Petkov, “Survey of feature selection and extraction techniques for stock market prediction,” Dec. 01, 2023, Springer Science and Business Media Deutschland GmbH. doi: 10.1186/s40854-022-00441-7.
[19] Y. Z. Chen, Y. Fang, X. Y. Li, and J. Wei, “A factor pricing model based on double moving average strategy,” Humanit. Soc. Sci. Commun., vol. 10, no. 1, Dec. 2023, doi: 10.1057/s41599-023-02362-x.
[20] M. N. Ramaube, I. O’leary-Govender, and J. Bolton, “The Profitability of Technical Analysis During Volatile Periods in The South African Financial Markets,” INTERNATIONAL JOURNAL OF ECONOMICS AND FINANCE STUDIES, vol. 15, no. 02, pp. 59–89, 2023, doi: 10.34109/ijefs.
[21] J. Li, X. Wang, S. Ahmad, X. Huang, and Y. A. Khan, “Optimization of investment strategies through machine learning,” Heliyon, vol. 9, no. 5, May 2023, doi: 10.1016/j.heliyon.2023.e16155.
[22] Y. Lin and B. Liu, “A Framework for Enhancing Stock Investment Performance by Predicting Important Trading Points with Return-Adaptive Piecewise Linear Representation and Batch Attention Multi-Scale Convolutional Recurrent Neural Network,” Entropy, vol. 25, no. 11, Nov. 2023, doi: 10.3390/e25111500.
[23] O. Mengshetti, K. Gupta, N. Zade, K. Kotecha, S. Mutha, and G. Joshi, “Synergizing quantitative finance models and market microstructure analysis for enhanced algorithmic trading strategies,” Journal of Open Innovation: Technology, Market, and Complexity, vol. 10, no. 3, Sep. 2024, doi: 10.1016/j.joitmc.2024.100334.
[24] K. Saetia and J. Yokrattanasak, “Stock Movement Prediction Using Machine Learning Based on Technical Indicators and Google Trend Searches in Thailand,” International Journal of Financial Studies, vol. 11, no. 1, Mar. 2023, doi: 10.3390/ijfs11010005.
[25] A. Agudelo-Aguirre, N. Duque-Méndez, and A. Galvis-Flórez, “Artificial Intelligence in Stock Market Investment Through the RSI Indicator,” Computers, vol. 14, no. 11, Nov. 2025, doi: 10.3390/computers14110487.
[26] Q. Xiao and B. Ihnaini, “Stock trend prediction using sentiment analysis,” PeerJ Comput. Sci., vol. 9, 2023, doi: 10.7717/PEERJ-CS.1293.
[27] Z. Chang and Z. Zhang, “Judging Stock Trends According to the Sentiments of Stock Comments in Expert Forums,” Electronics (Switzerland), vol. 12, no. 3, Feb. 2023, doi: 10.3390/electronics12030722.
[28] M. Davidovic and J. McCleary, “News Sentiment and Stock Market Dynamics: A Machine Learning Investigation,” Journal of Risk and Financial Management, vol. 18, no. 8, Aug. 2025, doi: 10.3390/jrfm18080412.
[29] X. Zhong and D. Enke, “Predicting the daily return direction of the stock market using hybrid machine learning algorithms,” Financial Innovation, vol. 5, no. 1, Dec. 2019, doi: 10.1186/s40854-019-0138-0.
[30] R. Bhowmik and S. Wang, “Stock market volatility and return analysis: A systematic literature review,” May 01, 2020, MDPI AG. doi: 10.3390/E22050522.
[31] V. Azhmyakov, I. Shirokov, and L. A. Guzman Trujillo, “Advanced Statistical Analysis of the Predicted Volatility Levels in Crypto Markets,” Journal of Risk and Financial Management, vol. 17, no. 7, Jul. 2024, doi: 10.3390/jrfm17070279.
[32] M. Lolic, “Tree-Based Methods of Volatility Prediction for the S&P 500 Index,” Computation, vol. 13, no. 4, Apr. 2025, doi: 10.3390/computation13040084.
[33] K. Yan and Y. Li, “Machine learning-based analysis of volatility quantitative investment strategies for American financial stocks,” Quantitative Finance and Economics, vol. 8, no. 2, pp. 364–386, 2024, doi: 10.3934/QFE.2024014.
[34] A. Bányai, T. Tatay, G. Thalmeiner, and L. Pataki, “The Impact of Rebalancing Strategies on ETF Portfolio Performance,” Journal of Risk and Financial Management, vol. 17, no. 12, Dec. 2024, doi: 10.3390/jrfm17120533.
[35] S. Shahsafi and F. Naderkhani, “A Hybrid Framework for Multi-Stock Trading: Deep Q-Networks with Portfolio Optimization,” Journal of Risk and Financial Management, vol. 19, no. 2, Feb. 2026, doi: 10.3390/jrfm19020132.
[36] D. K. Malhotra, T. Mooney, R. Poteau, and P. Russel, “Assessing the Performance and Risk-Adjusted Returns of Financial Mutual Funds,” International Journal of Financial Studies, vol. 11, no. 4, Dec. 2023, doi: 10.3390/ijfs11040136.
[37] H. Geboers and B. Depaire, “A Rational Risk Policy? Why Path Dependence Matters,” Entropy, vol. 25, no. 2, Feb. 2023, doi: 10.3390/e25020202.
[38] E. Jondeau and A. Pauli, “Large Drawdowns and Long-Term Asset Management,” Journal of Risk and Financial Management, vol. 17, no. 12, Dec. 2024, doi: 10.3390/jrfm17120552.
[39] C. K. Paik, J. Choi, and I. U. Vaquero, “Algorithm-Based Low-Frequency Trading Using a Stochastic Oscillator, Williams%R, and Trading Volume for the S&P 500,” Journal of Risk and Financial Management, vol. 17, no. 11, Nov. 2024, doi: 10.3390/jrfm17110501.
[40] M. Tran, D. Pham-Hi, and M. Bui, “Optimizing Automated Trading Systems with Deep Reinforcement Learning,” Algorithms, vol. 16, no. 1, Jan. 2023, doi: 10.3390/a16010023.
[41] F. X. Diebold and R. S. Mariano, “Comparing Predictive Accuracy,” Journal of Business & Economic Statistics, vol. 13, no. 3, pp. 253–263, 1995, doi: 10.1080/07350015.1995.10524599.
[42] K. Hernández-Romo, J. Lemus-Romani, E. Vega, M. Becerra-Rozas, and A. Romo, “Robust Metaheuristic Optimization for Algorithmic Trading: A Comparative Study of Optimization Techniques,” Mathematics, vol. 14, no. 1, 2026, doi: 10.3390/math14010069.
[43] K. Mishev, A. Gjorgjevikj, I. Vodenska, L. T. Chitkushev, and D. Trajanov, “Evaluation of Sentiment Analysis in Finance: From Lexicons to Transformers,” IEEE Access, vol. 8, pp. 131662–131682, 2020, doi: 10.1109/ACCESS.2020.3009626.
Published
How to Cite
Issue
Section
License
Copyright (c) 2026 Rifki Ainul Yaqin

This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.
Abstract views: 53









