Source-linked AI summary

A Hybrid LSTM-XGBoost Framework for Multi-Horizon Stock Return Prediction Across Diversified Equity Portfolios

Seif ElDein Mostafa, Yahia Ahmed, Farah Datwish, Marwa Solayman

arXiv:2609.13125v1cs.AI

TL;DR

Stock-return prediction is challenging because financial series are noisy, nonlinear, and non-stationary. The paper combines LSTM temporal embeddings with technical indicators in an XGBoost model, which achieves a 30-day test RMSE of 0.0949 and improves on the LSTM-only baseline, while long-horizon directional accuracy is strongly affected by positive-return base rates.

  • Problem

    Stock-return forecasting remains challenging because financial time series are non-stationary, nonlinear, and have low signal-to-noise ratios.

    Source: §I · p. 1
  • Method

    The framework combines LSTM temporal embeddings with technical indicators for XGBoost regression across 14 U.S. equities and four prediction horizons.

    Source: §I · pp. 1–2, §III · p. 3, C. LSTM Feature Extractor · p. 3
  • Results

    The hybrid model achieved a global test RMSE of 0.0949 at 30 days and outperformed the LSTM-Only baseline by a factor of three, with per-stock RMSE gains on 7 of 14 equities.

    Source: §V · p. 7
  • Takeaways & Limitations

    A composite score derived from multi-horizon predictions is proposed to support portfolio ranking and decision support.

    Source: §I · p. 2

    The 97.6% directional accuracy at 365 days is partly attributable to the high base rate of positive long-horizon returns in the sample.

    Source: C. Multi-Horizon Performance · p. 5

Abstract

from arXiv · show

Accurate prediction of equity returns remains a major challenge in computational finance due to the non-stationary, nonlinear, and low signal-to-noise ratio nature of financial time series. This paper proposes a hybrid two-stage architecture that combines a long short-term memory (LSTM) network with an XGBoost gradient-boosted regressor for multi-horizon stock return prediction across a diversified panel of 14 U.S. equities spanning six industry sectors. The LSTM component, comprising two stacked layers with 64 hidden units, processes 60-day sliding windows of five sequential market features to produce 64-dimensional temporal embeddings that encode learned sequential market dynamics. These embeddings are concatenated with 14 hand-crafted technical indicators to form a 78-dimensional hybrid feature vector, which is subsequently passed to an XGBoost regressor tuned via 3-fold cross-validation grid search. The framework is trained on a multi-stock pooled corpus using strict chronological splits and per-stock MinMaxScaling to prevent look-ahead bias, and evaluated across four prediction horizons of 30, 90, 252, and 365 trading days. Experimental results demonstrate that the hybrid model achieves a test RMSE of 0.0949 on the 30-day horizon, roughly one-third that of the standalone LSTM baseline, while marginally matching or surpassing the XGBoost-Only baseline across the majority of stocks. Directional accuracy rises with horizon length, reaching 97.6% at 365 days; we show, however, that this largely tracks the high base rate of positive long-horizon returns in the sample, and we therefore benchmark directional accuracy against a naive always-positive predictor and treat the above-base-rate gap at short horizons as the more informative signal. A composite investment scoring framework derived from multi-horizon predictions is further proposed to support portfolio ranking and decision support.

I. INTRODUCTION

Stock-return forecasting is difficult because financial time series are nonlinear, non-stationary, and noisy. The paper motivates combining LSTM temporal features with technical indicators and XGBoost for multi-horizon prediction across a diversified equity panel.

I. INTRODUCTION

  • Financial returns are difficult to forecast because non-stationarity, low signal-to-noise ratios, and nonlinear dynamics challenge classical linear approaches,.Source: §I · p. 1
  • The proposed two-stage model combines LSTM-derived temporal embeddings with technical indicators in an XGBoost regressor, evaluating 14 U.S. equities across six sectors and four horizons.The paper also uses pooled multi-stock training and proposes an investment scoring framework for portfolio decision support.Source: §I · pp. 1–2

II. RELATED WORK

  • The literature motivating this work spans recurrent deep-learning models, technical-indicator-based gradient boosting, and hybrid approaches combining both paradigms.Source: §II · p. 2

A. Recurrent and LSTM-Based Forecasting

Prior work establishes LSTMs as useful for sequential financial patterns, while tree ensembles exploit nonlinear interactions among technical indicators. Hybrid studies motivate combining these strengths, but the cited work leaves diversified multi-stock, multi-horizon evaluation comparatively unaddressed.

