Predicting stock price movements in emerging markets like Iran is especially daunting due to acute volatility, data scarcity, and structural fragility. We propose a statistically rigorous, context-aware framework that fuses technical analysis with machine learning — including XGBoost, Random Forest, Artificial Neural Networks (ANNs), and Linear Model (LM) — aimed at predicting daily stock returns across multiple industry segments of the Tehran Stock Exchange. Using daily observations from six industrial sectors (Automotive, Financial, Food, Pharmaceutical, Basic Metals, Petroleum) between March 24, 2020 and August 21, 2024, we show that no single model reigns supreme across all domains. In the Financial and Basic Metals sectors, XGBoost delivers statistically superior predictive accuracy (Diebold–Mariano test, p < 0.05). In the highly volatile Petroleum sector, ANN distinctly captures extreme nonlinear dynamics, outperforming alternatives. Surprisingly, in more stable sectors like Pharmaceutical and Food, the Linear Model — with its structural simplicity — surpasses more sophisticated algorithms. Random Forest meanwhile operates as a dependable, interpretable benchmark, consistently delivering solid performance across varied conditions. These results challenge the “more complexity is always better” assumption and underscore that optimal modeling must be sector-specific, backed by rigorous statistical validation, and assessed via risk-adjusted forecasting metrics. Our framework offers a replicable, adaptive blueprint for return-based algorithmic forecasting in data-constrained, high-volatility settings — setting a new methodological standard for emerging markets globally. |