Next Article in Journal
A Complex Network Science Perspective on Urban Parcel Locker Placement
Previous Article in Journal
Leveraging Large Language Models for Sustainable and Inclusive Web Accessibility
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

A Multi-Model Machine Learning Framework for Daily Stock Price Prediction

by
Bharatendra Rai
* and
Leili Soltanisehat
Department of Decision and Information Sciences, Charlton College of Business, University of Massachusetts Dartmouth, 285 Westport Road, North Dartmouth, MA 02747, USA
*
Author to whom correspondence should be addressed.
Big Data Cogn. Comput. 2025, 9(10), 248; https://doi.org/10.3390/bdcc9100248
Submission received: 26 August 2025 / Revised: 22 September 2025 / Accepted: 23 September 2025 / Published: 28 September 2025
(This article belongs to the Topic Electronic Communications, IOT and Big Data, 2nd Volume)

Abstract

Stock price prediction remains a challenging problem due to the inherent volatility and complexity of financial markets. This study proposes a multi-model machine learning framework for one-day-ahead stock price prediction using thirty-six features derived from technical indicators. Empirical analysis is conducted on data from Apple, Tesla, and NVIDIA, employing nine classification algorithms, including support vector machines, random forests, extreme gradient boosting, and logistic regression. Results indicate that momentum-based indicators are the most influential predictors. While support vector machines achieve the highest accuracy for Apple, extreme gradient boosting performed best for NVIDIA and Tesla. In addition, explainable AI techniques are applied to interpret individual model predictions, thereby enhancing transparency and trust in the results. The study contributes to financial analytics research by providing a comparative evaluation of diverse machine learning methods and highlighting key indicators critical for short-term stock price forecasting.

1. Introduction

Stock price prediction is a well-established yet challenging research domain that has generated significant interest among scholars. Two key theoretical foundations dominate this field: the Efficient Market Hypothesis (EMH), which asserts that current prices fully reflect all relevant information [1], and the Random Walk Hypothesis, which suggests that past price movements have no predictive power for future prices [2]. Prediction approaches typically rely on fundamental analysis, which examines macroeconomic indicators, company financials, and market position, or technical analysis, which studies historical price and volume data along with demand–supply dynamics.
Technical analysis often employs quantitative technical indicators—such as Moving Average (MA), Moving Average Convergence/Divergence (MACD), Relative Strength Index (RSI), and stochastic oscillators—to capture market trends and potential reversals [3,4,5,6]. While many indicators are available, excessive use can complicate decision-making for traders. Predictive modeling can address this challenge by combining selected indicators to classify stock movements, typically into two classes (up, down) or three classes (up, neutral, down). Model performance is influenced by factors such as indicator selection, classification method, and prediction horizon, which may range from minutes to days in short-term forecasts, or weeks to months in long-term forecasts [7].
Daily closing prices are a common and easily accessible input for such models, obtainable from platforms like Yahoo Finance. However, for short-term predictions, extensive historical data may be less useful due to evolving market conditions, technological advancements, and changes in company strategy. For example, while Apple’s stock existed in the 1990s, its price dynamics and investor sentiment today are shaped by innovations like the iPhone. Such shifts underscore the importance of using recent, contextually relevant data in developing effective stock prediction models.
In this paper, we evaluate the performance of nine widely used machine learning models—including Extreme Gradient Boosting (XGBoost), Random Forest (RF), and Support Vector Machine (SVM)—using thirty-six technical indicators derived from historical stock price data. The predictive models are designed to generate one-day-ahead forecasts of stock price direction, classifying movements as up, down, or neutral. The study focuses on three prominent companies—Apple, Tesla, and NVIDIA—selected to represent different stages in their corporate lifecycle. Model performances are assessed using multiple evaluation metrics to provide a comprehensive comparison.
The remainder of the paper is organized as follows: Section 2 presents a literature review relevant to this research. Section 3 outlines the three phases of overall framework employed for developing the one-day-ahead prediction models. Section 4 describes the data collection process and the technical indicator-based feature extraction. Section 5 details the application of nine machine learning methods and their performance evaluation. Section 6 discusses the results and key findings. Finally, Section 7 concludes the paper with a summary of contributions, limitations and potential directions for future research.

2. Literature Review

