Predicting Stock Prices using Machine Learning Algorithms

Authors

  • Sidrah Kaleem Economist, Email: sidrahkaleem@gmail.com
  • Hafsa Rasheed Lecturer, Rawalpindi Women University, Email: hafsa.rasheed.rwu@gmail.com
  • Anees Shahzad Linnaeus University Växjö, Sweden, Email: as.bajwaa@gmail.com

DOI:

https://doi.org/10.71145/rjsp.v3i3.347

Abstract

This study tests whether modern machine-learning models can generate economically meaningful alpha when forecasting daily U.S. large-cap returns under realistic trading frictions. Using 11 years of high-resolution data (2013-2023) on 423 liquid S&P-500 constituents, we benchmark six architectures OLS, ARIMA-GARCH, Random Forest, XGBoost, LSTM and the attention-based Temporal Fusion Transformer (TFT) within a rolling 1 260-day/252-day walk-forward protocol. TFT attains the highest directional accuracy (58.7 %, F1 = 0.57) and produces a post-cost Sharpe ratio of 1.31 versus 0.96 for XGBoost; an equal-weight ensemble of TFT, LSTM and XGBoost delivers 1.42 Sharpe with a maximum draw-down of –9.6 %. Ablation studies show technical indicators dominate predictive power, sentiment adds 0.08 Sharpe, and macro variables contribute 0.05. The edge persists at transaction costs up to 10 bps and across the COVID-19 and GFC regimes. While GPU inference and nightly retraining introduce operational overhead, the incremental 0.4 Sharpe remains economically large. Our open-source pipeline and dataset enable full replication and extension.

Downloads

Published

2025-08-07

How to Cite

Sidrah Kaleem, Hafsa Rasheed, & Anees Shahzad. (2025). Predicting Stock Prices using Machine Learning Algorithms. Review Journal of Social Psychology & Social Works, 3(3), 662–674. https://doi.org/10.71145/rjsp.v3i3.347