Chong, Kai Jian (2026) Using sentiment analysis to forecast stock short-term trend. Final Year Project, UTAR.
| PDF Download (4Mb) |
Abstract
Investor sentiment, alongside historical price movements and macroeconomic signals, plays a significant role in influencing financial markets. However, the effect of news sentiment on stock prices is often delayed rather than instantaneous, and conventional binary sentiment representations are insufficient to capture these dynamic and lagged relationships for short-term forecasting. Furthermore, the effectiveness of sentiment extraction may vary depending on the underlying language model used. This project aims to develop a sentiment-based stock forecasting system that predicts next-day stock prices using financial news data. News articles are collected from multiple sources, including The Star, Free Malaysia Today, i3Investor and Yahoo Finance, and transformed into sentiment scores using different GPT models. These sentiment signals are aligned with stock closing prices to support short-term forecasting for Malaysian banking stocks, specifically Maybank and Public Bank. A comparative analysis of sentiment representations generated by GPT-5, GPT-5-mini, and GPT-5-nano is conducted to evaluate their effectiveness in capturing meaningful market signals. Subsequently, the integrated sentiment and stock data are incorporated into a prediction framework based on the Autoregressive Distributed Lag (ARDL) model, which captures both historical price dependencies and lagged sentiment effects. The model predicts next-day closing prices using current price and sentiment information, with optimal lag structures selected automatically based on model performance. Model evaluation is conducted using RMSE, MAE, and AIC. Last but not least, to enhance usability and interpretability, a web-based user interface is developed, enabling users to configure parameters such as bank selection, GPT model, and news source, perform predictions, visualize forecasting results, compare model performance, and analyse sentiment effects. The results demonstrate that the ARDL model achieves strong short-term forecasting performance, with RMSE values of approximately 0.13 and predicted prices closely tracking actual trends. For Maybank, the selected ARDL(1,3) model incorporates sentiment lags; however, lag removal experiments and Error Correction Model (ECM) analysis indicate that the 3-day sentiment lag is not statistically significant and can be excluded. In contrast, for Public Bank, the selected ARDL(1,0) model excludes sentiment entirely, suggesting limited predictive contribution of sentiment in this case. Further analysis shows that larger models such as GPT-5 generate more variable and informative sentiment scores, leading to richer lag structures, whereas smaller models such as GPT-5-nano produce more unstable but less informative sentiment, resulting in simpler models and less consistent lag selection. Overall, the project presents a complete end-to-end stock prediction system that integrates data collection, sentiment extraction, modelling, and user interaction, demonstrating the practical applicability of sentiment-aware forecasting in financial analysis.
| Item Type: | Final Year Project / Dissertation / Thesis (Final Year Project) |
|---|---|
| Subjects: | N Fine Arts > NA Architecture T Technology > T Technology (General) T Technology > TD Environmental technology. Sanitary engineering |
| Divisions: | Faculty of Information and Communication Technology > Bachelor of Computer Science (Honours) |
| Depositing User: | ML Main Library |
| Date Deposited: | 05 Aug 2026 18:38 |
| Last Modified: | 05 Aug 2026 18:38 |
| URI: | http://eprints.utar.edu.my/id/eprint/7753 |
Actions (login required)
| View Item |