The prediction of financial asset returns is a multidisciplinary subject drawing upon financial econometrics, investment analysis, corporate finance, and, more recently, behavioral finance. The roots of technical analysis can be traced to 18th century Japan, where Munehisa Homma pioneered the candlestick charting method for analyzing rice market trends [8]. In the context of the modern stock market, one of the earliest academic contributions is Cowles’ analysis of 45 professional forecasting agencies, which examined their ability to identify stocks with superior investment potential or to predict overall price movements [9].
Subsequent work has explored the relevance of technical analysis across various asset classes. Menkhoff and Taylor investigated technical analysis in foreign exchange markets, highlighting that markets may not always be fully rational and discussing why mispricing and arbitrage opportunities may persist [10]. Zhu and Zhou emphasized the role of technical analysis in model specification, demonstrating that moving average-based trading strategies can outperform optimal allocation rules when predictive uncertainty exists, and priors are not overly informative [11]. Their findings suggest that technical analysis can add value even to widely used asset allocation strategies when returns are predictable.
Technical analysis has also been integrated with computational intelligence methods. Gorgulho et al. applied genetic algorithms to manage financial portfolios using technical indicators during the 2003–2009 period, which included the global financial crisis. In their framework, initial random individuals represented alternative asset classification models, though the results indicated performance comparable to random trading strategies over the full study period [12]. Chang et al. introduced evolved partially connected neural networks (EPCNNs) to forecast stock price trends from technical indicators [13]. The EPCNN architecture employed random neuron connections, multiple hidden layers, genetically evolved weights, and a sinusoidal activation function, achieving promising results in financial time series forecasting while addressing limitations of gradient descent learning.
Ensemble learning approaches have also been extensively examined. Ballings et al. compared ensemble models—Random Forest, AdaBoost, and Kernel Factory—with single classifiers such as Neural Networks, Logistic Regression, Support Vector Machines (SVM), and K-Nearest Neighbor, using data from 5767 publicly listed European companies for one-year-ahead predictions [14]. Model performance was evaluated using the area under the ROC curve, with Random Forest achieving the highest median value, followed by SVM, Kernel Factory, and AdaBoost, indicating that ensemble methods often outperform single classifiers. Patel et al. analyzed the Indian stock market, predicting both stock movements and index direction using Artificial Neural Networks, SVM, Random Forest, and Naïve Bayes [15]. They evaluated two input approaches—technical parameters computed from ten years of historical data and trend representations of those parameters—finding that Random Forest performed best in the first approach, and that all models improved when using trend-based inputs.
Hybrid techniques have also been proposed for multi-class classification in trading decisions. Dash and Dash used six technical indicators as inputs to a computationally efficient Functional Link Artificial Neural Network (CEFLANN) to generate continuous trading signals in the range of 0–1 [16]. These signals were mapped to three discrete classes—buy, hold, and sell—demonstrating the potential of CEFLANN models in capturing non-linear relationships between technical indicators and market trends.

3. Three Phases of This Study

In this study, nine widely used machine learning methods such as Support Vector Machine (SVM), Random Forest, and Extreme Gradient Boosting are used for developing classification models and the overall process is divided into three phases (see Figure 1).
The first phase involves feature extraction where data are obtained from publicly available source and then technical indicators are arrived at using these data. This study uses a quantitative financial modeling framework available from R programming package “quantmod” to obtain data that are sourced from Yahoo. These data are for Apple, NVIDIA, and Tesla for the time period from 1 January 2018 to 30 June 2025. Using these data, 36 technical indicator-based features are extracted. For model development in phase-2, machine learning algorithms are applied using features obtained in phase-1 as input variables and response classified as up, down or neutral as output variable. For developing these models, a subset of the data called the training dataset is used. In phase three model assessment is performed using testing dataset based on the results obtained in phase-2.

4. Feature Extraction Process

This section provides details about the dataset used for the study, process used for extracting features, and criteria used for classifying the response variable as up, down, and neutral.

4.1. Data

The dataset used in this study is based on a 90-month time period from 1 January 2018 to 30 June 2025. Data on three popular companies viz., Apple, NVIDIA, and Tesla were obtained from Yahoo Finance, which is a publicly available data source. The dataset includes opening price, closing price, high, low and trading volume for 1863 trading days. These data are used for arriving at technical indicators that provide investors with clues about future directions of the stock price. As an example, Figure 2 shows pattern of the market prices for Apple from January 2022 to June 2025.
Figure 2 shows stock prices of Apple to vary between about USD 120 and USD 260 from the beginning of 2022 to June 2025. When the stock price falls below a short-term 20-day moving average, depicted in blue color, usually the downtrend continues for many days. Similarly, when the prices cross the 20-day moving average, the stock price continues the uptrend for many days. Such patterns provide an investor with clues about the direction of future prices and help to make “buy” and “sell” decisions. Investors utilize various technical indicators to gain insights or clues that help in decision-making.

4.2. Thirty-Six Input Features

For developing the one-day-ahead prediction model, thirty-six input features are used in this study. These features are grouped in three categories as trend, momentum, and volatility indicators. Table 1 provides all 36 features used in this study and [17] covers various technical indicators with interesting examples in detail.
It is to be noted that initially there were historical data for 1863 trading days. However, due to calculations needed for the 36 features used in this study, data rows resulting in missing values were removed from the dataset. A total of the first 134 trading days of data was removed during the process. The final dataset consists of 1731 trading days.

4.3. Response Classification and Threshold

In this study, one-day-ahead data points are classified into one of the three categories, viz., up, down, or neutral. This classification is based on the comparison of the one-day-ahead closing stock price with an average of the previous five days of closing prices. When the difference percentage is greater than a predefined threshold value, the response is classified as “up”. And when it is below the threshold value, it is classified as “down”. All other cases are classified as “neutral”. This is illustrated in the equation below.
y t = u p ,   i f   100 × C t M n M n > T d o w n ,   i f   100 × C t M n M n < T n e u t r a l ,   i f T   100 × C t M n M n T  
where
  • yt is one-day-ahead classification of stock price in time period t;
  • Mn is the moving average of n days before t;
  • Ct is the closing stock price value on day t;
  • T is a percentage threshold (e.g., 0.5%).
