A
SentiVol-GA: A Volatility-Scaled Genetic Fusion of Predictive Models and Financial Sentiment for Adaptive Stock Forecasting
1Department of Computer Science & Engineering, RCC Institute of Information Technology
monika.singh@rcciit.org.in, harinandan.tunga@gmail.com
Department of Mathematics, National Institute of Technology Durgapur
skar.maths@nitdgp.ac.in
Abstract
SentiVol-GA is a robust and adaptive hybrid framework for stock price prediction that integrates statistical forecasting, deep learning, sentiment analysis, and volatility-awareness through Genetic Algorithm-based optimization. The system combines five predictive models—Linear Regression, LSTM, GRU, Bi-LSTM, and ARIMA—with sentiment insights extracted from FinBERT, VADER, and the Loughran–McDonald dictionary. A key innovation of the framework lies in its volatility-scaling mechanism, which adaptively modulates the influence of sentiment based on market turbulence, enhancing responsiveness to real-world fluctuations. Genetic Algorithm (GA) based optimization dynamically adjusts both model and sentiment weights to maintain predictive robustness over time. Experimental validation on eight Indian IT-sector stocks—spanning large-cap, mid-cap, and small-cap categories—demonstrates that SentiVol-GA consistently outperforms all baseline models across RMSE, MAE, R², and tolerance-based accuracy. It achieved up to 12% higher R², 30–60% lower RMSE, and 20–35% greater tolerance-based accuracy compared to individual models. Statistical significance was confirmed using the Friedman and Wilcoxon tests. Additionally, real-time deployment feasibility was verified, with daily inference times under one second and full GA optimization completing in under one minute per stock. These results position SentiVol-GA as a practical, scalable, and interpretable solution for intelligent stock forecasting in dynamic financial markets.
Keywords:
SentiVol-GA
Adaptive Stock Forecasting
Sentiment Analysis
Volatility Scaling
Genetic Algorithm
Deep Learning
Financial Time Series
A
1. Introduction
The prediction of stock prices is a challenging task due to the inherently volatile, non-linear, and multifactorial nature of financial markets. Stock movements are influenced not only by historical patterns and technical indicators but also by rapidly evolving factors such as investor sentiment, global news, and macroeconomic shifts. Traditional methods like technical charting and linear statistical forecasting have been widely used, but they often fall short in adapting to real-time, high-dimensional data streams and in capturing the complex dependencies inherent in financial time series data [1].
In recent years, machine learning (ML) and deep learning (DL) techniques have emerged as powerful tools for financial forecasting, owing to their capacity to model both linear and nonlinear patterns from large volumes of data [2][3]. These models, especially recurrent networks like LSTM and GRU, are capable of capturing long-term temporal dependencies, making them suitable for financial time series forecasting [4]. However, most ML and DL-based methods focus solely on historical price and volume data, thereby neglecting qualitative factors such as sentiment or market mood, which have been proven to significantly impact short-term price fluctuations.
To address this gap, we propose SentiVol-GA, a volatility-enhanced hybrid stock prediction framework that combines deep learning, statistical modelling, financial sentiment analysis, and Genetic Algorithm (GA)-based optimization. This approach leverages a modular ensemble of five models—Linear Regression, LSTM, GRU, Bi-LSTM, and ARIMA—to capture diverse forecasting perspectives. Each model is trained to forecast the next-day closing price, and their predictions are combined using a Genetic Algorithm that adaptively optimizes the model weights over time [5].
In parallel, we integrate sentiment analysis using three complementary tools: FinBERT, a transformer-based model fine-tuned for financial text [6]; VADER, a rule-based sentiment analyser suitable for short texts like headlines and tweets [7]; and the Loughran-McDonald financial dictionary, which provides domain-specific word classification to reduce misclassification in financial documents [8]. These sentiment scores are aggregated and scaled using a volatility term derived from recent price fluctuations, ensuring that sentiment influence is modulated under turbulent market conditions.
Recent advancements in deep learning have significantly improved the predictive modelling of financial markets, particularly in stock price forecasting. LSTM-based architectures have been widely applied for capturing temporal dependencies in stock movements [22] [23], while stacked auto encoders combined with LSTM have shown improved performance by learning deep representations of financial time series [24]. Beyond forecasting, deep learning has also been employed for asset pricing and feature extraction in complex market environments [25], [26]. Emerging domains like crypto currency forecasting have benefited from similar architectures, demonstrating versatility across financial assets [27]. The integration of sentiment analysis into stock movement prediction has gained traction, where financial news serves as a key external driver of price volatility [28], [29]. Several studies have examined how social media and textual information influence financial sentiment, revealing strong correlations with investor behaviour [30], [31]. Hybrid models incorporating attention mechanisms and probabilistic learning further enhance prediction accuracy by aligning textual sentiment with technical indicators [32], [33]. The advantages of integrating natural language processing with quantitative models have also been highlighted by recent surveys that have compiled research on sentiment-based forecasting techniques [34]. The goal of the Chen et al. study [35] was to use anticipatory computing to investigate public sentiment and emotion from news reports. Following that, it makes predictions about the direction of the stock market, which can serve as a model for similar industries.
Our key innovation lies in this volatility-scaled dynamic weighting mechanism, powered by GA, which differentiates the proposed hybrid from fixed-weight ensembles or static predictors. This makes the system adaptive not only to structural market shifts but also to short-term sentiment dynamics. Monthly re-optimization of weights enables the framework to stay aligned with recent trends, ensuring sustained accuracy and responsiveness.
Experiments conducted on eight Indian IT-sector stocks—spanning large-cap (TCS, Infosys, HCL Tech, Wipro), mid-cap (Persistent Systems, Sasken Technologies), and small-cap companies (Policy Bazar, Quick Heal)—demonstrate that the SentiVol-GA model significantly outperforms standalone models in terms of R², RMSE, MAE, and tolerance-based accuracy. Statistical validation via Friedman and Wilcoxon tests further confirms the robustness and superiority of the hybrid approach over traditional techniques. By effectively combining quantitative modelling with sentiment analysis and intelligent optimization, SentiVol-GA offers a scalable and real-world–ready solution for adaptive stock price forecasting.
2. Related Works
We have organized the body of existing research into two primary streams to better comprehend the current state of stock price forecasting: one focusing on sentiment analysis in financial forecasting, and the other on sentiment-free deep learning models. This classification not only reflects the evolution of research in both domains but also underscores the necessity of integrating technical indicators with sentiment-driven insights to develop more flexible and reliable forecasting systems. To establish a strong foundation for the proposed hybrid framework, we further present a Comparative Summary of Reviewed Literature, which encapsulates key studies along with their methodologies, techniques employed, outcomes achieved, and recognized limitations.
2.1 Studies Related to Stock Price Prediction Using Machine Learning Models
Recent advancements in deep learning have significantly influenced the domain of stock market prediction by capturing both linear and complex non-linear dependencies in time series data. Patra and Mohanty [9] proposed a hybrid LSTM–GRU framework tailored for the S&P 500 index. Their model demonstrated superior predictive accuracy and reduced forecasting error compared to standalone LSTM or GRU models. Shi et al. [10] advanced this by integrating CNN–LSTM with XGBoost in a hybrid model that leverages spatial, temporal, and feature-level representations. Their ensemble achieved better generalization and reliability under heterogeneous market conditions. Thakkar and Chaudhari[11] had done survey to check applicability of genetic algorithms for stock market prediction. They found that Genetic algorithms help boost stock prediction accuracy by tuning parameters and selecting key features. When combined with models like LSTM or TCN, they perform better than standalone models. However, issues like high computational cost and over fitting still need attention. Similarly, Barua et al. [12] evaluated deep learning architectures such as RNN, GRU, LSTM, CNN, and Attention-LSTM across Indian stocks like TCS, ICICI, and Reliance. Their results showed that GRU and CNN achieved higher accuracy across most datasets, while Attention-LSTM performed well in high-volatility contexts. Awad et al. [13] further enhanced performance by exploring ensemble deep learning models like CNN–LSTM and GRU–CNN, which showed resilience and generalization capability during unstable market periods like the COVID-19 crisis. Shankar et al. compared ARIMA, LSTM, and UCM models for predicting Tata Motors stock prices. UCM gave the best results, followed by LSTM. ARIMA performed the worst. The study was limited to one company and didn’t include external factors like news or sentiment [18].
Although these works validate the strength of deep and hybrid learning, they typically rely on fixed weighting schemes and lack dynamic adaptability to market sentiment and volatility. These gaps underline the motivation for our study, which proposes a volatility-aware hybrid framework with GA-driven weight optimization for adaptive stock price prediction.
2.2 Studies Related to Market Sentiment Analysis in Financial Forecasting
Investor sentiment, particularly extracted from financial news and social media platforms, has emerged as a critical factor in predicting stock market movements. Recent advances in NLP and the advent of transformer models have revolutionized sentiment analysis in finance.
A
Padmanayana et al. [16] studied how Twitter sentiment can help in predicting stock prices more accurately. They have used a Naïve Bayes classifier to classify tweets and then this sentiment data was combined with past stock prices and given to an XGBoost model for prediction. The model gave good results with 89.8% accuracy. Jiang et al. [14] proposed a FinBERT-enhanced prediction model, to extract sentiment from financial news headlines, and fed this into an LSTM network to forecast stock movement. Compared against standard BERT, pure LSTM, and classical ARIMA, they found FinBERT + LSTM delivered the best predictive performance, outperforming both sentiment‑free LSTM and ARIMA by a good margin. Priyadarshan et al. [15] built a web application that gives stock trend prediction by combining LSTM-based price forecasting with Twitter sentiment data. The addition of Twitter-derived features—like percentages of positive and negative tweets gives a better opinion on a particular stock for the users. In their paper Varghese and Mohan [19] They built a four-stage analytical model: a four-stage analytical model: first they have web-scraped financial news articles and then sentiment scored is calculated via a modified VADER algorithm (fine-tuned for financial context ranging from
to
, where
is very negative and
means very positive),then they applied both parametric (Granger causality) and non-parametric (Shannon & Renyi’s transfer entropy) causation tests. This allowed them to identify the direction and strength of the information flow between news sentiment and stock price movements.
Chauhan et al. [1] integrated financial headline sentiment with LSTM and reported improvements in accuracy, although they did not dynamically adjust sentiment influence over time. Wang et al. [2] used multi-source inputs including sentiment, yet applied static weights, limiting model flexibility in real-time decision-making.
These studies collectively show that while sentiment enhances prediction, existing systems often fail to adaptively scale its impact based on market volatility or recent events. This reinforces the novelty and necessity of our proposed approach, which uniquely combines real-time sentiment and volatility-adjusted forecasting with dynamic GA-based weight optimization.
2.3 Comparative Summary of Reviewed Literature
We conducted a comprehensive review of
key studies to analyze the evolution of stock forecasting techniques combining machine learning, sentiment analysis, and optimization strategies. Table 1 highlights the diversity in models—ranging from LSTM and CNN-based predictors to sentiment-enhanced and GA-optimized systems. While each work offered valuable advancements, most lacked a holistic integration of volatility dynamics, multi-source sentiment inputs, and ensemble model coordination. Our comparative analysis underscores this critical gap, reinforcing the novelty of our proposed Hybrid Model, which synergizes statistical, deep learning, and sentiment features through a volatility-scaled, GA-optimized framework tailored for real-time financial forecasting.
Table 1
Comparative Literature Review on Stock Price Prediction and Sentiment Analysis
Author(s)
Title
Methodology Used
Techniques Used
Results
Limitations
Chauhan et al. [1]
A novel deep learning model for stock market prediction using a sentiment analysis system…
Proposed SenT-In, a sentiment-aware deep learning model combining market data with news sentiment
CNN and GRU networks compute a daily sentiment index; an attention mechanism fuses the sentiment with price time series.
Outperformed baseline models (GRU, LSTM, CNN, SVM): ~+9% accuracy, + 7% F1, + 13% AUC-ROC on average
Tested on select indices; adds model complexity.
Wang et al. [2]
A hybrid attention-based LSTM-CNN model for stock price forecasting…
Developed a hybrid DL model using heterogeneous data (e.g. prices, news) with attention.
Stack of LSTM and CNN layers with an attention mechanism to highlight important features from multi-source inputs.
Reported improved accuracy over single-model approaches.
Complex architecture; requires careful tuning.
Sezer et al. [3]
Financial time series forecasting with deep learning: A systematic literature review (2005–2019)
Conducted a systematic literature review of DL methods in finance
Categorized studies by forecasting target (indices, forex, etc.) and DL model type (CNN, DBN, LSTM, etc.)
Found deep learning often outperforms traditional ML in financial forecasting; summarized trends and research gaps
Review covers up to 2019; no new experiments.
Hiransha et al. [4]
NSE Stock Market Prediction Using Deep-Learning Models
Empirical comparison of four neural network models on stock data (NSE/NYSE).
Trained MLP, vanilla RNN, LSTM and CNN on historical prices.
CNN model gave the lowest error, outperforming RNN/LSTM and linear models
Short-term prediction only; no external sentiment or news data.
Araci [5]
FinBERT: Financial Sentiment Analysis with Pre-trained Language Models
Developed FinBERT, a BERT-based model fine-tuned on financial text for sentiment analysis.
Transformer (BERT) pre-trained on generic data, then fine-tuned on financial domain corpora.
Outperforms prior state-of-art on financial sentiment benchmarks; higher precision/F1 even with limited training data.
Focus is sentiment labeling, not stock forecasting.
Hutto & Gilbert [6]
VADER: A Parsimonious Rule-based Model for Sentiment Analysis of social media Text
Introduced VADER, a rule-based sentiment analyzer optimized for social media text
Lexicon of words with sentiment scores + grammar rules (e.g. handling negation, emphasis, capitalization)
Fast, effective for social media content; beats many lexicon methods.
No learning; fixed lexicon may miss context-specific language.
Loughran & McDonald [7]
When is a liability NOT a liability? Textual analysis, dictionaries, and 10-Ks
Textual analysis of 10-K reports; built finance-specific sentiment dictionaries.
Analyzed word usage in financial filings; created new negative/positive word lists tailored to finance.
Showed common English “negative” words often are neutral in finance; developed word lists that better correlate with returns, volatility, etc.
Dictionaries fixed to US 10-K language; may need updates over time.
Huang et al. [8]
Using Social Network Sentiment Analysis and Genetic Algorithm to Improve the Stock Prediction Accuracy of the Deep Learning-Based Approach
Combined social media sentiment and genetic algorithm (GA) with DL to predict stock changes.
GA selected relevant technical indicators; grey relational analysis identified key sentiment features; LSTM for forecasting.
Using GA-screened technical variables plus Twitter sentiment features significantly improved LSTM accuracy over baseline
Case study on one stock (TSMC); may not generalize to all markets.
Patra & Mohanty [9]
An LSTM–GRU based hybrid framework for secured stock price prediction
Proposed a hybrid RNN model combining LSTM and GRU layers.
Input of 25 features (20 technical indicators) fed into an LSTM–GRU network
Achieved high accuracy on S&P 500 price forecasts (details in paper).
Complex model; potential overfitting with many indicators.
Shi et al. [10]
Attention-based CNN-LSTM and XGBoost hybrid model for stock prediction
Built a multi-stage hybrid: ARIMA preprocessing → attention CNN-LSTM → XGBoost fine-tuning
ARIMA for trend removal; CNN extracts features; LSTM captures time-dependence; attention highlights key inputs; XGBoost regresses final output.
Reported that the hybrid model is more effective than individual methods, yielding relatively high forecast accuracy
Very complex pipeline; reliant on correct ARIMA fit and hyperparameter tuning.
Thakkar & Chaudhari [11]
Applicability of genetic algorithms for stock market prediction: A systematic survey of the last decade
Survey of GA-based techniques in stock forecasting.
Reviewed GA applications: feature selection, parameter optimization, rule extraction in prior studies.
Summarized trends in GA usage; identified common practices (e.g. GA-optimized ANN, trading rules).
Literature-only; no empirical validation of their own.
Barua et al. [12]
Comparative analysis of deep learning models for stock price prediction in the Indian market
Empirical comparison of 7 DL models on Indian stock indices.
Compared RNN, LSTM, CNN, GRU, Attention-LSTM, etc., using metrics (MAE, MSE, R²).
CNN and GRU models generally outperformed others on stable stocks; Attention-LSTM excelled on volatile stocks (e.g. Reliance); RNN/LSTM were less accurate.
Only Indian market data; fixed model hyperparameters may bias results.
Awad et al. [13]
Forecasting stock market indices using the RNN-based hybrid models: CNN–LSTM, GRU–CNN, and ensemble models
Proposed hybrid RNN models and ensembles for index forecasting.
Built CNN–LSTM and GRU–CNN architectures; also constructed ensembles combining RNN variants.
Found that hybrid and ensemble models achieved higher accuracy on index predictions than single models.
Added model complexity; requires large data and training.
Jiang et al. [14]
Financial sentiment analysis using FinBERT with application in predicting stock movement
Integrated FinBERT sentiment analysis with an LSTM forecasting model.
FinBERT to extract text sentiment scores; LSTM for price series prediction; compared FinBERT + LSTM with BERT, LSTM, ARIMA.
Incorporating FinBERT sentiment significantly improved market trend prediction accuracy compared to baselines.
Dependence on quality of news data; may overfit sentiment signals.
Dhabe et al. [15]
Stock Market Trend Prediction Along with Twitter Sentiment Analysis
LSTM model for price prediction, enhanced with Twitter sentiment input.
Used Yahoo Finance API for real-time stock data and LSTM forecasting; computed Twitter sentiment (positive/negative %).
The mean squared error dropped by about 3% compared to a model using only price data(obtained least error in prediction, for Asian Paints data for the split of 80:20)
Tested on limited stocks (India); simple sentiment measure may miss nuance.
Padmanayana et al. [16]
Stock Market Prediction Using Twitter Sentiment Analysis
Collected live tweets and news headlines using APIs; performed sentiment analysis; combined this with historical stock data for prediction
Naïve Bayes for sentiment classification
And XGBoost for stock price prediction
Achieved 89.8% accuracy in predicting stock prices using combined sentiment and stock data
Relied on noisy Twitter sentiment data; Only daily-level predictions, not finer time granularity
Shankar et al. [18]
Stock-Price-Prediction-Using LSTM ARIMA
Hybrid model using LSTM neural network combined with ARIMA (and Unobserved Component Model).
Time-series ARIMA model + LSTM network for prices; likely model ensemble.
Found that LSTM achieved the lowest error among compared methods.
Used non-standard data (“livestock market”); limited scope beyond case data.
Varghese &. Mohan [19]
Study on the Sentimental Influence on Indian Stock Price
Built a four-stage framework: scraped financial news → applied modified VADER for sentiment scoring → used Granger causality and transfer entropy tests.
Modified VADER for sentiment analysis
Granger causality (parametric)
- Shannon and Renyi’stransfer entropy(non-parametric)
Sentiment has a causal influence on stock prices and Transfer entropy better captured non-linear relationships than Granger (Pharma stocks showed strongest sentiment-price link during COVID)
No Twitter or social media sentiment
No sliding window used reduce overlap and dependency between samples
Singh & Srivastava [20]
A Genetic Algorithm optimized hybrid model for stock price prediction
Built a GA-optimized hybrid forecasting model.
Genetic Algorithm tuned model parameters (possibly combining ARIMA/ANN layers).
Reported enhanced prediction accuracy (details not provided).
GA adds complexity; convergence and generalization Sentiment has a causal influence on stock prices (not vice versa)
- Transfer entropy better captured non-linear relationships than Grangercan be issues.
Patel et al. [21]
Sentiment analysis integrated LSTM model for stock price prediction
LSTM model augmented with sentiment analysis of news/social data.
Extracted sentiment features (e.g. from Twitter/news) and input them into LSTM time-series predictor.
Including sentiment signals improved LSTM predictive performance over price-only models.
Depends on sentiment data quality; lexicon or model choice may limit gains.
The above comparative overview highlights key advancements in combining machine learning, deep learning, and sentiment analysis for stock price forecasting. It also exposes a persistent limitation in most prior studies: the lack of dynamic adaptation to market sentiment and volatility. Our work addresses these gaps by introducing SentiVol-GA, a volatility-sensitive, GA-optimized hybrid model that learns optimal model and sentiment weights monthly, enabling more reliable and generalizable stock price forecasting.
.
2.4 Research Gap
Despite substantial advancements in machine learning and deep learning for stock price prediction, current methods often overlook critical dimensions of market behaviour. Most models emphasize historical price patterns and technical indicators while neglecting dynamic sentiment signals and market volatility. Deep architectures like LSTM, GRU, and Bi-LSTM capture temporal patterns effectively, yet they struggle to adjust during sentiment-driven market shifts caused by earnings releases or economic events. Even when sentiment is considered, existing models frequently rely on static or manually tuned weights, limiting their adaptability.
Moreover, market volatility—a key modulator of sentiment impact—is seldom integrated meaningfully. Many ensemble models apply fixed weighting schemes, failing to account for time-varying model effectiveness. Although Genetic Algorithms (GAs) have demonstrated success in dynamic optimization, their application in fusing technical, sentiment, and volatility-based predictions remains underexplored. This research aims to bridge these gaps by introducing a GA-optimized, volatility-scaled hybrid framework for real-time, sentiment-aware stock forecasting.
2.5 Motivation
We were driven by the persistent limitations in traditional and modern stock forecasting models, particularly their inability to dynamically adjust to real-world financial complexities. Deep learning models like LSTM and GRU capture temporal trends but neglect qualitative cues such as investor sentiment, which often steer short-term price fluctuations. Existing hybrid models frequently incorporate sentiment through fixed or heuristic weights, making them inflexible to evolving market narratives. Additionally, most approaches overlook market volatility—an essential factor that amplifies sentiment impact during uncertainty. Without integrating volatility awareness, predictive models risk becoming inaccurate or lagged in real-time applications. While Genetic Algorithms offer potential in optimization tasks, their application in reweighting sentiment and model components adaptively, especially in volatile contexts, remains limited. These gaps motivated us to propose SentiVol-GA, a sentiment-enhanced, volatility-scaled hybrid forecasting framework. By evolving weight allocations through GA and embedding real-time volatility factors, it delivers improved adaptability and accuracy for dynamic, sentiment-sensitive financial environments.
2.6 Contributions
We addressed critical limitations in traditional stock forecasting systems—such as static ensemble weighting, neglect of sentiment dynamics, and lack of volatility responsiveness—by proposing SentiVol-GA, an adaptive and interpretable hybrid forecasting framework. SentiVol-GA integrates five quantitative models (Linear Regression, LSTM, GRU, Bi-LSTM, and ARIMA) with sentiment insights derived from FinBERT, VADER, and the Loughran–McDonald dictionary, combining structured data and market sentiment in a unified architecture.
Unlike previous ensemble models that use fixed or rule-based heuristics, we introduced a Genetic Algorithm-based optimization loop that dynamically recalibrates model and sentiment weights each month. This optimization incorporates both recent forecasting errors and market volatility into its fitness evaluation, resulting in more stable and responsive weight configurations. A novel volatility-scaling mechanism adjusts the influence of sentiment scores: it amplifies sentiment contribution during volatile market phases and suppresses it during calm periods.
Our key contributions include:
A volatility-scaled hybrid architecture that unifies multi-model predictions and sentiment signals under a dynamic weighting scheme.
A customized Genetic Algorithm that evolves optimal weight configurations over time, balancing prediction accuracy, stability, and tolerance-based performance.
A modular sentiment fusion layer, where FinBERT, VADER, and LM Dictionary outputs are adaptively combined using GA-derived weights, enabling real-time sentiment sensitivity.
Empirical validation across eight Indian IT stocks from all capitalization segments, confirming broad applicability and resilience under varying volatility regimes.
Use of non-parametric statistical tests (Friedman and Wilcoxon) to validate the model’s improvements over baselines, ensuring robustness and generalizability.
A scalable and extensible system design, allowing easy integration with new models, sentiment sources, or real-time deployment systems.
By combining deep learning, NLP, volatility-aware weighting, and bio-inspired optimization, SentiVol-GA establishes a new benchmark in adaptive financial forecasting systems.
The manuscript is structured into seven concise and logically ordered sections that detail the development, implementation, and validation of the proposed SentiVol-GA hybrid forecasting framework. Section 3 presents the problem formulation, followed by Section 4, which outlines the methodology, including the system architecture, hybrid algorithm design, and model-sentiment integration. Section 5 offers comprehensive results and discussion, covering implementation, performance across large-, mid-, and small-cap stocks, comparative analysis, radar chart visualization, sensitivity testing, statistical validation, and visual comparisons. Finally, Section 6 concludes the study by summarizing key insights and suggesting future directions for real-time and global market applications.
3. Problem Formulation of the SentiVol-GA Hybrid Forecasting Framework
Given historical stock prices
​ ​ and corresponding financial headlines
​ ​, we aim to predict the next closing price
​ ​ by integrating multiple predictive models and sentiment analysis tools. Each of these components contributes to the final prediction through dynamically optimized weights, which are adapted using a Genetic Algorithm (GA). To enhance the model’s sensitivity to current market dynamics, especially during periods of high uncertainty, a volatility scaling factor is introduced to modulate the contribution of sentiment.. This hybrid formulation addresses the dual need to incorporate both quantitative and qualitative market signals while allowing for time-sensitive adjustment. The following Eq. (1) is at the heart of our proposed hybrid stock price forecasting framework. It enables the generation of an accurate and context-sensitive estimate of the next day’s closing stock price
​ by integrating both quantitative (model-driven trends) and qualitative (sentiment-driven fluctuations) signals. The contribution of sentiment is scaled based on the current market volatility, enhancing predictive robustness under both stable and volatile conditions.
This hybrid formulation is designed to simultaneously capture:
Quantitative signals: via model-based predictions (e.g., LR, LSTM, GRU, Bi-LSTM, ARIMA), and
Qualitative signals: via sentiment scores extracted from financial news (using FinBERT, VADER, and Loughran–McDonald dictionary).
The predictive framework is governed by the following Eq. (1):
1
Where:
​ = Prediction from model ith model,
​ = Weight assigned to model
, optimized via Genetic Algorithm (GA)
= Sentiment score from tool
= Weight assigned to sentiment tool
also optimized GA
= Market volatility scaling factor, computed from recent price variations i.e., recent rolling standard deviations of returns
This formulation enables the system to adapt to shifting market sentiment and price behavior, improving forecasting reliability across both stable and turbulent financial environments. By optimizing the relative influence of model and sentiment inputs, the framework offers a flexible, data-driven strategy for stock price prediction.
4. SentiVol-GA Methodology: A Volatility-Scaled Genetic Framework for Adaptive Stock Prediction
We proposed a hybrid model for stock forecasting by integrating multiple quantitative prediction models and sentiment analysis techniques into a unified, adaptive framework. The system combined historical data with real-time sentiment signals, scaled by market volatility, to improve forecasting accuracy. The methodology followed a stepwise pipeline—from data acquisition and pre-processing to dynamic prediction. Sentiment scores were extracted using NLP tools and adjusted using a volatility factor. A Genetic Algorithm optimized the weights of models and sentiment sources monthly. This modular design ensured interpretability, scalability, and adaptability to evolving market dynamics and diverse financial datasets.
4.1 Architecture of the Proposed SentiVol-GA Framework
We break down the architecture of the SentiVol-GA Hybrid Forecasting Framework into modular and interdependent components. This modularity ensures flexibility, scalability, and adaptability, enabling each component—such as data collection, model training, sentiment analysis, or GA-based optimization—to evolve or be enhanced independently. Such a design is crucial in dynamic financial environments where rapid updates in data streams or predictive techniques are common.
Each component contributes to the system’s adaptive intelligence, allowing it to react effectively to new information, market volatility, and sentiment fluctuations. Whether adapting model weights monthly through Genetic Algorithm optimization or adjusting sentiment influence based on real-time volatility, the framework remains robust and responsive. The following subsection presents the core pseudocode implementation of our hybrid stock forecasting algorithm, which integrates predictive models and sentiment signals using volatility-scaled Genetic Algorithm optimization.
4.1.1 Data Collection
We collected historical stock price data from Yahoo Finance using the y finance Python library. To ensure diversity and generalizability in our analysis, we selected eight Indian companies spanning three different market capitalization segments: Large Cap (Infosys, TCS, HCL Technologies, Wipro), Mid Cap (Persistent Systems, Sasken Technologies), and Small Cap (Policy Bazaar, Quick Heal). Our dataset covers a five-year period from March 2020 to March 2025, capturing a variety of market conditions, including high-volatility periods, post-pandemic recovery, and stable growth phases.
We extracted daily stock indicators including Open, Close, High, Low, and Volume for each selected company. This extensive timeframe and diverse stock portfolio allow our model to generalize effectively across different market behaviours. By incorporating companies from multiple capitalization tiers, we aimed to evaluate how well the proposed hybrid framework performs across a spectrum of financial environments—from relatively stable blue-chip stocks to more volatile small-cap equities.
In this step, the system collects two types of inputs:
Quantitative Data: Historical OHLCV (Open, High, Low, Close, Volume) stock data obtained via APIs like yfinance or Alpha Vantage.
Qualitative Data: Financial news headlines scraped using
, BeautifulSoup, and newspaper3k.
For example, for stock TCS, OHLCV data from the past 10 days is collected. Simultaneously, the following headlines are scraped:
“TCS expands AI services to global clients”
“IT sector outlook downgraded”
“Cloud demand remains strong”
These headlines are passed through sentiment analyzers (
) to quantify qualitative market signals, which are integrated later in the prediction pipeline.
4.1.2 Data Pre-processing
We performed systematic data pre-processing to transform raw historical stock prices into model-ready formats suitable for both statistical and deep learning architectures. The pipeline was modularly constructed for reusability across models such as Linear Regression, ARIMA, LSTM, GRU, and Bi-LSTM. Key steps include handling missing values, Min-Max normalization, and time-series sequence generation, each tailored to the model’s input format requirements.
First, we applied Min-Max scaling to normalize the closing price data to a range of
, improving training stability and convergence speed. For instance, a sample series of closing prices was scaled as:
.
Then, using sequence generation, we constructed time-stepped input-output pairs for sequential models. For example, from a 5-step input:
Input =
.
These structured sequences serve as the foundation for supervised learning in models that require temporal dependencies, enabling robust pattern learning from past trends.
4.1.3 Predictive Models
To harness both statistical and deep learning paradigms, we implemented five distinct predictive models—each trained independently on historical stock price data. This ensemble approach ensures that diverse market behaviours are captured effectively, ranging from simple linear trends to complex temporal dependencies. The output from each model serves as an input to the final hybrid prediction module, where the Genetic Algorithm (GA) determines their optimal weighted contribution.
The forecasting models include:
Linear Regression (LR): Ideal for modeling linear relationships between features such as Open, High, Low, and Volume with the target Close price.
Objective
Learn a linear relationship between input features and the closing price.
Input Features: Typically: Open, High, Low, Volume, and sometimes Previous Close.
Steps:
1.
Pre-process and normalize OHLCV data
.
2. Train the LR model on a training set.
3.
Predict the next day's Close :
e.g.,
is the LR model’s prediction of TCS's closing price for the next day.
4.
Finish
LSTM: A deep learning model capable of capturing long-range dependencies in sequential data.
Objective
Learn temporal dependencies in sequential stock prices.
Input
Sequences of normalized closing prices (e.g., 5–10 days).
Steps:
1.
Construct input sequences (e.g., Suppose we have normalized closing prices for the past 6 days: [
, ……,
and Let’s use the last 5 values to predict the next one:
)
2. Feed into Trained LSTM Model.
3.
Output the next day's prediction:
e.g., M₂
. This means the LSTM model predicts that the next closing price of TCS will be
.
4.
Finish
GRU: A lighter alternative to LSTM that retains temporal modeling power with fewer parameters.
Objective
Similar to LSTM but computationally more efficient.
Input
Same sequence data as LSTM.
Steps:
1.
Use the same input sequence.
2.
Output predicted closing price:
e.g.,
. So, the GRU network predicts that the next-day closing price of the stock is
, based on historical price patterns learned from
.
3.
Finish
Bi-LSTM: An extension of LSTM that learns from both past and future time steps, improving temporal context.
Objective
Use both past and "future" sequence context during training.
Steps:
1.
Input: Same sequence as LSTM/GRU.
2.
Model processes the sequence in both directions.
3.
Output:
e.g.,
. So the BiLSTM model has output a predicted next-day closing price of ₹3488.75 based on the given sequence
.
4.
Finish
ARIMA: A classical statistical model suited for time series data with autocorrelation and stationarity.
Objective
Statistical time series prediction using trends and autocorrelations.
Input
Closing prices.
Steps:
1.
Ensure stationarity via differencing.
2.
Fit ARIMA(p,d,q) model. It is used for time series forecasting. For TCS stock, first-order differencing was sufficient to achieve stationarity, setting d = 1. The PACF plot indicated strong partial autocorrelation up to lag 2 (p = 2), while the ACF plot showed significant correlation at lag 1 (q = 1). Hence, the optimal ARIMA model configuration for forecasting is ARIMA (2,1,1)
3.
Predict next value:
e.g., using ARIMA (2,1,1) trained on the 10 recent TCS prices, the model forecasts the next day’s closing price as:
.
4. Finish
Each model generates a prediction for the next day's closing price, denoted as
as summarized below in the Table 2.
Table 2
Step-by-Step Execution of Individual Forecasting Models
Model Name
Description
Prediction Output (
Linear Regression (LR)
Fits a linear model using features like Open, High, Low, and Volume to predict Close price.
​=3475.25
LSTM
Trained on sequential Close prices to capture short- and long-term dependencies.
​=3492.10
GRU
A simplified RNN model for efficient sequence learning
=3481.60
Bi-LSTM
Learns bidirectional temporal dependencies
​=3488.75
ARIMA
Classical time series model for stationary signals
​=3469.80
These model outputs form the quantitative base of our hybrid prediction engine, ready to be fused with sentiment scores and optimized using GA for final stock price forecasting.
4.1.4 Sentiment Analysis
To incorporate market psychology into stock price prediction, we integrated a sentiment analysis module that quantifies investor sentiment from financial news headlines. This module improves the model’s responsiveness to qualitative drivers like economic outlooks, policy shifts, and corporate announcements.
We curated a domain-specific keyword list (e.g., Information Technology, AI, Cloud Computing) to filter relevant headlines. These were scraped using tools such as requests, BeautifulSoup, and newspaper3k from static (e.g., Moneycontrol, Economic Times) and dynamic financial news sources. Only headlines containing IT-related keywords were retained, ensuring relevance to the selected Indian IT-sector stocks. This alignment between sentiment input and stock domain enhances interpretability and improves the quality of sentiment signals used in forecasting.
Since all headlines were sourced exclusively from credible financial news outlets such as The Hindu, Economic Times, and Moneycontrol, the risk of fake or misleading content was inherently low. Therefore, we did not apply separate fake news detection mechanisms. However, we implemented lightweight noise-handling steps such as removing duplicate headlines, discarding extremely short or low-content entries, and filtering out articles lacking relevant entities. These pre-processing steps help eliminate irrelevant or spam-like content and ensure that only meaningful, contextually relevant sentiment is fed into the prediction pipeline.
We employed three complementary sentiment analysis tools—FinBERT, VADER, and the Loughran–McDonald (LM) dictionary—to generate daily sentiment scores from the filtered headlines:
FinBERT: A BERT-based transformer model fine-tuned on financial corpora, providing deep contextual sentiment classification into positive, neutral, and negative probabilities.
VADER: A lexicon-based tool suited for short texts, such as headlines. It yields a compound score between − 1 and + 1, reflecting overall sentiment intensity.
Loughran–McDonald: A rule-based, finance-specific lexicon that computes sentiment polarity by matching headline tokens with positive and negative financial terms.
Each tool produces a sentiment score that is then aggregated using Genetic Algorithm-based weight optimization, guided by historical forecasting performance. This allows sentiment influence to be both dynamic and volatility-aware in the hybrid model.
We developed a sentiment scoring pipeline to systematically quantify sentiment signals for each trading day. The process is shown in Fig. 1 and involves:
Collecting headlines from financial websites.
Filtering for IT-sector relevance using keyword matching.
Sentiment scoring using FinBERT, VADER, and LM dictionary.
Aggregating scores with dynamically
Fig. 1
Sentiment Score Aggregation Workflow using FinBERT, VADER, and LM Dictionary
Click here to Correct
Click here to Correct
The Fig. 1 illustrates the process for generating a Daily Sentiment Score used in the hybrid stock prediction framework. It begins with the selection of domain-specific keywords (e.g., "AI," "Cloud Computing") to extract relevant news content from both static websites (via HTTP requests) and dynamic websites (using the Newspaper3k library for JavaScript-based content). Extracted headlines undergo keyword filtering to retain only relevant financial news.
These filtered headlines are then analyzed through three parallel sentiment tools: FinBERT (a transformer-based financial sentiment model), VADER (a lexicon-based classifier), and the Loughran–McDonald dictionary (focused on business text classification). Each tool produces sentiment scores, which are combined using a weighted sum, where weights are dynamically optimized by a Genetic Algorithm (GA) to form the final daily sentiment input for the prediction model. This modular process ensures accurate, finance-specific sentiment signals tailored to market context.
Assumed, we have these two financial headlines for a stock like TCS:
1.
"TCS expands AI services to global clients"
2.
"IT sector outlook downgraded amid volatility"
FinBERT Sentiment Score Calculation: We used FinBERT, a transformer-based model fine-tuned specifically on financial text, to extract sentiment from each headline. When a headline is passed through FinBERT using the HuggingFace Transformers library, the model outputs the probabilities for three sentiment classes: Positive, Neutral, and Negative. These probabilities reflect the model’s confidence in the sentiment orientation of the headline, allowing us to quantify sentiment in a domain-aware, context-sensitive manner suitable for financial forecasting.
Table 3
FinBERT Sentiment Scores for Headlines
Headlines
Positive
Neutral
Negative
0.70
0.25
0.05
0.50
0.35
0.15
As shown in Table 3, two example headlines
yield class-wise sentiment scores. The final sentiment score
​ is computed using the formula (Eq. 2):
2
We assumed + 0.6, which is possible if the headlines are more optimistic or fewer headlines are used.
VADER Sentiment Score Calculation: We used VADER, a lexicon and rule-based sentiment analysis tool designed for short texts such as headlines, tweets, and news snippets. VADER assigns a compound sentiment score ranging from − 1 (most negative) to + 1 (most positive). To compute this score, we apply NLTK’s Sentiment Intensity Analyzer to each headline, which analyzes word polarity, punctuation, and emphasis.
Table 4
VADER Compound Scores for Headlines
Headlines
Compound Score
+ 0.65
+ 0.15
As shown in Table 4, two sample headlines
receive compound scores of + 0.65 and + 0.15, respectively. The overall VADER sentiment score is computed by averaging the compound scores across all headlines (Eq. 3):
3
This score is later integrated into the hybrid prediction model with GA-optimized weighting.
Loughran-McDonald Dictionary Score Calculation: We used the Loughran-McDonald (LM) dictionary, a domain-specific lexicon-based tool, to assess sentiment in financial headlines. The process begins by tokenizing each headline into individual words. We then match tokens against the LM dictionary’s predefined lists of positive and negative financial terms. The sentiment score is calculated using a normalized formula (Eq. 4):
4
As illustrated through the examples, Headline 1
) contains two positive words (“expands,” “services”) and zero negatives, resulting in a score of 1.00. Headline 2
contains one negative word (“downgraded”) and no positives, resulting in a score of − 1.00. The overall average is:
For our experimental setting, we assume a score of
, indicating weakly positive sentiment or the presence of more positive headlines in the batch.
These results are aggregated alongside outputs from FinBERT and VADER and shown in Table 5 - Daily Sentiment Scores from FinBERT, VADER, and Loughran-McDonald.
Table 5
Daily Sentiment Scores from FinBERT, VADER, and Loughran-McDonald
Sentiment Tools
Score (
​)
FinBERT
VADER
Loughran-McDonald
The scores are aggregated from the headlines and fed into the prediction model. These sentiment scores—derived from FinBERT, VADER, and the Loughran–McDonald dictionary—are combined using Genetic Algorithm (GA)-optimized weights, enabling the model to dynamically adjust the influence of each tool based on historical performance. The aggregated sentiment component is then scaled by real-time market volatility, ensuring that the model places greater emphasis on sentiment during periods of high uncertainty. This dual-stage weighting—first through GA, then volatility scaling—allows the hybrid forecasting model to capture both quantitative trends and qualitative market sentiment, making its predictions more adaptive, interpretable, and reflective of real-world financial dynamics.
4.1.5 Volatility Scaling
We compute market volatility (V) to reflect recent price fluctuations and dynamically scale the influence of sentiment in our hybrid model. Volatility is calculated as the standard deviation of the past 10 days’ normalized closing prices, capturing how much the stock’s price has deviated from its recent mean.
Steps:
1.
Collect the last 10 daily closing prices for the selected stock (e.g., TCS).
2.
Normalize the closing prices using Min-Max scaling to bring values into the [0, 1] range.
3.
Compute the Mean of the normalized prices.
4.
Calculate the Standard Deviation of the normalized prices using the formula (Eq. 5):
5
Where, ​
is the normalized close price on day t,
is the mean price, and n = 10.
5. Finish
In our example, using 10 normalized close prices, we obtain a volatility score of
= 0.025, which is then used to modulate the impact of sentiment scores in the final stock price prediction.
This ensures that in high-volatility markets, sentiment plays a larger role, reflecting real investor behavior.
4.1.6 Genetic Algorithm Module
In the Genetic Algorithm (GA) optimization step, Table 6 presents how model weights (
) and sentiment weights (
) are initialized and validated for constraint satisfaction across a population of three candidates. Each candidate weight vector is evaluated through the hybrid prediction (Eq. 1).
Model Predictions (
) = [3475.25, 3492.10, 3481.60, 3488.75, 3469.80]
Sentiment Scores (
) = [0.6, 0.4, 0.3] (FinBERT, VADER, LM)
Volatility Factor
=0.025
We initialize 3 candidate solutions (randomly generated but normalized).
Table 6
Sample GA-Generated Weight Vectors and Constraint Validation
Candidate
Model Weights (
​−
)​
Sentiment Weights
(
​−
)​
Constraints Check
[0.10, 0.25, 0.20, 0.25, 0.20]
[0.50, 0.30, 0.20]
Correct
[0.15, 0.15, 0.30, 0.20, 0.20]
[0.40, 0.40, 0.20]
Correct
[0.20, 0.20, 0.20, 0.20, 0.20]
[0.33, 0.33, 0.34]
Correct
Final Prediction Calculation (Fitness Evaluation)
We compute the Prediction Calculation for Each Candidate using the Eq. (1)
For Candidate
:
Model Component (
)
= (0.10 * 3475.25) + (0.25 * 3492.10) + (0.20 * 3481.60) + (0.25 *3488.75) + (0.20 * 3469.80)
= 347.53 + 873.03 + 696.32 + 872.19 + 693.96 = 3482.98 = 3482.98
Sentiment Component (
):
=V*((0.50*0.6) + (0.30*0.4) + (0.20*0.3)) = 0.025 * (0.30 + 0.12 + 0.06) = 0.025 * 0.48 = 0.012
Final Prediction:
=3482.98 + 0.012 = 3482.99​
For Candidate
:
Model Component (
): =0.15 * 3475.25 + 0.15 * 3492.10 + 0.30 * 3481.60 + 0.20 * 3488.75 + 0.20 * 3469.80=3481.85
Sentiment Component (
):=0.025 * (0.40 * 0.6 + 0.40 * 0.4 + 0.20 * 0.3) =0.025 * (0.24 + 0.16+0.06)=0.025 * 0.46 = 0.0115
Final Prediction:
=3481.85 + 0.0115=3481.86​
For Candidate
:
Model Component (
): =0.20*(3475.25 + 3492.10+3481.60+3488.75+3469.80) =3481.10
Sentiment Component (
): =0.025* (0.33 * 0.6 + 0.33 * 0.4 + 0.34 * 0.3)
= 0.025*(0.198 + 0.132 + 0.102) = 0.025* 0.432 = 0.0108
Final Prediction:
= 3481.10 + 0.0108 = 3481.11​
Assuming True Price
​=3483.00
RMSE Calculation for candidate
:
=
=0.01
RMSE Calculation for candidate
:
RMSE Calculation for candidate
:
The Genetic Algorithm (GA) optimization process demonstrated that Candidate
, which achieved the lowest Root Mean Squared Error (RMSE), was selected as the optimal weight vector for the current generation. This result illustrates how the GA systematically evaluates multiple combinations of model and sentiment weights by computing the final predicted stock price through the proposed hybrid equation. Each candidate solution is assessed not only on RMSE but can also be extended to consider additional objectives like error variance and tolerance-based accuracy. By selecting the candidate with the best performance, the GA ensures that the hybrid forecasting system remains responsive to recent trends, sentiment shifts, and volatility patterns—thus maintaining high predictive accuracy and robustness in dynamic financial environments.
We demonstrate that the final predicted closing price of TCS is
using our hybrid framework. This prediction fuses the outputs from multiple models and sentiment tools, scaled by real-time volatility and adjusted using GA-optimized weights. Such numerical illustrations validate the interpretability, modularity, and adaptability of the proposed forecasting system in practical stock market settings.
4.1.7 Evaluation Metrics
We evaluated the performance of our deep learning and hybrid forecasting models using standard regression metrics widely applied in financial prediction tasks. These include Mean Absolute Error (MAE), Mean Squared Error (MSE), Root Mean Squared Error (RMSE), R-Squared (R²) [17], and Tolerance-based Accuracy. Together, these metrics provide a comprehensive assessment of both statistical accuracy and real-world reliability.
Mean Absolute Error (MAE)
We used MAE to measure the average magnitude of absolute differences between actual and predicted stock prices. This metric provides a straightforward interpretation of how far off predictions are, on average, from real values (Eq. 6)
6
Where
is the actual closing price at time
,
- predicted closing price at time and N is the number of samples(days). Lower RMSE values indicate better predictive performance with fewer large errors.
Mean Squared Error (MSE)
We calculated MSE to capture the average squared difference between predicted and actual values. This metric penalizes larger errors more than smaller ones, helping to highlight outlier effects (Eq. 7)
7
Root Mean Squared Error (RMSE)
RMSE, the square root of MSE, was used to express prediction error in the same units as the original data, making it easier to interpret in a financial context (Eq. 8)
8
MAE offers a clear view of average deviation regardless of over- or under-prediction. It’s less sensitive to outliers than RMSE.
R-squared (Coefficient of Determination)
We used R² to measure the proportion of variance in the actual stock prices that was explained by our models. A higher R² indicates better model fit and more effective pattern learning (Eq. 9).
9
Where,
is the Mean of actual closing prices. R² = 1 means perfect prediction; R² = 0 means the model performs no better than predicting the mean. Higher R² values indicate better model performance and stronger predictive accuracy.
Tolerance-Based Accuracy: This measures the percentage of predictions falling within a specified range (± 1%, ± 1.5%, ± 2%) of the actual closing price (Eq. 10). Higher tolerance accuracy reflects better practical reliability of forecasts in finance-sensitive domains.
10
Where,
= Allowed tolerance (e.g., 0.01 for ± 1%) and
= Indicator function (returns 1 if true, else 0)
We evaluated the performance of our proposed hybrid forecasting model using TCS stock data as a case study. The results demonstrate strong predictive accuracy across multiple evaluation metrics. The coefficient of determination,
, indicates that the model successfully explains
of the variance in TCS stock prices, reflecting an excellent fit. The Root Mean Squared Error (RMSE) is
, showing that, on average, the predicted prices deviate from the actual values by ₹38.59. Additionally, the Mean Absolute Error (MAE) is
, suggesting a moderate average deviation regardless of direction. Notably, the model achieved a Tolerance-Based Accuracy of
within a
margin, highlighting its reliability in generating practically acceptable predictions for high-stakes financial decision-making.
4.2 Proposed Hybrid Stock Prediction Algorithm Using Genetic Algorithm Optimization
We designed a modular and adaptive algorithm to implement the proposed SentiVol-GA hybrid forecasting framework. The pseudocode below captures the sequential operations of the system—including historical OHLCV data retrieval, pre-processing, training of deep learning and statistical models, sentiment score extraction, and dynamic weight optimization via a Genetic Algorithm (GA). Unlike conventional approaches that use fixed or manually assigned weights, our method leverages volatility-scaled sentiment sensitivity and monthly re-optimization to improve forecasting adaptability and accuracy. The following pseudocode presents the core logic of the Algorithm 4.1.
ALGORITHM 4.1: HYBRID STOCK PREDICTION USING GA
 
Input:
S ← Selected stock
  
H ← Historical OHLCV data for S
  
K ← List of IT-sector keywords
  
W_prev​ ← Previously optimized model and sentiment weights
 
Output: Final_Prediction ← Next-day Predicted closing price for stock S
1
Begin
 
2
Step 1:
Data Acquisition
3
 
H ← Fetch_Historical_Data (S)
4
 
Headlines ← Scrape_Financial_News (K)
5
 
V ← Calculate_Volatility (H)
6
Step 2:
Data Preprocessing
7
 
Scaled_H ← Normalize (H)
8
 
Sequences ← Generate_Time_Step_Sequences (Scaled_H)
9
Step 3:
Forecasting Model Predictions
10
 
For each model
11
  
Train
on Sequences or Scaled_H
12
  
M_Output[
]←Predict_Next (
)
13
 
End For
14
Step 4:
Sentiment Analysis
15
 
For each tool
16
  
S_Score[
] ←Analyze_Sentiment (
, Headlines)
17
 
End For
18
Step 5:
Weight Optimization Using GA
19
  
If Current_Date is the first of the month Then
20
   
Population← Initialize_Weight_Population()
21
   
While not converged Do
22
    
For each weight vector
23
     
P_pred ← Weighted_Prediction(W, M_Output, S_Score, V)
24
     
RMSE ← Compute_RMSE( Ppred, Pactual)
25
     
Tol_Acc ← Compute_Tolerance(Ppred, Pactual, 1%)
26
     
Fitness[W] ← Aggregate_Fitness(RMSE, Var, Tol_Acc)
27
    
End For
28
    
Parents ← Select_Parents(Fitness)
29
    
Offspring ← Crossover_And_Mutate(Parents)
30
    
Population ← Update (Population, Offspring)
31
   
End While
32
   
W_optimal ← Select_Best_Weights(Population)
33
  
Else:
 
34
   
W_optimal ← Load(W_prev)
35
  
End If
36
Step 6:
Final Prediction Generation
37
 
Final_Prediction ← Weighted_Prediction(W_optimal, M_Output, S_Score, V)
38
Step 7:
Output Results
39
 
Display Final_Prediction, W_optimal, RMSE, sentiment weights, and volatility factors
40
End
 
We invoke the algorithm daily to generate the next closing price forecast, while the GA is triggered at the start of each month to adjust the contribution of individual models and sentiment tools based on recent performance (RMSE, error variance, and tolerance accuracy). This reconfiguration ensures the system remains responsive to real-time shifts in sentiment and volatility. The SentiVol-GA Hybrid algorithm, with a total time complexity of
, is both scalable and efficient for practical stock market applications. Final predicted price for TCS =
, combining model outputs, sentiment scores, and volatility scaling.
4.3 Comparative Summary of Forecasting Models and Sentiment Tools
We present a comparative summary of all forecasting models and sentiment analysis tools used in our SentiVol-GA Hybrid stock prediction framework. This includes five predictive models—Linear Regression, LSTM, GRU, Bi-LSTM, and ARIMA—alongside three sentiment scoring techniques—FinBERT, VADER, and the Loughran-McDonald dictionary. To provide a holistic view, we also include the Hybrid Model, which combines these components through Genetic Algorithm-based weight optimization. Each model and tool is assessed based on its interpretability, computational requirements, adaptability, and effectiveness in capturing financial trends or sentiment. We summarize the key advantages and limitations of each method in Table 7, which illustrates the complementary nature of the selected techniques and provides justification for their integration within a unified forecasting system.
Table 7
Pros and Cons of Forecasting Models, Sentiment Tools, and Hybrid Framework
Models / Tools
Pros
Cons
Linear Regression
⎫ Simple and interpretable
⎫ Fast to train and deploy
o Assumes linearity
o Poor performance with non-linear data
LSTM
⎫ Captures long-term dependencies
⎫ Handles non-linear time series
o Computationally intensive
o Prone to overfitting on small datasets
GRU
⎫ Similar to LSTM but with fewer parameters
⎫ Faster training
o Slightly less expressive than LSTM
o May underperform in long sequences
Bi-LSTM
⎫ Learns from both past and future contexts
⎫ Strong sequence modeling
o Higher computational cost
o Requires more memory
ARIMA
⎫ Effective for stationary time series
⎫ Easy to interpret
o Assumes linearity
o Not suitable for multi-feature or non-stationary data
FinBERT
⎫ Context-aware sentiment analysis
⎫ Fine-tuned for financial domain
o Requires high computation
o Needs GPU for efficient processing
VADER
⎫ Fast and efficient
⎫ Good for short texts (e.g., headlines, tweets)
o Not domain-specific
o Limited handling of complex expressions
Loughran-McDonald
⎫ Finance-specific lexicon
⎫ Transparent and interpretable
o Rule-based and static
o Ignores contextual meaning and sentence structure
SentiVol-GA Hybrid Model (Proposed)
⎫ Combines strengths of all models
⎫ Dynamically adjusts weights using GA
⎫ Accounts for sentiment and volatility
⎫ Robust and adaptive across market conditions
o Complex implementation
o Requires significant computation for monthly GA optimization
o Dependent on reliable input from all submodule
We observe in Table 7 that individual models, while strong in isolation, have distinct limitations—Linear Regression is fast but simplistic, and deep models handle complexity but require resources. Sentiment tools vary in precision. Our SentiVol-GA Hybrid Model overcomes these by dynamically integrating all components with volatility scaling and GA-based optimization, ensuring robust, accurate, and adaptable forecasting.
5. Results and Discussion
This section presents a detailed evaluation of the proposed SentiVol-GA Hybrid Model, highlighting its performance across various stock categories using conventional error metrics and tolerance-based accuracy. The analysis includes implementation details, individual model comparisons for large-, mid-, and small-cap stocks, sensitivity tests, and statistical validation to demonstrate the robustness, adaptability, and forecasting superiority of the proposed framework.
5.1 Implementation Details and System Configuration
We implemented the proposed hybrid stock prediction system in Python, integrating deep learning models, sentiment analysis tools, and financial data modules into a modular pipeline. The system operated efficiently on basic hardware but benefited from upgraded configurations with GPU support for faster training. We used Windows 11 (64-bit) with Python 3.9+, and libraries such as pandas, numpy, scikit-learn, and TensorFlow for modeling, and transformers for FinBERT. Sentiment analysis was performed using VADER and FinBERT, while data was acquired via yfinance and NewsAPI. The complete pipeline—from data collection to prediction—ensured reproducibility and scalability for real-world forecasting tasks.
5.2 Comparative Evaluation of Hybrid Model Across Market Segments
We evaluated the predictive accuracy and robustness of the proposed Hybrid Model across eight Indian IT-sector stocks by comparing it with five baseline models—Linear Regression, LSTM, GRU, Bi-LSTM, and ARIMA. Performance was assessed using standard metrics (R², RMSE, MAE) and tolerance-based accuracy thresholds (± 1%, ± 1.5%, ± 2%), segmented by market capitalization: large-cap, mid-cap, and small-cap.
5.2.1 Large Cap Stocks Prediction Performance
We assessed the forecasting effectiveness of six models on four large-cap Indian IT stocks—TCS, Infosys, HCL Technologies, and Wipro. Evaluation metrics included R², RMSE, MAE, and tolerance-based accuracy at ± 1%, ± 1.5%, and ± 2% error thresholds. The proposed Hybrid Model consistently delivered superior performance across all stocks, outperforming both traditional statistical models and deep learning baselines. It achieved the highest R² scores and lowest RMSE/MAE values while maintaining the highest tolerance accuracy, confirming its robustness and precision in forecasting stable, high-cap equities.
Table 8
Model Performance on Large-Cap IT Stocks (TCS, Infosys, HCL, Wipro)
Metrics
LR
LSTM
GRU
ARIMA
Bi-LSTM
Hybrid Model
For TCS Stock Prediction
0.9055
0.8665
0.8138
0.6752
0.7673
0.9149
MSE
1654.66
2336.23
3259.07
5684.17
63.82
1489.64
RMSE
40.68
48.33
57.09
75.39
4073.02
38.60
MAE
36.90
31.79
45.26
47.46
43.54
29.61
Tolerance ± 1.0%
53.57%
64.29%
46.43%
57.14%
53.57%
67.86%
Tolerance ± 1.5%
78.57%
82.14%
64.29%
67.86%
67.86%
92.86%
Tolerance ± 2.0%
92.86%
92.86%
82.14%
78.57%
78.57%
92.86%
For HCL Technologies Stock Prediction
0.9403
0.7457
0.7136
0.5876
0.6840
0.9332
MSE
365.56
1557.35
1753.56
2525.56
1935.29
409.28
RMSE
19.12
39.46
41.88
50.25
43.99
20.23
MAE
15.91
26.73
34.73
33.45
28.48
14.60
Tolerance ± 1.0%
46.43%
50.00%
21.43%
42.86%
50.00%
60.71%
Tolerance ± 1.5%
71.43%
57.14%
39.29%
50.00%
64.29%
75.00%
Tolerance ± 2.0%
96.43%
71.43%
46.43%
57.14%
71.43%
82.14%
For Infosys Stock Prediction
0.9109
0.8561
0.7137
0.7165
0.8160
0.9239
MSE
567.14
915.91
1822.45
1804.96
1171.41
484.23
RMSE
23.81
30.26
42.69
42.48
34.23
22.00
MAE
21.59
23.13
34.05
26.66
23.84
18.08
Tolerance ± 1.0%
21.43%
42.86%
32.14%
53.57%
53.57%
46.43%
Tolerance ± 1.5%
64.29%
57.14%
39.29%
67.86%
64.29%
64.29%
Tolerance ± 2.0%
82.14%
71.43%
50.00%
71.43%
67.86%
85.71%
For Wipro Stock Prediction
0.9728
0.8620
0.7644
0.7612
0.8549
0.9769
MSE
4.71
23.93
40.86
41.41
25.17
4.01
RMSE
2.17
4.89
6.39
6.44
5.02
2.00
MAE
1.46
3.63
4.85
4.76
3.38
1.50
Tolerance ± 1.0%
85.71%
46.43%
32.14%
50.00%
57.14%
75.00%
Tolerance ± 1.5%
92.86%
64.29%
39.29%
53.57%
67.86%
92.86%
Tolerance ± 2.0%
92.86%
78.57%
64.29%
53.67%
78.57%
100.00%
From Table 8, we observed that the proposed Hybrid Model consistently achieved superior predictive performance across all four large-cap Indian IT stocks—TCS, HCL Technologies, Infosys, and Wipro. For TCS, the model attained the highest R² value (0.9149), the lowest RMSE (38.60), and the best tolerance accuracy, reaching 92.86% within ± 2% error bounds. A similar pattern emerged for HCL Technologies, where despite Linear Regression marginally outperforming in R², the Hybrid Model surpassed all other models in RMSE, MAE, and tolerance-based metrics, underscoring its real-world forecasting reliability.
For Infosys, the Hybrid Model achieved an R² of 0.9239, the lowest RMSE (22.00), and MAE (18.08), reaffirming its effectiveness in capturing both trend and magnitude. Notably, it achieved an ± 2% tolerance accuracy of 85.71%, indicating high predictive stability. The most remarkable performance was observed for Wipro, where the Hybrid Model recorded an R² of 0.9769, RMSE of 2.00, MAE of 1.50, and a perfect 100% accuracy within ± 2% tolerance—demonstrating exceptional precision.
These results confirm that the Hybrid Model significantly outperformed all five baseline models (LR, LSTM, GRU, ARIMA, Bi-LSTM) across statistical and tolerance-based metrics, validating its robustness and adaptability for forecasting in large-cap equity segments.
A
We visually assessed the forecasting accuracy of the Hybrid Model on four large-cap Indian IT stocks—TCS, HCL Technologies, Infosys, and Wipro—by comparing actual and predicted closing prices, as shown in Fig. 2 (a–d). Figure 2(a) reveals that TCS predictions closely mirrored actual movements, reflecting reliable trend tracking. In Fig. 2(b), the model accurately followed short-term price fluctuations of HCL Technologies with minimal deviation. For Infosys, depicted in Fig. 2(c), the Hybrid Model sustained accurate forecasts even during volatile market phases, highlighting strong generalization capability. Finally, Fig. 2(d) for Wipro demonstrates nearly perfect alignment, particularly in stable periods. These visual trends support the quantitative results in Table 8, confirming the model’s robustness across large-cap stock scenarios.
Click here to download actual image
Click here to download actual image
(a) Predicted Vs Actual Closing Prices for TCS
(b) Predicted Vs Actual Closing Prices for HCL Tech.
Click here to download actual image
Click here to download actual image
(c) Actual vs. Predicted Stock Prices for Infosys
(d) Actual vs. Predicted Stock Prices for Wipro
Figure 2. Model Predictions vs Actuals for Large-Cap IT Stocks
We analyzed the prediction performance of six models—Linear Regression (LR), LSTM, GRU, Bi-LSTM, ARIMA, and the proposed Hybrid Model—across four large-cap Indian IT stocks as illustrated in Fig. 2(a) through Fig. 2(d). In Fig. 2(a), the Hybrid Model closely matched TCS’s actual closing prices, particularly during sharp market shifts, demonstrating lower deviation and high adaptability. Figure 2(b) shows HCL Technologies, where the Hybrid Model effectively tracked market trends, especially during downturns and rebounds, outperforming others in responsiveness. In Fig. 2(c), the Hybrid Model captured high-volatility changes in Infosys stock, minimizing overfitting. Finally, in Fig. 2(d), Wipro’s comparatively stable prices were predicted with high precision and smooth trend continuity by the Hybrid Model.
Overall, these visual comparisons clearly confirm that the proposed Hybrid Model consistently outperformed traditional forecasting models across different stocks and market conditions, offering both robustness and predictive precision.
5.2.2 Mid Cap Stocks Prediction Performance
We evaluated the forecasting accuracy of the proposed Hybrid Model on mid-cap Indian IT stocks—Persistent Systems and Sasken Technologies—which are known for moderate volatility and nonlinear patterns. Mid-cap equities present unique challenges, making them an ideal testbed for assessing a model’s adaptability. The performance of the Hybrid Model was benchmarked against five baseline models: Linear Regression (LR), LSTM, GRU, ARIMA, and Bi-LSTM. Performance was measured using R², RMSE, MAE, and tolerance-based accuracy (± 1%, ± 1.5%, and ± 2%).
As shown in Table 9, the Hybrid Model significantly outperformed all individual models across both stocks. For Persistent Systems, it achieved the highest R² of 0.973, the lowest RMSE of 55.19, and the best accuracy at ± 2% (92.59%), confirming its superior ability to model price variations and maintain reliability under mid-cap volatility. In Sasken Technologies, the Hybrid Model again achieved the best R² (0.8828) and RMSE (32.53), with robust ± 2% accuracy (51.85%), surpassing all other models in overall consistency.
Table 9
Model Performance on Mid-Cap Stocks (Persistent Systems and Sasken Technologies)
Metrics
LR
LSTM
GRU
ARIMA
Bi-LSTM
Hybrid Model
For Persistent Systems
R² Score
0.9649
0.8826
0.8112
0.5952
0.8220
0.9730
MSE
4005.52
13415.20
21570.30
46256.90
20335.20
3045.79
RMSE
63.29
115.82
146.87
215.07
142.60
55.19
MAE
52.04
77.02
111.82
141.33
104.91
48.27
Tolerance ± 1.0%
48.15%
51.85%
33.33%
37.04%
40.74%
62.96%
Tolerance ± 1.5%
74.07%
70.37%
48.15%
40.74%
48.15%
77.78%
Tolerance ± 2.0%
88.89%
70.37%
55.56%
51.85%
59.26%
92.59%
For Sasken Technologies
R² Score
0.8581
0.5845
0.6493
0.5000
0.5473
0.8828
MSE
1281.43
3751.82
3166.88
6334.19
4087.95
1058.47
RMSE
35.80
61.25
56.28
79.59
63.94
32.53
MAE
25.86
49.19
47.68
58.97
48.53
28.13
Tolerance ± 1.0%
51.85%
18.52%
14.81%
25.93%
25.93%
18.52%
Tolerance ± 1.5%
62.96%
29.63%
25.93%
25.93%
40.74%
40.74%
Tolerance ± 2.0%
62.96%
37.04%
25.93%
29.63%
44.44%
51.85%
As illustrated in Table 9, the Hybrid Model delivered unmatched prediction quality for Persistent Systems, outperforming all other models across both statistical and tolerance metrics. These results affirm the model’s flexibility and practical value in capturing mid-cap stock dynamics that are often too erratic for single-model approaches.
For Sasken Technologies, the Hybrid Model achieved the best R² and lowest RMSE, offering dependable forecasting with reduced error even under moderate volatility. While LR performed decently, the Hybrid Model excelled in accuracy and consistency, especially at broader tolerance ranges, reinforcing its real-world applicability in mid-cap forecasting.
We presented visual comparisons of actual versus predicted closing prices for two mid-cap Indian IT-sector stocks—Persistent Systems and Sasken Technologies—to evaluate the performance of the proposed Hybrid Model alongside five baseline models. These figures illustrate the effectiveness of each forecasting approach in replicating real market behaviour under varying volatility conditions.
Click here to download actual image
Click here to download actual image
(a) Actual vs. Forecasted Close Prices for Persistent Systems
(b) Actual vs. Forecasted Close Prices for Sasken Tech.
A
Figure 3. Actual vs. Forecasted Close Prices for Persistent Systems and Sasken Technologies.
Figure 3(a) shows the comparison between actual closing prices of Persistent Systems and the forecasts generated by different models, including LR, LSTM, GRU, BiLSTM, ARIMA, and the proposed Hybrid Model. The Hybrid Model demonstrates superior tracking of actual price movements, especially during sharp fluctuations, indicating its strength in capturing both trend dynamics and market sentiment for mid-cap stocks. Figure 3(b) illustrates the comparison between actual closing prices of Sasken Technologies and predictions from six models: LR, LSTM, GRU, BiLSTM, ARIMA, and the Hybrid Model. The Hybrid Model aligns more closely with actual market movements compared to other models, particularly during periods of volatility, highlighting its robustness in capturing both data-driven and sentiment-based trends for mid-cap stock forecasting.
5.2.3 Small Cap Stocks
We evaluated the forecasting performance of six models on small-cap Indian stocks—Policy Bazar and Quick Heal—to test model adaptability under high volatility and low liquidity. These stocks represent complex forecasting scenarios where traditional models often underperform. The results revealed that the Hybrid Model consistently outshined both statistical and deep learning baselines in terms of R², RMSE, MAE, and tolerance-based accuracy thresholds. For Policy Bazar, the Hybrid Model attained the highest R² score (0.9724) and the lowest RMSE (16.97), outperforming deep learning models such as LSTM, GRU, and Bi-LSTM, which showed significantly higher error margins. While Linear Regression achieved slightly better accuracy at ± 1% tolerance, the Hybrid Model matched or exceeded it at broader thresholds (± 1.5%, ± 2.0%), offering a well-balanced combination of precision and generalization. For Quick Heal, despite Linear Regression slightly surpassing the Hybrid Model in tight tolerance brackets, the Hybrid Model exhibited more stable performance overall, with a competitive R² of 0.8406, low RMSE (4.29), and better generalization across error margins compared to volatile results from LSTM and ARIMA.
Table 10
Model Performance on Small Cap Stock (Policy Bazar and Quick Heal)
Metrics
LR
LSTM
GRU
ARIMA
Bi-LSTM
Hybrid Model
For Policy Bazar Stock Prediction
R² Score
0.9720
0.7432
0.5524
0.5217
0.7632
0.9724
MSE
292.17
2680.46
4672.47
4993.13
2471.59
288.14
RMSE
17.09
51.77
68.36
70.66
49.72
16.97
MAE
12.69
36.85
261.05
46.82
39.62
13.72
Tolerance ± 1.0%
66.67%
33.33%
14.81%
37.04%
25.93%
62.96%
Tolerance ± 1.5%
81.48%
40.74%
25.93%
44.44%
40.74%
81.48%
Tolerance ± 2.0%
88.89%
59.26%
33.33%
51.85%
44.44%
88.89%
For Quick Heal Stock Prediction
R² Score
0.8465
–3.1443
0.0636
–23.4400
0.2940
0.8406
MSE
17.71
478.11
108.03
2819.51
81.45
18.39
RMSE
4.21
21.87
10.39
53.10
9.03
4.29
MAE
3.15
10.54
8.44
17.41
5.77
3.49
Tolerance ± 1.0%
59.26%
29.63%
18.52%
48.15%
55.56%
51.85%
Tolerance ± 1.5%
70.37%
37.04%
25.93%
51.85%
55.56%
59.26%
Tolerance ± 2.0%
85.19%
51.85%
37.04%
55.56%
59.26%
81.48%
As shown in Table 10, the Hybrid Model delivered robust, low-error forecasts for both small-cap stocks, especially under broader tolerances, validating its capability to adapt to market irregularities where deep learning models often fail. This underlines its suitability for noisy, high-variance financial environments.
We visually analyzed the forecasting performance of multiple models on small-cap stocks—Policy Bazar and Quick Heal—to better understand how well each model tracks actual market behaviour. These visualizations provide intuitive insights into prediction quality, particularly in periods of high volatility. The comparison includes Linear Regression, LSTM, GRU, Bi-LSTM, ARIMA, and the proposed Hybrid Model. Such analysis is critical for small-cap stocks, where price patterns can be erratic and traditional models often struggle to capture sharp shifts.
Click here to download actual image
Click here to download actual image
(a) Actual vs. Predicted Close Prices for Policy Bazar
(b) Actual vs. Predicted Close Prices for Quick Heal
A
Figure 4. Actual vs. Predicted Close Prices for Policy Bazar and Quick Heal
Figure 4(a) displays the actual vs. predicted closing prices for Policy Bazar, highlighting the Hybrid Model’s ability to stay tightly aligned with real values, especially during fluctuations. Figure 4(b) presents the same analysis for Quick Heal, where again, the Hybrid Model outperforms others by closely mirroring price spikes and trends. These plots confirm that the Hybrid Model consistently delivered greater forecasting accuracy and stability under small-cap volatility—making it a reliable choice for practical deployment in dynamic market environments.
5.3 Model Comparison Across Market Segments
We conducted a comprehensive comparison of six forecasting models—Linear Regression (LR), LSTM, GRU, Bi-LSTM, ARIMA, and the Hybrid Model—across eight Indian stocks spanning large-cap, mid-cap, and small-cap categories. This analysis aimed to identify which models perform best under varying market conditions and volatility levels. The comparison considers key evaluation metrics such as R², RMSE, MAE, and tolerance-based accuracy. By summarizing each model’s strengths and limitations, we highlight the scenarios where each approach excels and where it falls short. The insights below serve as a guide for model selection based on stock behaviour and application goals.
Table 11
Comparative Summary of Forecasting Models
Model
Strengths
Limitations
Best Performing On
Metric(s) Where Outperformed
Linear Regression (LR)
Fast and simple baseline; competitive for stable stocks.
Poor in handling non-linearity and complex patterns.
Large Caps (HCL Tech, Infosys)
R² on HCL Tech (0.9403), MAE on Quick Heal (3.15)
LSTM
Captures sequential patterns well; stable for trending data.
Sensitive to training parameters; underperforms on highly volatile stocks.
Mid Caps (Persistent Systems)
RMSE (115.82), MAE (77.02) on Persistent
GRU
Efficient training; good generalization; balanced speed vs. accuracy.
Slightly less accurate on volatile stocks than Bi-LSTM or Hybrid.
Stable stocks (TCS, Sasken)
R² on TCS (0.8138), Tolerance ± 1.5% on Infosys
Bi-LSTM
Bidirectional learning improves context; useful in volatility.
Computationally heavier; prone to overfitting on small datasets.
Small Caps (Quick Heal, Policy Bazar)
Best RMSE (9.03) and MAE (5.77) on Quick Heal
ARIMA
Effective for linear historical trends.
Cannot model non-linear or sentiment effects; static behavior.
Moderate performance on stable stocks
Competitive MAE on Infosys (26.66); moderate Tolerance ± 2%
Hybrid Model
Integrates technical models, sentiment, and GA optimization; highly adaptive.
Computationally intensive; needs tuning for real-time deployment.
All: Large, Mid, and Small Caps
Highest R², lowest RMSE, top tolerance in most cases
As evident from Table 11, each model brings unique advantages and trade-offs. Traditional models like LR and ARIMA are fast and perform decently on stable stocks but lack adaptability. Deep learning models—LSTM, GRU, and Bi-LSTM—offer improved sequential learning and performance under trend-driven conditions, but their effectiveness varies with stock volatility. The Hybrid Model, however, consistently outperforms others across all stock types, demonstrating the power of combining sentiment analysis, volatility scaling, and GA-based dynamic weight optimization. It is especially recommended for use cases where adaptability, robustness, and precision are critical.
5.3.1 Comparative Radar Chart Analysis of Forecasting Models
We have visualized the comparative effectiveness of our forecasting models through a multi-metric radar chart, shown in Fig. 4. This visualization maps six essential performance indicators—R², RMSE, MAE, and tolerance accuracies within ± 1%, ± 1.5%, and ± 2%—for six models: Linear Regression (LR), LSTM, GRU, ARIMA, Bi-LSTM, and the proposed Hybrid Model. All values are normalized for a uniform comparison scale where higher values indicate better performance. This radar-style analysis allows for an at-a-glance understanding of model strengths and weaknesses, making it particularly valuable in financial applications where trade-offs across metrics must be managed.
Click here to Correct
(a)LR (b) LSTM
Click here to Correct
(c) GRU (d) ARIMA
Click here to Correct
(e) Bi-LSTM (f) Hybrid
A
Figure 5. Model Performance on TCS Stock Across Six Evaluation Metrics
The Fig. 5 visually compares the performance of six forecasting models—Linear Regression, LSTM, GRU, ARIMA, Bi-LSTM, and the proposed Hybrid Model—on TCS stock data using six normalized evaluation metrics. The Hybrid Model shows superior and balanced performance across all axes, reflecting its robustness in both error-based and tolerance-based metrics.
Fig. 6
Forecasting Model Performance Across Key Metrics
Click here to Correct
As observed in Fig. 6, the Hybrid Model consistently achieves the best performance across all dimensions. It exhibits the highest R², the lowest prediction errors (inverted RMSE and MAE), and the most accurate predictions within tight tolerance bands. While simpler models like LR perform decently on specific metrics such as MAE, they fall short in adaptiveness. Deep learning models (GRU, Bi-LSTM) offer moderate improvements, but none match the robustness and generalization of the Hybrid Model. The radar chart clearly confirms that integrating multiple predictive models with sentiment analysis and Genetic Algorithm-based weight optimization significantly enhances forecasting reliability.
5.4 Sensitivity Analysis of the Hybrid Model
We perform sensitivity analysis to understand how fluctuations in key model parameters—such as model weights, sentiment weights, and volatility scaling—affect the prediction quality. This analysis helps validate the robustness and adaptability of the proposed hybrid system.
Table 12 summarizes the main components analyzed during the study, highlighting how each parameter influences metrics like RMSE, MAE, and R². For example, increasing the combined weight of LSTM and GRU under trending market conditions consistently improved prediction accuracy, while over-reliance on ARIMA during volatile periods degraded performance. Similarly, sentiment scores weighted toward FinBERT produced more stable and accurate forecasts than equal or inverted configurations.
Table 12
Sensitivity Analysis of Core Parameters in the Hybrid Prediction Model
Parameter
Description
Sensitivity
Model Weights (w₁–w₅)
Relative contribution of LR, LSTM, GRU, ARIMA, Bi-LSTM predictions.
Observation:
• Increasing weight of LSTM and GRU improves accuracy slightly under trending markets.
• Excessive emphasis on ARIMA (linear model) degrades performance under high volatility.
Example:
⎫ When
increases by ~ 12%
⎫ When
observed (≈ 0.92)
Sentiment Weights (sw₁–sw₃)
Weights assigned to sentiment scores from FinBERT, VADER, LM Dictionary.
Observation:
• FinBERT consistently yields the most predictive sentiment score.
• Optimal configuration:
.
Deviation Impact:
⎫ Reducing sw_FinBERT to 0.3 increases MAE by ~ 8%.
⎫ Assigning equal weights decreases ± 1.5% tolerance accuracy by ~ 5–7%.
Volatility Factor (V)
Scaling term for sentiment influence, derived from historical price volatility.
Observation:
• The volatility factor V plays a regulatory role:
• Low volatility (V ≈ 0.1): less influence from sentiment
• High volatility (V ≈ 0.7): sentiment scores strongly impact prediction
Insights:
⎫ Fixing V at 0.5 leads to average performance.
⎫ Adaptive V (calculated from rolling std dev) improves tolerance accuracy by ~ 10%.
GA Population Size
Number of individuals in each Genetic Algorithm generation.
⎫ Value Range Tested: 50 to 200
⎫ Larger p → better convergence but slower. Best: 100–150
GA Mutation Rate
Controls diversity and exploration of weight combinations.
Value Range Tested:
⎫ Low (< 0.05) → stuck in local minima; High (> 0.15) → erratic predictions
Crossover Rate
Probability of combining parent solutions in GA
⎫ Value Range Tested: 0.7 to 0.9
⎫ Minor influence. 0.8 is stable.
⎫ Optimal range: 0.75–0.85 ensures convergence and diversity
We conducted a detailed sensitivity analysis to evaluate how various internal parameters influenced the forecasting performance of the proposed Hybrid Model. These parameters included model weights, sentiment weights, volatility scaling factor, GA population size, mutation rate, and crossover rate. Each parameter was assessed based on its influence on critical evaluation metrics such as RMSE, MAE, R², and tolerance-based accuracy. The goal was to identify which components significantly affected model robustness and which had marginal effects. Figure 7 visualizes these findings by quantifying the impact of each parameter and categorizing their sensitivity levels (High, Medium, Low), thereby providing insight into optimal configurations for consistent forecasting accuracy.
Fig. 7
Sensitivity Analysis of Hybrid Model Parameters
Click here to Correct
As shown in Fig. 7, the model weights, sentiment weights, and volatility factor emerged as the most sensitive parameters—exerting a strong influence on the predictive accuracy and error margins. For example, optimal tuning of LSTM and GRU weights led to the best R² values (~ 0.92), while excessive reliance on ARIMA increased RMSE by around 12%. Similarly, prioritizing FinBERT in sentiment aggregation significantly improved MAE and tolerance accuracy. In contrast, GA-specific parameters like mutation rate and crossover rate exhibited only moderate effects, mainly influencing convergence speed and exploration diversity. These insights validate the importance of dynamic optimization in the Hybrid Model and highlight which parameters require careful tuning to maintain accuracy and stability across changing market conditions.
Table 13 aggregates the overall findings, categorizing parameters by their sensitivity and recommending optimal value ranges. The analysis demonstrates that the hybrid model's predictive power depends heavily on appropriately tuned weights and adaptive volatility scaling. Parameters such as mutation rate and population size in the Genetic Algorithm moderately affect convergence and stability but are less impactful than model or sentiment weights. This highlights the necessity of incorporating dynamic optimization techniques to preserve robustness in changing market conditions.
Table 13
Impact Summary and Optimization Recommendations from Sensitivity Analysis
Parameter
Highly Sensitive?
Impact on Performance
Recommendation
Model Weights (w₁–w₅)
Yes
R² and RMSE change significantly
Use GA-based dynamic optimization
Sentiment Weights
Yes
Affects tolerance and directional accuracy
Prioritize
Volatility Scaling (V)
Yes
Improves adaptability under market shifts
Use rolling std-dev for
calculation
GA Mutation Rate
Medium
Affects optimization convergence
Set between
and
GA Population Size
Medium
Impacts computation time and fitness
Optimal between
individuals
The sensitivity analysis shows that the hybrid model is highly responsive to proper weight tuning and volatility scaling, validating the use of a Genetic Algorithm for dynamic optimization. Misconfiguration of these parameters leads to suboptimal performance, particularly in volatile or sentiment-driven markets. Hence, adaptive mechanisms are crucial to maintain forecasting accuracy and robustness over time.
5.5 Empirical Validation Across Diverse Market Segments
We validated the proposed hybrid stock prediction model through an extensive performance evaluation across eight Indian stock datasets, representing large-cap (TCS, Infosys, HCL Tech, Wipro), mid-cap (Persistent Systems, Sasken Technologies), and small-cap companies (Policy Bazar, Quick Heal). The objective was to assess the model’s robustness, adaptability, and accuracy under varying market dynamics and capitalization tiers. The evaluation period—from March 2020 to March 2025—encompassed diverse financial conditions including the post-COVID recovery, interest rate shifts, and sector-specific disruptions. The model was benchmarked against baseline models (LR, LSTM, GRU, ARIMA, Bi-LSTM) using standard regression metrics—
, RMSE, MAE—and tolerance-based accuracy thresholds
). The hybrid model consistently outperformed all other models, especially on R² and RMSE. It achieved
and
tolerance accuracy above
in large-cap stocks like TCS and Infosys, and exhibited strong generalization for mid and small caps. Table 14 presents the summarizes the best-performing model per stock and their key evaluation metrics.
Table 14
Benchmark Performance of the Proposed Hybrid Model Across Diverse Indian Stock Datasets
Dataset
Best Model
R² Score
RMSE
Tolerance ± 2%
TCS
Hybrid
0.9149
38.59
92.86%
Infosys
Hybrid
0.9239
22.00
85.71%
HCL Tech
Hybrid
0.9332
20.23
82.14%
Wipro
Hybrid
0.9769
2.00
100%
Persistent Systems
Hybrid
0.973
55.19
92.59%
Sasken Technologies
Hybrid
0.8828
32.53
51.85%
Policy Bazar
Hybrid
0.9724
16.97
88.89%
Quick Heal
Hybrid
0.8406
4.29
81.48%
5.6 Volatility Estimator Sensitivity Analysis
We analyzed the impact of different volatility estimation techniques on the performance of the SentiVol-GA framework by evaluating tolerance accuracy (± 1.5%) using three representative stocks: TCS (large-cap), Persistent (mid-cap), and Policy Bazar (small-cap). As illustrated in Fig. 8, GARCH (1,1) marginally outperformed the rolling standard deviation in capturing volatility in highly dynamic stocks like Policy Bazar. However, entropy-based estimators exhibited inconsistent behaviour, particularly in less volatile stocks, possibly due to noise sensitivity. Despite GARCH's slight advantage in some cases, the rolling standard deviation delivered competitive results with significantly lower computational overhead. Given its balance between accuracy and efficiency, it remains the default volatility estimator in our framework.
Fig. 8
Comparison of Volatility Estimators (Rolling Std Dev, GARCH(1,1), Entropy) on Tolerance Accuracy (± 1.5%) for TCS, Persistent, and Policy Bazar.
Click here to Correct
To further assess the impact of volatility estimation techniques, we compared their effect on RMSE across the same three representative stocks. As shown in Fig. 9, the differences between estimators were marginal. Rolling standard deviation and GARCH(1,1) yielded nearly identical RMSE for TCS and Policy Bazar, while GARCH slightly outperformed for Persistent. The entropy-based estimator showed a minor increase in error for all stocks, reaffirming its sensitivity to noise. These findings confirm that while GARCH offers slightly better error metrics in certain conditions, the rolling standard deviation provides a good trade-off between accuracy and computational efficiency, validating its continued use in SentiVol-GA.
Fig. 9
Comparison of Volatility Estimators (Rolling Std Dev, GARCH (1,1), Entropy) on RMSE for TCS, Persistent, and Policy Bazar.
Click here to Correct
The analysis reveals that while GARCH(1,1) slightly improves tolerance accuracy and RMSE for volatile stocks, the rolling standard deviation offers comparable performance with lower complexity. Hence, it remains the preferred volatility estimator in the SentiVol-GA framework.
5.7 Statistical Validation of Forecasting Superiority
We conducted statistical validation to ensure that the Hybrid Model’s superior performance was not a result of randomness. Using non-parametric hypothesis tests, we applied the Friedman Test to assess significant differences across model rankings and the Wilcoxon Signed-Rank Test for pairwise RMSE comparisons. As shown in Table 15, the Friedman Test returned
, confirming notable performance disparity among models. The Wilcoxon test yielded
across all pairwise comparisons, affirming that the Hybrid Model significantly outperforms each baseline. These results validate that integrating sentiment, volatility scaling, and GA-driven optimization results in reliable and statistically robust forecasting improvements.
Table 15
Statistical Validation of Hybrid Model Performance
Test Name
Purpose
Result
Friedman Test
Tests ranking differences among all models across datasets
- Significant difference
Wilcoxon Signed-Rank Test
Pairwise test: Hybrid vs. each baseline model on RMSE
- Hybrid significantly better
These statistical validations confirm that the Hybrid Model's enhancements are real, consistent, and not due to overfitting or chance, reinforcing its applicability in real-world financial forecasting across various market environments.
5.8 Visual Comparison of Model Accuracy
We present a visual comparison of RMSE values across all six forecasting models to clearly demonstrate their relative performance on eight Indian stock datasets. This chart helps us assess how each model responds to varying levels of volatility and capitalization—ranging from large-cap stocks like TCS and Infosys to small-cap stocks such as Policy Bazar and Quick Heal. The models compared include Linear Regression (LR), LSTM, GRU, ARIMA, Bi-LSTM, and our proposed Hybrid Model. By plotting RMSE values for each model-stock pair, we highlight the differences in error margins in a consolidated format.
Fig. 10
RMSE Comparison Across Models and Datasets
Click here to Correct
As shown in Fig. 10, the Hybrid Model achieves the lowest RMSE in nearly all cases, demonstrating superior predictive accuracy compared to both statistical and deep learning baselines. Notably, for high-volatility or non-linear datasets—such as those from mid-cap (e.g., Persistent Systems) and small-cap companies (e.g., Policy Bazar, Quick Heal)—the Hybrid Model maintains consistent performance, whereas other models, particularly ARIMA and Bi-LSTM, show sharp degradation. This supports the earlier findings that combining deep learning, sentiment analysis, and Genetic Algorithm-based optimization not only improves average error metrics but also enhances robustness across diverse stock behaviours. This visual evidence further strengthens the case for the Hybrid Model as a reliable and scalable forecasting solution.
5.9 Real-Time Deployment Feasibility
We implemented the SentiVol-GA framework in Python and tested it on a Windows 11 (64-bit) system equipped with an Intel i11 processor, 16 GB RAM, and an RTX 3060 GPU. On this configuration, the Genetic Algorithm (GA) optimization module required approximately 45–60 seconds per stock and is executed on a monthly basis, making it computationally efficient. Sentiment analysis using VADER and FinBERT was completed in 2–3 seconds per news batch, while daily prediction inference took less than one second.
Overall, the full pipeline—from data collection and sentiment extraction to volatility adjustment and prediction—exhibits low latency and high throughput, supporting both real-time and batch-mode deployment. These results demonstrate the practical feasibility of integrating SentiVol-GA into live trading or decision-support systems with minimal computational overhead.
6. Conclusion
In this paper, we proposed SentiVol-GA, a robust and adaptive hybrid stock prediction framework that integrates statistical models, deep learning, financial sentiment analysis, and market volatility into a unified forecasting solution. Our approach combines five core predictive models—Linear Regression, LSTM, GRU, Bi-LSTM, and ARIMA—with sentiment scores extracted from FinBERT, VADER, and the Loughran–McDonald dictionary. A Genetic Algorithm (GA) dynamically re-optimizes model and sentiment weights monthly, scaled by a volatility factor to adapt to changing market dynamics. This framework successfully captures both quantitative patterns and qualitative sentiment shifts to enhance forecasting reliability.
The Hybrid Model demonstrated superior accuracy and robustness when tested on eight Indian IT-sector stocks, spanning large-cap, mid-cap, and small-cap categories. Across all datasets, SentiVol-GA achieved up to 12% higher R², 30–60% lower RMSE, and 20–35% greater tolerance-based accuracy compared to baseline models, underscoring its practical forecasting advantage. Additionally, statistical validation using Friedman and Wilcoxon tests confirmed the significance of these improvements, reinforcing the value of integrating volatility-aware sentiment modulation with dynamically optimized ensemble forecasting.
While our model is benchmarked against individual models, direct comparisons with traditional static ensembles (e.g., fixed-weight LSTM + ARIMA) and optimization-only fusion approaches (e.g., GA or PSO applied without sentiment or volatility features) were not included in this study. Future work can incorporate these baselines to further isolate and quantify the added value of sentiment-volatility integration within adaptive fusion strategies.
Future enhancements may include incorporating live financial news and real-time market feeds for minute-level predictions. Replacing GA with reinforcement learning could enable continuous adaptation without retraining. Moreover, extending the framework to multi-asset portfolios and global equities would allow broader applicability and scalability. Overall, SentiVol-GA lays a strong foundation for intelligent, sentiment-aware forecasting systems and provides a practical tool for analysts, financial institutions, and researchers aiming for interpretable and high-precision stock market predictions.
A
Author Contribution
Author 1: She performed the conceptualization, methodology, and code implementationof the study.Author 2: He analyzed the dataset and conceptualization and writing the manuscript.Author 3: He analyzed the overall performance of the study. Also, he performed the analysis of the overall concept, writing and editing. All authors contributed to the critical revision of the manuscript and approved the final version.
References
1.
Chauhan, J., Ahmed, T., & Sinha, A. (2025). A novel deep learning model for stock market prediction using a sentiment analysis system from authoritative financial website’s data. Connection Science, 37, Article 10.1080/09540091.2025.2455070. https://doi.org/10.1080/09540091.2025.2455070
2.
Wang, X., Jiang, Y., Ma, J., & Yang, H. (2021). A hybrid attention-based LSTM-CNN model for stock price forecasting using multi-source heterogeneous data. Expert Systems with Applications, 164, 113718. https://doi.org/10.1016/j.eswa.2020.113718
3.
Sezer, O. B., Gudelek, M. U., & Ozbayoglu, A. M. (2020). Financial time series forecasting with deep learning: A systematic literature review: 2005–2019. Applied Soft Computing, 90, 106181. https://doi.org/10.1016/j.asoc.2020.106181
4.
Hiransha, M., Gopalakrishnan, E. A., Menon, V. K., & Soman, K. P. (2018). NSE stock market prediction using deep-learning models. Procedia Computer Science, 132, 1351–1362. https://doi.org/10.1016/j.procs.2018.05.050
5.
Araci, D. (2019). FinBERT: Financial sentiment analysis with pre-trained language models. arXiv preprint, arXiv:1908.10063. https://arxiv.org/abs/1908.10063
6.
Hutto, C. J., & Gilbert, E. (2014). VADER: A parsimonious rule-based model for sentiment analysis of social media text. In Proceedings of the International AAAI Conference on Web and Social Media (ICWSM) (pp. 216–225). https://ojs.aaai.org/index.php/ICWSM/article/view/14550
7.
Loughran, T., & McDonald, B. (2011). When is a liability not a liability? Textual analysis, dictionaries, and 10-Ks. The Journal of Finance, 66(1), 35–65. https://doi.org/10.1111/j.1540-6261.2010.01625.x
8.
Huang, J. Y., Tung, C. L., & Lin, W. Z. (2023). Using social network sentiment analysis and genetic algorithm to improve the stock prediction accuracy of the deep learning-based approach. International Journal of Computational Intelligence Systems, 16, 93. https://doi.org/10.1007/s44196-023-00276-9
9.
Patra, G. R., & Mohanty, M. N. (2022). An LSTM–GRU based hybrid framework for secured stock price prediction. Journal of Statistical Management Systems, 25(6), 1491–1499. https://doi.org/10.1080/09720510.2022.2092263
10.
Shi, Z., Hu, Y., Mo, G., & Wu, J. (2022). Attention-based CNN-LSTM and XGBoost hybrid model for stock prediction. Expert Systems with Applications, 181, 115136. https://doi.org/10.1016/j.eswa.2021.115136
11.
Thakkar, A., & Chaudhari, K. (2024). Applicability of genetic algorithms for stock market prediction: A systematic survey of the last decade. Computer Science Review, 53, 100652. https://doi.org/10.1016/j.cosrev.2024.100652
12.
Barua, M., Kumar, T., Raj, K., & Roy, A. M. (2024). Comparative analysis of deep learning models for stock price prediction in the Indian market. FinTech, 3(4), 551–568. https://doi.org/10.3390/fintech3040029
13.
Awad, L., Elkaffas, S. M., & Fakhr, M. W. (2023). Forecasting stock market indices using the recurrent neural network-based hybrid models: CNN–LSTM, GRU–CNN, and ensemble models. Applied Sciences, 13(7), 4644. https://doi.org/10.3390/app13074644
14.
Jiang, T., & Zeng, A. (2023). Financial sentiment analysis using FinBERT with application in predicting stock movement. arXiv preprint, arXiv:2306.02136. https://doi.org/10.48550/arXiv.2306.02136
15.
Dhabe, P., Chandak, A., Deshpande, O., Fandade, P., Chandak, N., & Oswal, Y. (2023). Stock market trend prediction along with Twitter sentiment analysis. In Advances in Computational Intelligence and Communication Technology (pp. 55–67). https://doi.org/10.1007/978-981-99-0071-8_5
16.
Padmanayana, V., & Bhavya, K. (2021). Stock market prediction using Twitter sentiment analysis. International Journal of Scientific Research in Computer Science, Engineering and Information Technology, 7(4), 265–270. https://doi.org/10.32628/CSEIT217475
17.
Spuler, M., Sarasola-Sanz, A., Birbaumer, N., Rosenstiel, W., & Ramos-Murguialday, A. (2015). Comparing metrics to evaluate performance of regression methods for decoding of neural signals. In 2015 37th Annual International Conference of the IEEE Engineering in Medicine and Biology Society (EMBC) (pp. 1083–1086). IEEE. https://doi.org/10.1109/EMBC.2015.7318553
18.
Shankar, P., Sharma, N., Kota, N. R., & Ghosh, A. (2022). Stock-price prediction using LSTM and ARIMA. Journal of Development Economics and Management Research Studies, 9, 55–66. https://doi.org/10.53422/JDMS.2022.91106
19.
Varghese, R. R., & Mohan, B. R. (2023). Study on the sentimental influence on Indian stock price. Heliyon, 9(12), e22788. https://doi.org/10.1016/j.heliyon.2023.e22788
20.
Patel, P., Shah, S., & Thakkar, H. (2021). Sentiment analysis integrated LSTM model for stock price prediction. International Journal of Engineering Research & Technology, 10(7), 225–230. https://www.ijert.org/sentiment-analysis-integrated-lstm-model-for-stock-price-prediction
21.
Singh, N., & Srivastava, R. (2018). A genetic algorithm optimized hybrid model for stock price prediction. Procedia Computer Science, 132, 188–197. https://doi.org/10.1016/j.procs.2018.05.144
22.
Nelson, D. M. Q., Pereira, A. C. M., & de Oliveira, R. A. (2017). Stock market's price movement prediction with LSTM neural networks. In 2017 International Joint Conference on Neural Networks (IJCNN) (pp. 1419–1426). IEEE. https://doi.org/10.1109/IJCNN.2017.7966019
23.
Bao, W., Yue, J., & Rao, Y. (2017). A deep learning framework for financial time series using stacked autoencoders and long-short term memory. PLoS ONE, 12(7), e0180944. https://doi.org/10.1371/journal.pone.0180944
24.
Chen, L., Pelger, M., & Zhu, J. (2024). Deep learning in asset pricing. Management Science, 70(2), 714–750. https://doi.org/10.1287/mnsc.2023.4695
25.
Gu, Y., Kelly, A., & Xiu, D. (2020). Empirical asset pricing via machine learning. Review of Financial Studies, 33(5), 2223–2273. https://doi.org/10.1093/rfs/hhaa009
26.
Tharun, S., Saranya, G., Tamilvizhi, T., & Surendran, R. (2023). Cryptocurrency price prediction using deep learning. In Proceedings of the International Conference on Innovative Computing and Communications (pp. 387–397). https://doi.org/10.1007/978-3-031-44084-7_27
27.
Maheshwari, D. (2025). The impact of financial news sentiment on Indian stock market movement prediction: An empirical study. International Journal of Enhanced Research in Management & Computer Applications, 14(3), 45–53.
28.
Atkins, A., Niranjan, M., & Gerding, E. (2018). Financial news predicts stock market volatility better than close price. The Journal of Finance and Data Science, 4(2), 120–137. https://doi.org/10.1016/j.jfds.2018.02.002
29.
Lampos, V., Aletras, N., Geyti, J. K., Zou, B., & Cox, I. J. (2016). Inferring the socioeconomic status of social media users based on behaviour and language. In Advances in Information Retrieval. ECIR 2016. Lecture Notes in Computer Science, vol 9626. Springer. https://doi.org/10.1007/978-3-319-30671-1_54
30.
Si, L., Wang, S. Y., Hu, B., & Liu, Z. (2021). A context-aware attention network for COVID-19 misinformation detection in social media. World Wide Web, 24, 1003–1021. https://doi.org/10.1007/s11280-021-00866-1
31.
Huang, B., Ding, Q., Sun, G. Z., & Li, H. (2018). Stock prediction based on Bayesian-LSTM. In Proceedings of the 2018 International Conference on Cloud Computing and Big Data Analysis (pp. 128–133). https://doi.org/10.1145/3195106.3195170
32.
Kalra, R., Singh, T., Mishra, S., Singh, S., Kumar, N., Kim, T., & Kumar, M. (2024). An efficient hybrid approach for forecasting real-time stock market indices. Journal of King Saud University - Computer and Information Sciences, 36, 102180. https://doi.org/10.1016/j.jksuci.2024.102180
33.
Singh, M., Guru, A., & Ambhaikar, A. (2024). A comprehensive survey on sentiment-based approaches in stock market analysis. International Journal of Futuristic Innovation in Engineering Science and Technology, 3, 54–60.
34.
Chen, M. Y., Liao, C. H., & Hsieh, R. P. (2019). Modeling public mood and emotion: Stock market trend prediction with anticipatory computing approach. Computers in Human Behavior, 101, 87–96. https://doi.org/10.1016/j.chb.2019.03.021.
Total words in MS: 13242
Total words in Title: 15
Total words in Abstract: 191
Total Keyword count: 7
Total Images in MS: 9
Total Tables in MS: 20
Total Reference count: 34