A. Recurrent and LSTM-Based Forecasting

  • LSTMs have modeled temporal patterns in equities and indices, but standalone models omit structured technical-indicator knowledge,,,,,.Prior studies report LSTM performance against memory-free or traditional baselines, while emphasizing lookback-window and market-context effects,,,,.Source: A. Recurrent and LSTM-Based Forecasting · p. 2

B. Gradient Boosting and Technical Indicator Methods

C. Hybrid Deep Learning and Ensemble Models

  • Prior hybrids combine sequential models with XGBoost, but cited studies use a single Chinese-market stock or external news features [15],,.This work instead pools 14 equities across six sectors and evaluates four horizons; one shared feature extractor feeds independently tuned horizon-specific XGBoost regressors.Source: C. Hybrid Deep Learning and Ensemble… · pp. 2–3

III. METHODOLOGY

The methodology uses an LSTM as a temporal feature extractor and XGBoost as the final prediction engine. It constructs forward-return targets from post-2010 equity data and preserves temporal order in data splitting and scaling.

III. METHODOLOGY

  • A two-stage pipeline uses a trained LSTM to extract temporal features and an XGBoost regressor to predict from the enriched feature space.Its phases cover data preprocessing, technical feature engineering, LSTM training and extraction, hybrid-feature construction, and XGBoost optimization.Source: §III · p. 3

A. Dataset and Preprocessing

  • The dataset contains daily OHLCV records from 14 equities across six sectors from January 2010 onward, with cumulative returns defined over 30, 90, 252, or 365 trading days.Missing values are forward-filled, and remaining null or infinite rows after indicator computation are dropped.Source: A. Dataset and Preprocessing · p. 3
  • Each stock is split chronologically into training, validation, and test sets without shuffling, and scalers are fitted only on training data.The split proportions are 70%, 15%, and 15%, respectively.Source: A. Dataset and Preprocessing · p. 3

B. Technical Feature Engineering

The section describes technical indicators as domain-knowledge features and an LSTM feature extractor that converts sequential market inputs into a temporal embedding for downstream use.

B. Technical Feature Engineering

  • Fourteen indicators span moving averages, momentum oscillators, volatility, rate of change, and volume, with scaling fitted on the training split only.Moving averages are delayed one day to prevent data leakage.Source: B. Technical Feature Engineering · p. 3

C. LSTM Feature Extractor

  • The LSTMFeatureExtractor uses a two-layer stacked LSTM and a fully connected layer to expose a hidden state embedding for downstream prediction.Its inputs are five scaled sequential features, and the final hidden state is a 64-dimensional embedding.Source: C. LSTM Feature Extractor · p. 3
  • The input window spans 60 trading days, and dropout between the LSTM layers regularizes inter-layer activations.The LSTM is trained to minimize MSE between predicted and actual scaled cumulative returns.Source: C. LSTM Feature Extractor · p. 3

D. Hybrid Feature Construction

After training, the LSTM is frozen to extract temporal embeddings, which are combined with scaled technical indicators into a hybrid feature vector.

E. XGBoost Regression and Hyperparameter Optimization

An XGBoost regressor is trained separately for each prediction horizon on the hybrid features, with hyperparameters selected by cross-validation and evaluation on a held-out test split.

  • A separate XGBoost regressor with a squared-error objective is trained on the hybrid feature matrix for each of the four horizons.Source: E. XGBoost Regression and… · p. 4
  • Hyperparameters are selected by 3-fold cross-validation grid search using the model with the lowest cross-validated MSE.Source: E. XGBoost Regression and… · p. 4, Table II · p. 4
  • All 14 stocks are pooled for training, while per-stock chronological scaling addresses price-level differences between stocks.The selected model is retrained on the full training set and evaluated on the held-out test split.Source: E. XGBoost Regression and… · p. 4

IV. RESULTS AND DISCUSSION

On the 30-day horizon, the hybrid has the best global RMSE, but its margin over XGBoost-Only is small and per-stock improvements are selective.

A. Global Model Comparison on the 30-Day Horizon

B. Per-Stock Performance Analysis

On the 30-day horizon, the Hybrid model has the lowest RMSE on 7 of 14 stocks, while both tree-based models outperform LSTM-Only on every stock.

B. Per-Stock Performance Analysis

  • The Hybrid model has the lowest RMSE on 7 of 14 stocks, including a tie on XOM; XGBoost-Only leads on the other 7.Hybrid leads for NVDA, MSFT, JPM, CVX, AMZN, and WMT, with XOM tied; XGBoost-Only leads for AAPL, GOOGL, GS, JNJ, PFE, BA, and CAT.Source: B. Per-Stock Performance Analysis · p. 5
  • The Hybrid model’s benefit is selective: high-volatility growth stocks and some cyclical equities show clearer improvement, while JNJ and PFE benefit less.The passage suggests smoother returns and technical snapshot features as a possible explanation for the defensive stocks’ smaller gains.Source: B. Per-Stock Performance Analysis · p. 5
  • Both tree-based models outperform LSTM-Only in RMSE on all 14 stocks.This indicates that sequential modeling alone is insufficient for multi-week return regression.Source: B. Per-Stock Performance Analysis · p. 5