In this study we use n = 5, which means the one-day-ahead closing stock price compared to the average of the closing stock prices of the previous five days. Four different threshold values used in this study are 0.5%, 1.0%, 1.5%, and 2.0%. Table 2 provides a summary of number of data points in each category for different threshold levels.
From Table 2, it is observed that changes in threshold value T causes the number of data points in the up, down, and neutral categories to change. An increase in threshold value leads more data points to be classified in the neutral category compared to the other two categories. This pattern can be observed for all three companies used in this study. However, the distribution of data points in the three categories is different for each company due to variability in the historical stock prices. For example, a threshold of 2% causes over 1000 trading days of data in the neutral category for Apple. On the other hand, a threshold of 2% for Tesla that exhibits higher volatility has only 552 trading days of data in the neutral category. The last column of the table provides an imbalance ratio based on the number of maximum data points divided by the number of minimum data points. Higher imbalance ratio values suggest an uneven spread of data points in the three categories, whereas lower imbalance ratio values indicate an even spread of data points. For example, Tesla with T = 0.5% has an imbalance ratio of 5.99, indicating that the “up” category with 862 data points has approximately 6 times more trading days than the “neutral” category that only has data for 144 trading days. Using the imbalance ratio, we chose threshold values in such a way that for each company there was an approximately even spread of data points in the three categories. The threshold values used for Apple, NVIDIA, and Tesla based on minimum imbalance ratio values in this study are 1%, 2%, and 2%, respectively.

5. Model Development

To evaluate the effectiveness of the classification models, this study benchmarked nine widely used machine learning algorithms. A key challenge in applying these models lies in hyperparameter tuning, which plays a critical role in achieving reliable and accurate classifications. The results obtained in this research not only highlight the comparative performance of these models but also provide insights into the impact of systematic hyperparameter optimization. The nine models were selected to represent diverse learning paradigms, including tree-based methods (Random Forest, Decision Tree, Gradient Boosting, XGBoost), ensemble techniques (AdaBoost), distance-based and probabilistic approaches (K-Nearest Neighbors, Naïve Bayes), and linear classifiers (Logistic Regression, Support Vector Machine).

5.1. Hyperparameter Tuning Methods and Settings

To ensure both validity and predictive performance, this study employed a systematic hyperparameter tuning strategy across nine classification algorithms. Grid Search Cross-Validation (GridSearchCV) with 3-fold stratified cross-validation was applied, using a predefined hyperparameter grid informed by established best practices in the literature and domain expertise. Table 3 summarizes the tuning configurations, reflecting widely accepted standards in the financial prediction domain [18,19].
Appropriate hyperparameter tuning enhances predictive efficacy by mitigating the risks of overfitting or underfitting while balancing model complexity with computational cost (grid size). In the GridSearchCV approach, all parameter combinations within each grid were exhaustively evaluated using accuracy as the primary scoring metric. For models sensitive to input scaling—such as SVM, Logistic Regression, and KNN—features were standardized with StandardScaler. The tuning and evaluation process was conducted separately for each company-specific dataset, employing a fixed train–test split (samples 1–1200 for training and 1201–1732 for testing). The best estimator for each model was selected based on cross-validation accuracy, and final performance was assessed on the test set using accuracy, precision, recall, and F1-score. This systematic and reproducible framework ensures a fair comparison of model performance while effectively addressing the trade-offs between overfitting and variance in financial time series prediction.

5.2. Prediction Results

Table 4 shows the efficacy of the prediction models for each company, based on the performance metrics such as accuracy, precision, recall, F1-score, and training time.
Results summarized in Table 4 show the prediction performance for different stocks using various methods used in this study. The best method based on results obtained are highlighted in gray color. For the prediction of Apple stock, the SVM model has the highest level of accuracy, recall, and F1-score, being the best model in most of the metrics. Gradient Boosting shows a high precision level but comes with higher computational cost, highlighting a trade-off between predictive accuracy and computational efficiency. In addition, for NVIDIA’s stock prediction, the XGBoost method shows the overall better prediction performance in four main metrics including accuracy, precision, recall, and F1-score. For Tesla’s stock too, prediction performance suggests that the XGBoost model provides the best results in for accuracy, precision, recall, and F1-score.
Overall, these results indicate that machine learning models such as XGBoost and SVM show higher predictive power in terms of accuracy and reliability. This is because of the effective mechanism of SVM in finding clear decision boundaries in complex data and combining it with strong generalization ability with balanced classification metrics. Also, the Gradient Boosting method has high precision because of building many trees sequentially, while resulting in higher computational time. The other models such as Logistic Regression or Decision Trees may outperform the ensemble methods when faster training time or lower computational cost is a priority.
Model training related results presented in Figure 3 provide the reliability of cross-validation (CV) tuning by comparing the CV scores against out-of-sample test accuracy, for each model and across three companies.
The strong alignment between validation and test performance for Tesla (r = 0.904) suggests that its models are both robust and generalizable. Apple showed a moderate positive correlation (r = 0.668), with most models achieving accuracies in the 0.65–0.75 range. In contrast, NVIDIA exhibited a weaker correlation (r = 0.364), indicating that higher cross-validation scores did not consistently translate into better generalization on test data. This inconsistency is likely attributable to greater volatility and non-stationary behavior in NVIDIA’s stock.
Additionally, the trade-off between test precision and recall was examined across all models, as illustrated in Figure 4.
Among the three companies, Tesla demonstrated the most consistent performance, with a near-perfect linear correlation (r = 0.991) indicating balanced classification outcomes across models and minimal trade-offs between false positives and false negatives. Apple also achieved strong balance (r = 0.987), whereas NVIDIA’s results were more scattered (r = 0.523), reflecting inconsistent behavior likely driven by its higher volatility. Across all models, Naïve Bayes consistently underperformed, yielding high recall but very low precision—suggesting an excessive rate of false positives. These findings underscore the importance of evaluating multiple performance metrics such as precision, recall, and F1-score, rather than relying on accuracy alone. This is particularly critical for noisy financial data, where considering a single metric may result in a misleading judgment about model performance.

