An Explainable LSTM Framework for Stock Trading via Behavioral Decomposition and Competition-Driven Optimization

Forecasting short-term stock price movements remains challenging due to market non-stationarity, volatility, and the complex aggregation of heterogeneous investor behaviors. Although Long Short-Term Memory (LSTM) networks have demonstrated strong performance in financial time-series prediction, most existing approaches operate as black boxes and provide limited insight into short-term directional changes, constraining trust and real-world deployment. This paper introduces an explainable LSTM-based trading framework based on subrogate agent-based simulation model that reframes prediction as the estimation of collective investor behavior rather than direct price forecasting. The proposed method decomposes historical price and volume series into behavioral components representing distinct investor roles. Separate LSTM models are trained to forecast the future proportions of each behavioral role. These predictions are aggregated into price-direction signals using behavioral-to-price rules whose parameters are optimized via a genetic algorithm. The genetic algorithm evolves decomposition weights and thresholds by evaluating candidate rule sets in repeated trading competitions, directly optimizing profitability and risk-adjusted performance rather than purely statistical error. This competition-driven optimization yields behaviorally consistent decompositions aligned with realistic market outcomes. The framework is implemented and evaluated within the Dashboard for Intelligent Investment Decisions with eXplainable artificial intelligence (DI2XAI), a multi-agent backtesting simulator using real Yahoo Finance data, enabling leakage-free and reproducible trading experiments across diverse market regimes. Extensive evaluations over multiple stocks, sectors, and historical periods show that the proposed approach consistently outperforms standard trading baselines with the LSTM, convolutional neural network with LSTM (CNN-LSTM), and CNN with bidirectional LSTM (CNN-BiLSTM), random forest and extreme-gradient boosting (XGBoost), achieving higher profitability. Our approach outperformed LSTM, CNN-LSTM, CNN-BiLSTM and random forest with statistically significant improvements (p<0.001), and outperformed XGBoost with an improvement of 12.5% in the final capital result.

Authors

Institutions

Publication Details

Journal
Research Square
Published
2026-11-24
DOI
https://doi.org/10.21203/rs.3.rs-11842563/v1
Primary Topic
Stock Market Forecasting Methods
Type
preprint

Funders

Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
NOV
preprint

An Explainable LSTM Framework for Stock Trading via Behavioral Decomposition and Competition-Driven Optimization

Iván García‐Magariño, Javier Bravo
1 links
Research Square
Stock Market Forecasting Methods
preprint

An Explainable LSTM Framework for Stock Trading via Behavioral Decomposition and Competition-Driven Optimization

Iván García‐Magariño, Javier Bravo
preprint en

Abstract

Forecasting short-term stock price movements remains challenging due to market non-stationarity, volatility, and the complex aggregation of heterogeneous investor behaviors. Although Long Short-Term Memory (LSTM) networks have demonstrated strong performance in financial time-series prediction, most existing approaches operate as black boxes and provide limited insight into short-term directional changes, constraining trust and real-world deployment. This paper introduces an explainable LSTM-based trading framework based on subrogate agent-based simulation model that reframes prediction as the estimation of collective investor behavior rather than direct price forecasting. The proposed method decomposes historical price and volume series into behavioral components representing distinct investor roles. Separate LSTM models are trained to forecast the future proportions of each behavioral role. These predictions are aggregated into price-direction signals using behavioral-to-price rules whose parameters are optimized via a genetic algorithm. The genetic algorithm evolves decomposition weights and thresholds by evaluating candidate rule sets in repeated trading competitions, directly optimizing profitability and risk-adjusted performance rather than purely statistical error. This competition-driven optimization yields behaviorally consistent decompositions aligned with realistic market outcomes. The framework is implemented and evaluated within the Dashboard for Intelligent Investment Decisions with eXplainable artificial intelligence (DI2XAI), a multi-agent backtesting simulator using real Yahoo Finance data, enabling leakage-free and reproducible trading experiments across diverse market regimes. Extensive evaluations over multiple stocks, sectors, and historical periods show that the proposed approach consistently outperforms standard trading baselines with the LSTM, convolutional neural network with LSTM (CNN-LSTM), and CNN with bidirectional LSTM (CNN-BiLSTM), random forest and extreme-gradient boosting (XGBoost), achieving higher profitability. Our approach outperformed LSTM, CNN-LSTM, CNN-BiLSTM and random forest with statistically significant improvements (p<0.001), and outperformed XGBoost with an improvement of 12.5% in the final capital result.

Research Square
Universidad Complutense de Madrid (ES)
Comunidad de Madrid, Agencia Estatal de Investigación
Stock Market Forecasting Methods
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.

Laika access coming soon