C. Multi-Horizon Performance

Across horizons, return-error metrics rise while directional accuracy rises but remains below an always-positive baseline. Stock-level results vary, and the high long-horizon accuracy largely tracks the positive-return base rate.

D. Directional Accuracy Validation Against a Naive Baseline

C. Multi-Horizon Performance

  • RMSE and MAE increase monotonically with horizon length, while directional accuracy rises from 57.0% at 30 days to 97.6% at 365 days.The paper attributes the increasing error to rising return variance as the forecast window widens.Source: C. Multi-Horizon Performance · p. 5
  • At 365 days, 12 of 14 stocks exceed 90% directional accuracy, while AMZN reaches 38.2% at 252 days and 100% at 365 days.XOM is the other exception at 365 days, with 84.5% accuracy.Source: C. Multi-Horizon Performance · p. 5
  • XOM is the strongest individual stock across horizons, with positive R2 values of 0.033, 0.136, and 0.483 at 30, 90, and 252 days, respectively.Its directional accuracy remains above 84%.Source: C. Multi-Horizon Performance · p. 5

D. Directional Accuracy Validation Against a Naive Baseline

E. Investment Scoring and Portfolio Ranking

The paper combines predicted returns across horizons, a sign-consistency bonus, and a volatility penalty into investment scores used to rank equities. The resulting mid-2016 ratings include six Strong Buys and Strong Sells for NVDA and AMZN.

E. Investment Scoring and Portfolio Ranking

  • The composite score weights predicted cumulative returns at 30, 90, and 252 days by 20, 30, and 50, respectively, then adds a consistency bonus and subtracts a volatility penalty.The bonus is ±10 when all three short-to-medium horizon predictions agree in sign; the penalty uses realized 20-day volatility.Source: E. Investment Scoring and Portfolio… · p. 6
  • Six equities receive STRONG BUY ratings, while NVDA and AMZN receive STRONG SELL ratings in the June 2016 test-period ranking.The paper links the latter ratings to predicted negative near- and medium-term returns combined with a high volatility penalty.Source: E. Investment Scoring and Portfolio… · p. 6
  • These ratings reflect predictions from mid-2016, before NVDA’s GPU-driven growth surge, illustrating a limitation of technical forecasting for high-growth equities in rapidly evolving conditions.Source: E. Investment Scoring and Portfolio… · p. 6

F. Discussion

Across 14 U.S. equities in six sectors, the hybrid’s gains were selective, with the clearest RMSE improvements on volatile names. Long-horizon directional accuracy was partly inflated by the positive-return base rate.

F. Discussion

  • The hybrid matched or marginally outperformed standalone XGBoost in RMSE on most stocks, but its global margin was small and benefits varied by sector.High-volatility and cyclical stocks benefited most, while stable defensive equities showed negligible improvement.Source: F. Discussion · p. 6
  • Persistently negative R2 across models and horizons means none beat a simple mean predictor for return magnitude; directional accuracy omits magnitude errors and transaction costs.The paper calls for a transaction-cost-adjusted backtest before claiming practical profitability.Source: F. Discussion · p. 6

V. CONCLUSION

  • The evaluation covers 14 U.S. equities spanning six industry sectors.The conclusion frames the study as a multi-horizon stock-return prediction framework.Source: §V · p. 7
  • 0.0949 global test RMSE at 30 days; the hybrid beat LSTM-Only by a factor of three and gained per-stock RMSE on 7 of 14 equities.The clearest improvements were on high-volatility stocks such as NVDA, AMZN, and JPM.Source: §V · p. 7
  • Directional accuracy rose from 57.0% at 30 days to 97.6% at 365 days, but positive-return base rates inflated long-horizon readings.The discussion identifies the above-base-rate gap at short horizons and per-stock RMSE gains on volatile names as the more defensible evidence of skill.Source: F. Discussion · p. 6, §V · p. 7
  • Future work proposes relative-return ranking, richer macroeconomic and sentiment inputs, dynamic retraining, and cost-adjusted backtesting with significance tests.The paper also proposes attention mechanisms and feature-importance and SHAP analyses.Source: §V · p. 7
Loading 2609.13125v1…