6. Model Assessment and Discussions

This section presents a comprehensive evaluation of model performance in classifying stock movements as up, down, or neutral. The analysis emphasizes comparisons across key technical indicator-based features, the three companies under study, and the nine machine learning models applied.

6.1. Feature Importance

Figure 5 highlights the top eight features that play the most significant role in driving predictive performance across Apple, Tesla, and NVIDIA.
Figure 5 indicates that momentum-based indicators consistently dominate predictive performance. Among them, the fastK (X17) stochastic oscillator emerged as the single most influential feature across all three companies, with average importance scores of 0.896, 0.920, and 0.928 for Apple, Tesla, and NVIDIA, respectively. Other key contributors—such as CCI (X11), pctB (X32), and slowD (X19)—further highlight the central role of stochastic and momentum indicators in capturing directional shifts under varying market conditions. While Apple and Tesla display nearly identical feature hierarchies, NVIDIA exhibits greater sensitivity to volatility, as reflected in the higher importance of price range–based indicators.
These findings align with the prior literature, which frequently categorizes technical indicators into market-based groups to enhance interpretability [20,21]. For example, stochastic oscillators such as fastK (X17) and fastD (X18) are effective in detecting momentum shifts and potential reversal points, whereas Bollinger Bands and support/resistance levels capture volatility patterns and psychological boundaries in pricing behavior.
Figure 6 shows the comprehensive result for feature importance analysis considering the combined categories.
It is observed from Figure 6 that momentum indicators have the highest average importance score (~0.049) followed by volatility indicators (~0.017) and trend indicators (~0.007) for the three stocks under study. It suggests that short-term momentum signals are much more influential than long-term trend or volatility measures for predicting the stock movement directions. In addition, for all three companies (Apple, NVIDIA, Tesla) momentum indicators show the highest average importance, with Apple slightly leading. Trend indicators have the lowest importance scores with Apple marginally higher than the other two companies. For the volatility indicators, Tesla shows a higher importance compared to Apple and NVIDIA. While momentum indicators dominate across all companies, Tesla relies more on volatility features than the others. According to the pie chart, over half of the most important features belong to momentum-based metrics, aligning with the performance results of the first graph. Trend and volatility play a smaller but still notable role in the predictions. The model preferences by category (stacked bar chart on the bottom right), also shows that different models prioritize categories differently. XGBoost generally values all categories more than decision tree, especially for volatility.
Overall, momentum indicators are the most critical feature category for stock movement prediction across all companies and models. While, Tesla’s models rely more on volatility indicators, Apple or NVIDIA rely more on momentum indicators.

6.2. Sensitivity for Down, Neutral and up Categories

The sensitivity metric, also called recall or true positive rate, is directly calculated from the confusion matrix. In a multi-class prediction problem, we can compute sensitivity for each class, showing how well the model identifies correct classes. Table 5 shows the results of sensitivity values for the down, neutral, and up categories.
It is observed from Table 5 that machine learning models struggle to provide high prediction performances in all three categories. In general, simple model such as Naive Bayes show extreme patterns with either perfect prediction on one class or total collapse on others, thereby indicating a lack of robustness. Ensemble methods such as Random Forest, Gradient Boosting, and XGBoost generally perform better but still suffer from inferior performance in one or two categories. Regularized models such as Logistic Regression and SVM also provide conservative performances one or two categories. This highlights difficulty in learning discriminative boundaries for the three categories “neutral”, “up”, and “down”.
For Apple, Naive Bayes predicts almost all categories as “neutral”, suggesting assumption of feature independence not holding and is a poor choice for capturing stock market patterns. Random forest provides balanced performance across classes and shows robustness due to averaging multiple trees, though performance for the “up” category remains weaker. KNN provides reasonably balanced prediction performance for the three categories. This suggests local neighborhood structure works well for Apple stock, but sensitivity to distance metric may cap performance. Gradient Boosting has strong prediction performance for “neutral”, but weak performance for “up” category. This suggests it captures some non-linear trends better than logistic regression.
For NVIDIA, SVM achieves the highest sensitivity when classifying the “down” category, but its performance declines sharply for “neutral” and “up”. This indicates that the decision boundary aligns well with one class but fails to generalize across the others. KNN also performs strongly on “down” but collapses on the remaining categories, likely due to overfitting to local data clusters and limited generalization capability. In contrast, XGBoost delivers more balanced performance across all three categories, suggesting that it captures complex non-linear relationships effectively and highlighting why boosting ensembles are particularly well-suited for structured tabular data.
Similarly, for Tesla, Naïve Bayes has high sensitivity value when correctly classifying “down” category; however, it struggles with “neutral” and “up” categories. This again highlights Naïve Bayes’ poor assumption fit for market data. Random Forest, SVM, and XGBoost show consistent balanced performance across classes, indicating they capture more generalizable structure. Logistic regression has strong prediction performance for “up”, but weak for “neutral” category suggesting regularization helps, but linearity limits neutral separation. AdaBoost has balanced prediction performance across all three categories suggesting adaptive reweighting helped catch minority classes.
Overall, ensemble methods such as Random Forest, Gradient Boosting, XGBoost, and AdaBoost performed well as they can handle non-linearity, reduce variance by combining learners, and are more robust to imbalance when tuned. KNN performed well in some cases as it captures local structure when classes are well-clustered. On the other hand, Naive Bayes performed poorly due to unrealistic independence assumption for stock features as technical indicators can be highly correlated. Lack of good performance from Decision Tree can be attributed to overfitting to noise and poor generalization. When comparing different machine learning methods across “down”, “neutral” and “up” categories, XGBoost provides the highest overall sensitivity average of about 0.593.

6.3. Understanding Individual Predictions

One of the long-standing challenges of machine learning models is their “black-box” nature, which makes it difficult to understand how predictions are generated. In recent years, however, significant efforts have been made to develop techniques that provide interpretability and explainability for these models. Figure 7 illustrates one such approach, which focuses on explaining individual predictions to enhance transparency and trust in model outcomes.
Figure 7 illustrates cases 1201 and 1202 to provide deeper insights into individual predictions. Each prediction provides information about the case number, label indicating prediction category, probability for the prediction category, and explanation fit that indicates how well the model explains this specific prediction. It also includes a plot of five most influential features that help explain increase or decrease in the prediction probability for each situation.
For case 1201, the model predicts the “neutral” category with a probability of 0.60. Explanation fit for this prediction is 4.46%, which is at the highest for this case when predicting “neutral” category. The strongest contributor to this outcome is feature X02 (exponential moving average) being greater than 188. In addition, features—X12 and X28 cause increase in the prediction probability whereas features X10 and X35 cause decrease in prediction probability. However, these four features make smaller contributions to the prediction. The alternative categories, “down” and “up”, receive much lower probabilities of 0.21 and 0.20, respectively.
For case 1202, the model predicts “neutral” with a probability of 0.55. Here, the most influential factor is feature X11 (CCI) falling between −90.2 and −74. However, unlike case 1201, there is no single dominant feature in this case. Instead, several features—X32, X25, X17, and X20—jointly contribute to supporting the “neutral” prediction. The alternative categories, “down” and “up”, receive much lower probabilities of 0.25 and 0.20, respectively.
This type of analysis enhances interpretability by showing how specific features influence model outcomes, allowing users to gain valuable insights into the reasoning behind a machine learning prediction.

7. Conclusions, Limitations, and Future Research

This study evaluated nine machine learning models for one-day-ahead stock price prediction of Apple, Tesla, and NVIDIA using technical indicator-based features. Results show that momentum indicators consistently dominate predictive performance, while SVM excelled for Apple and XGBoost performed best for NVIDIA and Tesla. Naïve Bayes underperformed across all datasets. Category-level sensitivity analysis revealed that models often struggled to balance performance across “up,” “down,” and “neutral” classes, underscoring the difficulty of achieving robust classification in volatile financial markets. This study offers several actionable recommendations for investors and traders:
  • Focus on momentum indicators: Stochastic oscillators, CCI, and Bollinger Band–based features consistently emerged as dominant predictors. Traders should prioritize these metrics to identify short-term shifts and refine entry/exit timing.
  • Adopt a stock-specific modeling approach: No single model excelled across all equities. SVM performed best for Apple, while XGBoost outperformed for NVIDIA and Tesla. Investors should tailor algorithms to the characteristics of each stock rather than rely on a one-size-fits-all approach.
  • Leverage explainable AI for trust and adoption: Interpretability tools clarify which indicators drive predictions, helping traders validate signals and enabling institutional investors to justify model-based decisions to stakeholders.
  • Integrate risk management with model outputs: Since model sensitivity varies across “up,” “down,” and “neutral” categories, traders can minimize exposure by acting only in categories where prediction reliability is high and avoiding trades under uncertain conditions.
By aligning these insights with trading practices, investors can better balance predictive accuracy with transparency, ultimately improving strategy robustness in volatile financial markets.
However, this study also has certain limitations. The analysis was confined to three technology firms, limiting generalizability, and focused exclusively on technical indicators without incorporating sentiment or macroeconomic factors. Fixed thresholds for classification and reliance on a single train–test split may not fully capture market dynamics and limit robustness. Another limitation is the choice of data time range from January 1st, 2018 to June 30th, 2025. It includes events such as the COVID-19 pandemic or chip shortages, thereby affecting the generalization. Future work should expand to other sectors, integrate sentiment and fundamental data, and explore advanced deep learning or hybrid models. Rolling-window validation and dynamic thresholding could further improve adaptability, while broader use of explainability tools may enhance trust and usability in financial decision-making.

Author Contributions

Formal analysis, L.S.; Writing—original draft, B.R. All authors have read and agreed to the published version of the manuscript.

Funding

This research received no external funding.

Data Availability Statement

The data used in this study are openly available from Yahoo finance.

Conflicts of Interest

The author declares no conflicts of interest.

Abbreviations

The following abbreviations are used in this manuscript:
AdaBoostAdaptive Boosting
ADXAverage Directional Movement Index
BBandsBollinger Bands
CCICommodity Channel Index
CEFLANNComputationally Efficient Functional Link Artificial Neural Network
CMOChande Momentum Oscillator
CVCross Validation
DVIDavid Varadi Intermediate Oscillator
EMHEfficient Market Hypothesis
EPCNNEvolved Partially Connected Neural Networks
GBGradient Boosting
GridSearchCVGrid Search Cross-Validation
KNNK-Nearest Neighbor
KSTKnow Sure Thing
MAMoving Average
MACDMoving Average Convergence/Divergence
MFIMoney Flow Index
OBVOn Balance Volume
PbandsVolatility bands around prices
RFRandom Forest
ROCRate of Change / Momentum
RSIRelative Strength Index
SVMSupport Vector Machine
TDITrend Detection Index
TRIXTriple Smoothed Exponential Oscillator
VHFVertical Horizontal Filter
XGBoostExtreme Gradient Boosting

References

  1. Fama, E.F. The Behavior of Stock-Market Prices. J. Bus. 1965, 38, 34–105. [Google Scholar] [CrossRef]
  2. Fama, E.F. Random walks in stock market prices. Financ. Anal. J. 1995, 51, 75–80. [Google Scholar] [CrossRef]
  3. Majhi, R.; Panda, G.; Sahoo, G. Development and performance evaluation of FLANN based model for forecasting of stock markets. Expert Syst. Appl. 2008, 36, 6800–6808. [Google Scholar] [CrossRef]
  4. Cheng, C.H.; Chen, T.L.; Wei, L.Y. A hybrid model based on rough sets theory and genetic algorithms for stock price forecasting. Inf. Sci. 2010, 180, 1610–1629. [Google Scholar] [CrossRef]
  5. Chourmouziadis, K.; Chatzoglou, P.D. An intelligent short term stock trading fuzzy system for assisting investors in portfolio management. Expert Syst. Appl. 2016, 43, 298–311. [Google Scholar] [CrossRef]
  6. da Costa, T.R.C.C.; Nazário, R.T.; Bergo, G.S.Z.; Sobreiro, V.A.; Kimura, H. Trading System based on the use of technical analysis: A computational experiment. J. Behav. Exp. Financ. 2015, 6, 42–55. [Google Scholar] [CrossRef]
  7. Zhang, J.; Cui, S.; Xu, Y.; Li, Q.; Li, T. A novel data-driven stock price trend prediction system. Expert Syst. Appl. 2018, 97, 60–69. [Google Scholar] [CrossRef]
  8. Northcott, A. The complete guide to using candlestick charting; how to earn high rates of return—Safely. Atl. Publ. 2009, 24, 288. [Google Scholar]
  9. Cowles, A. Can stock market forecasters forecast? Econometrica 1933, 1, 309–324. [Google Scholar] [CrossRef]
  10. Menkhoff, L.; Taylor, M.P. The Obstinate Passion of Foreign Exchange Professionals: Technical Analysis. J. Econ. Lit. 2007, 45, 936–972. [Google Scholar] [CrossRef]
  11. Zhu, Y.; Zhou, G. Technical analysis: An asset allocation perspective on the use of moving averages. J. Financ. Econ. 2009, 92, 519–544. [Google Scholar] [CrossRef]
  12. Gorgulho, A.; Neves, R.; Horta, N. Applying a GA kernel on optimizing technical analysis rules for stock picking and portfolio composition. Expert Syst. Appl. 2011, 38, 14072–14085. [Google Scholar] [CrossRef]
  13. Chang, P.C.; Wang, D.D.; Zhou, C.L. A novel model by evolving partially connected neural network for stock price trend forecasting. Expert Syst. Appl. 2012, 39, 611–620. [Google Scholar] [CrossRef]
  14. Ballings, M.; Poel, D.V.; Hespeels, N.; Gryp, R. Evaluating multiple classifiers for stock price direction prediction. Expert Syst. Appl. 2015, 42, 7046–7056. [Google Scholar] [CrossRef]
  15. Patel, J.; Shah, S.; Thakkar, P.; Kotecha, K. Predicting stock and stock price index movement using trend deterministic data preparation and machine learning techniques. Expert Syst. Appl. 2015, 42, 259–268. [Google Scholar] [CrossRef]
  16. Dash, R.; Dash, P.K. A hybrid stock trading framework integrating technical analysis with machine learning techniques. J. Financ. Data Sci. 2016, 2, 42–57. [Google Scholar] [CrossRef]
  17. Ayalon, Y. Technical Analysis Indicators 101: A Practical Guide to Technical Analysis Indicators; Independently Published: Chicago, IL, USA, 2025; ISBN-13: 979-8292402558. [Google Scholar]
  18. Probst, P.; Wright, M.N.; Boulesteix, A.L. Hyperparameters and tuning strategies for random forest. Wiley Interdiscip. Rev. Data Min. Knowl. Discov. 2019, 9, e1301. [Google Scholar] [CrossRef]
  19. Putatunda, S.; Rama, K. A Comparative Analysis of Hyperopt as Against Other Approaches for Hyper-Parameter Optimization of XGBoost. In Proceedings of the 2018 International Conference on Signal Processing and Machine Learning (SPML ‘18), Shanghai, China, 28–30 November 2018; Association for Computing Machinery: New York, NY, USA, 2018; pp. 6–10. [Google Scholar] [CrossRef]
  20. Mostafavi, S.M.; Hooman, A.R. Key technical indicators for stock market prediction. Mach. Learn. Appl. 2025, 20, 100631. [Google Scholar] [CrossRef]
  21. Saud, A.S.; Shakya, S. Technical indicator empowered intelligent strategies to predict stock trading signals. J. Open Innov. Technol. Mark. Complex. 2024, 10, 100398. [Google Scholar] [CrossRef]
Figure 1. Three phases for the proposed study.
Figure 1. Three phases for the proposed study.
Bdcc 09 00248 g001
Figure 2. Chart depicting stock price for Apple with blue line indicating 20-day moving averages.
Figure 2. Chart depicting stock price for Apple with blue line indicating 20-day moving averages.
Bdcc 09 00248 g002
Figure 3. Cross-validation (CV) score obtained during tuning with the test accuracy achieved on test data.
Figure 3. Cross-validation (CV) score obtained during tuning with the test accuracy achieved on test data.
Bdcc 09 00248 g003
Figure 4. Trade-off between test precision and recall across all classification models.
Figure 4. Trade-off between test precision and recall across all classification models.
Bdcc 09 00248 g004
Figure 5. Top eight important features comparison across three companies.
Figure 5. Top eight important features comparison across three companies.
Bdcc 09 00248 g005
Figure 6. Category-based feature importance analysis: (a) Feature category performance analysis. (b) Performance by Company. (c) Distribution of feature category performance. (d) Model and feature categories.
Figure 6. Category-based feature importance analysis: (a) Feature category performance analysis. (b) Performance by Company. (c) Distribution of feature category performance. (d) Model and feature categories.
Bdcc 09 00248 g006
Figure 7. Explaining individual predictions.
Figure 7. Explaining individual predictions.
Bdcc 09 00248 g007
Table 1. Thirty-six technical indicator-based features capturing trend, momentum, and volatility.
Table 1. Thirty-six technical indicator-based features capturing trend, momentum, and volatility.
Trend IndicatorsMomentum IndicatorsVolatility Indicators
  • Simple moving verage (x01)
  • Exponential moving average (x02)
  • ADX (x03)
  • Aroon (x04)
  • TDI (x05, x06)
  • Donchian Channel (x07, x08, x09)
  • VHF (x10)
  • CCI (x11)
  • MFI (x12)
  • OBV (x13)
  • MACD (x14, x15)
  • RSI (x16)
  • Stochastics (x17, x18, x19)
  • CMO (x20)
  • KST (x21, x22)
  • TRIX (x23, x24)
  • ROC (x25)
  • DVI (x26, x27, x28)
  • Momentum (x29)
BBands
  • Down (x30)
  • Up (x31)
  • % (x32)
Volatility (x33)
Pbands
  • Down (x34)
  • Center (x35)
  • Up (x36)
Table 2. Number of data points in different categories with threshold levels 0.5%, 1.0%, 1.5%, and 2.0%.
Table 2. Number of data points in different categories with threshold levels 0.5%, 1.0%, 1.5%, and 2.0%.
Company NameThreshold % (T)UpDownNeutralImbalance Ratio
Apple0.58636032663.24
Apple1.07084915331.44
Apple1.55583967781.96
Apple2.040130510263.36
NVIDIA0.59076401854.90
NVIDIA1.08095693542.29
NVIDIA1.57355094881.51
NVIDIA2.06544516271.45
Tesla0.58627261445.99
Tesla1.07696633002.56
Tesla1.57036054241.66
Tesla2.06405405521.19
Table 3. The grid setup for the hyperparameter tuning for each predictive model.
Table 3. The grid setup for the hyperparameter tuning for each predictive model.
ModelKey Hyperparameters TunedRationale
Random Forestn_estimators: [50, 100, 200]
max_depth: [10, 20, None]
min_samples_split: [2, 5, 10]
min_samples_leaf: [1, 2, 4]
Controls ensemble size and tree complexity to balance bias-variance
Gradient Boostingn_estimators: [50, 100, 200]
learning_rate: [0.01, 0.1, 0.2]
max_depth: [3, 5, 7]
min_samples_split: [2, 5, 10]
Balances learning step size and tree complexity
XGBoostn_estimators: [50, 100, 200]
learning_rate: [0.01, 0.1, 0.2]
max_depth: [3, 5, 7]
min_child_weight: [1, 3, 5]
Controls overfitting via regularized boosting and leaf constraints
AdaBoostn_estimators: [50, 100, 200]
learning_rate: [0.01, 0.1, 0.5, 1.0]
algorithm: [‘SAMME’, ‘SAMME.R’]
Tests different boosting strategies and step sizes
SVMC: [0.1, 1, 10, 100]
kernel: [‘linear’, ‘rbf’, ‘poly’]
gamma: [‘scale’, ‘auto’, 0.001, 0.01]
Explores regularization and kernel-specific behavior
Logistic RegressionC: [0.01, 0.1, 1, 10, 100]
penalty: [‘l1’, ‘l2’]
solver: [‘liblinear’, ‘saga’]
max_iter: [1000, 2000]
Tests different solvers and regularization schemes
KNNn_neighbors: [3, 5, 7, 9, 11]
weights: [‘uniform’, ‘distance’]
metric: [‘euclidean’, ‘manhattan’, ‘minkowski’]
Optimizes distance metric and voting strategy
Naive Bayesvar_smoothing: [1 × 10−9, 8 × 10−3, 1 × 10−7, 1 × 10−6, 1 × 10−5]Smooths probabilities to avoid numerical instability
Decision Treemax_depth: [5, 10, 20, None]
min_samples_split: [2, 5, 10, 20]
min_samples_leaf: [1, 2, 5, 10]
criterion: [‘gini’, ‘entropy’]
Balances depth and purity criteria to control overfitting
Table 4. Prediction results after hyperparameter tuning.
Table 4. Prediction results after hyperparameter tuning.
CompanyModelCV
Score
Test
Accuracy
Test
Precision
Test
Recall
Test
F1-Score
Training Time
AppleAdaBoost0.59380.67670.66330.67670.65514.3376
AppleDecision Tree0.55120.70110.68430.70110.67762.3036
AppleGradient Boosting0.52530.70110.72030.70110.6531249.9475
AppleK-Nearest Neighbors0.51880.66540.66600.66540.66280.2829
AppleLogistic Regression0.59970.69550.68320.69550.68223.9341
AppleNaive Bayes0.49880.65040.42300.65040.51260.0437
AppleRandom Forest0.51360.65230.66220.65230.650038.0964
AppleSVM0.59550.72740.71740.72740.705336.3812
AppleXGBoost0.54110.68610.68560.68610.657428.9349
NVIDIAAdaBoost0.57210.60710.64360.60710.60145.0047
NVIDIADecision Tree0.48290.56770.59530.56770.56942.2485
NVIDIAGradient Boosting0.46700.54320.61900.54320.5477229.0147
NVIDIAK-Nearest Neighbors0.46790.33650.56690.33650.26920.2014
NVIDIALogistic Regression0.53540.56950.56460.56950.52014.0674
NVIDIANaive Bayes0.39950.40790.16640.40790.23640.0461
NVIDIARandom Forest0.48120.51880.56310.51880.520918.1426
NVIDIASVM0.54210.39290.55560.39290.348344.5505
NVIDIAXGBoost0.48290.63530.65740.63530.639930.0013
TeslaAdaBoost0.61800.61470.61860.61470.61604.1529
TeslaDecision Tree0.51710.53570.54290.53570.53842.1489
TeslaGradient Boosting0.49200.53010.53060.53010.5303221.2618
TeslaK-Nearest Neighbors0.48960.57710.58260.57710.57710.1880
TeslaLogistic Regression0.53550.59400.57730.59400.57583.9646
TeslaNaive Bayes0.33360.33460.25900.33460.20880.0340
TeslaRandom Forest0.51880.61090.59960.61090.598417.8899
TeslaSVM0.54880.62780.62220.62780.622436.4019
TeslaXGBoost0.52960.63160.62710.63160.628929.3081
Table 5. Technical indicators and sensitivity.
Table 5. Technical indicators and sensitivity.
CompanyModelSensitivity
DownNeutralUp
AppleAdaBoost0.3450.8530.353
AppleDecision Tree0.3810.8820.353
AppleGradient Boosting0.4050.9340.157
AppleK-Nearest Neighbors0.5710.7600.422
AppleLogistic Regression0.5000.8380.373
AppleNaive Bayes0.0001.0000.000
AppleRandom Forest0.6310.7430.363
AppleSVM0.4520.9020.363
AppleXGBoost0.4520.8730.245
NVIDIAAdaBoost0.3820.5810.770
NVIDIADecision Tree0.4410.5640.650
NVIDIAGradient Boosting0.7720.3520.558
NVIDIAK-Nearest Neighbors0.9490.1060.143
NVIDIALogistic Regression0.8530.1400.747
NVIDIANaive Bayes0.0000.0001.000
NVIDIARandom Forest0.6760.4970.438
NVIDIASVM0.9560.1680.226
NVIDIAXGBoost0.5510.6540.673
TeslaAdaBoost0.6900.4800.670
TeslaDecision Tree0.5320.4510.617
TeslaGradient Boosting0.6320.4100.548
TeslaK-Nearest Neighbors0.6900.4860.559
TeslaLogistic Regression0.6840.3060.777
TeslaNaive Bayes0.9420.0000.090
TeslaRandom Forest0.7370.3580.729
TeslaSVM0.7190.4340.723
TeslaXGBoost0.7130.4680.707
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Rai, B.; Soltanisehat, L. A Multi-Model Machine Learning Framework for Daily Stock Price Prediction. Big Data Cogn. Comput. 2025, 9, 248. https://doi.org/10.3390/bdcc9100248

AMA Style

Rai B, Soltanisehat L. A Multi-Model Machine Learning Framework for Daily Stock Price Prediction. Big Data and Cognitive Computing. 2025; 9(10):248. https://doi.org/10.3390/bdcc9100248

Chicago/Turabian Style

Rai, Bharatendra, and Leili Soltanisehat. 2025. "A Multi-Model Machine Learning Framework for Daily Stock Price Prediction" Big Data and Cognitive Computing 9, no. 10: 248. https://doi.org/10.3390/bdcc9100248

APA Style

Rai, B., & Soltanisehat, L. (2025). A Multi-Model Machine Learning Framework for Daily Stock Price Prediction. Big Data and Cognitive Computing, 9(10), 248. https://doi.org/10.3390/bdcc9100248

Article Metrics

Back to TopTop