1. Introduction
A high quality of living can be achieved when nations prioritize the growth and development of their economies in order to maintain adequate levels of public spending. In today’s fast-paced economy, big businesses spring up to take advantage of untapped opportunities and adapt to the constant flux of the international marketplace [
1,
2]. The stock market is a marketplace where diverse assets may be bought and sold by participating investors on public, private, and mixed-ownership stock exchanges [
3]. Shares of publicly traded corporations are traded on the open stock exchange, whereas shares of privately owned companies are traded on the private stock exchange. The mixed-ownership stock exchange is invested in businesses with common shares that can be traded on the public stock market only in limited circumstances. Mixed-ownership stock exchanges are established in countries such as the United Kingdom (London Stock Exchange) and the United States (New York Stock Exchange) [
4,
5,
6,
7,
8,
9].
Investors have been attempting to foresee fluctuations in share prices ever since stock capital markets were first established. At that time, however, the amount of data accessible to them was rather restricted, and the methods for processing these data were relatively straightforward. Since then, the amount of data made available to investors has substantially increased, and new methods of processing these data have been made available as well. Even with all the recent advances in technology and cutting-edge trading algorithms, it is still an exceedingly difficult challenge for the majority of academics and investors to accurately predict the movements of stock prices. Traditional models, which have been in use for decades and are typically based on fundamental analysis, technical analysis, and statistical methods (such as regression in [
10]), are frequently unable to completely reflect the complexity of the problem that is currently being addressed.
The stock market serves as the backbone of every economy, and the primary objectives of any stock market investment are to earn a high return and reduce losses to a minimum [
4]. Therefore, countries should strive to strengthen their stock markets, since doing so is associated with economic growth [
11]. Since the stock market is a potential source of quick returns on investment, making profitable stock market predictions is a viable means to financial independence. The prediction of the stock market is not linear, which makes it more difficult to forecast the stock prices of a particular firm in a certain market [
12]. As a consequence, researchers and investors are required to identify methods that have the potential to lead to more accurate outcomes and bigger earnings [
13]. Machine learning models that have been around for some time, such as autoregressive integrated moving average (ARIMA), are inferior to more traditional machine learning models [
14]. Additionally, research shows that deep learning models such as long short-term memory (LSTM) outperform machine learning models such as support vector regression (SVR) [
15]. Artificial neural networks (ANNs) were shown to be the superior deep learning model over support vector machines [
16].
The advances made in machine learning and deep learning have created new opportunities for building stock price movement prediction models based on time-series data characterized by high cardinality, such as large object (LOB) data. These models are used to forecast how stock prices will change in the future. As a direct result, this particular field has garnered an ever-increasing amount of attention from researchers over the course of the past several years. The performance of the recommended models in terms of prediction is typically reported to be quite high. The authors of several state-of-the-art machine learning and deep learning models (e.g., [
17,
18]) have claimed that these models have an accuracy of more than 80%. From a more pragmatic point of view, these outcomes look too good to actually be repeatable when carrying out stock trading in the real world.
It is important to keep in mind, however, that the stock market is a trading platform that is ultimately controlled by the forces of supply and demand. In this paper, deep learning models were developed to anticipate momentum, strength, and volatility indicators for the purpose of assisting investors in making judgments that would provide accuracy and safety against rapid volatility in opposite directions to a transaction. To find the strategy that is most accurate for predicting future price fluctuations, we carried out a comprehensive investigation.
2. Background of the Study
Predicting the values of currency exchanges and stock markets has been the subject of a large number of studies [
19,
20,
21,
22,
23] in recent years. In [
24], a generative adversarial network architecture is described, and LSTM is recommended for use as a generator. As a discriminator for the layout, multi-layer perceptron (MLP) was suggested. Multiple metrics have been utilized to make comparisons between GAN, LSTM, ANNs, and SVR. Across the board, the suggested generative adversarial network (GAN) model was shown to be the most effective. The use of big data would make it possible to innovate more quickly and with greater efficiency. Examples of financial innovations that have contributed to the development of the financial sector and the expansion of the economy include exchange-traded funds, venture capital, and equity funds [
25,
26,
27,
28,
29,
30].
Because of this issue, there is a need for intelligent systems that can retrieve real-time pricing information, which can improve investors’ ability to maximize their profits [
28]. Decision support, modeling expertise, and automation of complex tasks have all benefited from the development of intelligent systems and artificial intelligence techniques in recent years. Some examples include artificial neural networks (ANNs), genetic algorithms, support vector machines, machine learning, probabilistic belief networks, and fuzzy logic [
31,
32]. Among these methods, ANNs are the most widely used in a variety of fields. ANNs are able to evaluate complicated non-linear relationships between input factors and output variables because they learn directly from the training data. This is the primary reason for this ability. Researchers investigating the use of ANNs for a variety of decision support systems have found that one of the most appealing aspects of ANNs is their capacity to serve as models for a broad range of real-world systems. However, despite growing popularity for the use of ANNs, only limited success has been realized thus far. This is mostly because of the unpredictable behavior and complexity of the stock market [
33]. Several researchers have investigated the use of artificial intelligence to make predictions on stock prices. For instance, we analyzed and reviewed approximately 100 studies that focused on neural and neuro-fuzzy techniques that were applied to forecast stock markets; we carried out a comparative research review of three popular artificial intelligence techniques—expert systems, ANNs, and hybrid intelligent systems—that were applied in finance; and they methodically analyzed and reviewed stock market prediction techniques [
34,
35].
It was discovered that LSTM performs far better than other models, as it achieved a score of 0.0151, while LR came in second with a score of 13.872, and SVR performed poorly with a score of 34.623 [
36,
37]. Both a correlational and a causal model were proposed based on graph theory. The findings demonstrated that graph-based models are superior to conventional approaches, with a causation-based model achieving somewhat better outcomes than a correlation-based model. The recurrent neural network (RNN), LSTM, and gated recurrent unit (GRU) models are presented in their most fundamental forms in [
38]. The GRU model performed the best, with an accuracy of 0.670 and a log loss of 0.629. This was followed by the LSTM model, which performed with an accuracy of 0.665 and a log loss of 0.629, and the RNN model, which performed with an accuracy of 0.625 and a log loss of 0.725. Nevertheless, once both LSTM and GRU were modified by the addition of a dropout layer, the GRU model did not exhibit any improvement while the LSTM model showed a minor improvement in its performance.
The LSTM model, which is an RNN architecture utilized in natural language processing, was proposed in [
39] to forecast NIFTY 50 stock values. The findings indicated that the model’s performance improved with the addition of new parameters and epochs, and the model’s root mean squared error (RMSE) value was 0.00859 when it was run with 500 iterations using the high, low, open, and closed parameter sets. Four different types of deep learning models were used in [
40], and those models were multilayer perceptron (MLP), recurrent neural network (RNN), CNN, and LSTM. Every one of these models was educated with the use of data provided by Tata Motors. After initialization and training, the models were put to the test by being asked to predict future stock values. The models were able to recognize the patterns of stock movement, even in other stock markets, which allowed for the achievement of good outcomes. CNN was shown to be better than the other three models, despite the fact that this indicates that deep learning models are able to uncover the underlying dynamics. The ARIMA model was part of that research as well, but it was unable to understand the underlying dynamics that occur between different time series.
The authors of [
41] made their predictions about the stock market using a CNN, which is a kind of deep learning. Furthermore, the genetic algorithm (GA) was used to systematically improve the parameters of the CNN technique. The findings demonstrated that the GA-CNN, which is a hybrid approach that combines GA and CNN, outperformed the comparison models. This was demonstrated by the fact that the GA-CNN outperformed the comparison models. Convolutional neural networks were proposed by Sim et al. [
42] as a method for predicting market values (CNN). The main objective of the research was to enhance the performance of CNNs when applied to data pertaining to stock markets. Wen et al. [
43] took a fresh approach by applying the CNN algorithm to noisy temporal data based on common patterns. This was a revolutionary method. The findings provided conclusive evidence that the technique is effective, exhibiting a 4–7% improvement in accuracy in comparison to more traditional signal processing methodologies.
Convolutional neural networks (CNNs) and recurrent neural networks were used in the study by Rekha et al. [
44] to analyze and evaluate the performance of two different methodologies when applied to data from the stock market (RNNs). Lee et al. [
45] used data from many countries for the purpose of training and testing their model in order to make a prediction about the global stock market using CNNs. Baldo, A., Cuzzocrea et al. [
46] used the RNN model for forecasting financial marketing.
Additionally, the literature on the usage of artificial intelligence and soft computing techniques for stock market prediction is yet to develop an accurate predictive model; however, the disadvantage of these studies are, firstly, that the pre-processing of input data has not been carried out with precision in the extant literature so far. Secondly, the extant literature is, at best, partially successful in optimizing the parameter selections and model architectures. Thirdly, they used the pre-training model for predicting values, but the forecasting future for helping the investors was not used. Whereas the advantage of the proposed system is the achieved lesser prediction errors, preprocessing was used for enhancing the performance of the proposed prediction models.
5. Discussion
The stock market is an extremely important topic in today’s society. Investors are able to purchase additional stocks with relative ease and stand to make large gains from dividends distributed as part of the company’s incentive scheme for shareholders. Through stock brokerages and electronic trading platforms, investors can also trade their own stocks with other traders on the stock market. On the stock market, traders want to acquire stocks with values that are forecasted to increase and sell stocks with values that are forecasted to fall. Therefore, before making a trading choice to buy or sell a stock, stock traders need to be able to accurately forecast the general behavior trends of the stock they are trading. The more correct their estimate is regarding how a stock will behave, the more profit they will make from that prediction. As a result, it is vital to design an autonomous algorithm that is able to precisely predict market movements in order to assist traders in maximizing their profits. However, the prediction of trends in the stock market is a difficult task due to a number of elements, including industry performance, company news and performance, investor attitudes, and economic variables.
Therefore, in this paper, the deep learning algorithms LSTM and hybrid CNN-LSTM were tested for their ability to predict Tesla and Apple stocks. The performance of these models during the training and testing phase for Tesla are presented in
Figure 16 and
Figure 17, respectively. CNN-LSTM scored higher than LSTM during both the training (CNN-LSTM: R
2 = 99.58%; LSTM: R
2 = 97.20%) and testing (CNN-LSTM: R
2 = 98.37%; LSTM: R
2 = 93.03%) phases. Therefore, CNN-LSTM achieved better accuracy compared to LSTM.
As can be seen in
Figure 18 and
Figure 19, there is an outstanding agreement between the predicted and actual values. In addition, extremely high values of the R percent were reported during the training (CNN-LSTM: 99.83%; LSTM: 99.68%) and testing (CNN-LSTM: 99.48%; LSTM: 98.66%) phases. These figures demonstrate that the CNN-LSTM model was more accurate and reliable than LSTM for the Apple data.
In order to prove the effectiveness of CNN-LSTM, we compared this proposed deep learning model’s result with the result of [
51], who also used the companies Tesla and Apple. The results of the CNN-LSTM model proposed in this study compared to the models used in [
51] are shown in
Table 6. The propped CNN-LSTM model is superior to the other study’s models according to the MSE metric.
Because of the potential advantages, it may provide accurate prediction of the future, which has long been a goal of most economies and individuals. Those who are interested in exploring stock market prediction can also benefit from learning how to forecast fluctuations in stock prices. Researchers will have access to predictions that are more precise than they have ever been because of artificial intelligence. In addition, its precision will increase over time as both technological capabilities and algorithmic precision improve.
Researchers are now able to make market forecasts using non-traditional textual data gleaned from social networks thanks to the development of sophisticated trading algorithms. These models are based on artificial intelligence. In addition, we recommend that may researchers investigate the connection between the use of social media and the performance of the stock market. The economic climate that is created by the news media or the direct observation of the stock market sentiment can be used to make decisions regarding stock marketing.
6. Conclusions
The behavior of the stock market is unpredictable and is dependent on a variety of variables, including the state of the global economy, the geopolitical environment, company performance, investor expectations, and financial reports. A firm’s profits is an important factor that should be considered when assessing gain or loss in the stock price. Additionally, it can be difficult for an investor to forecast how the market will behave. Because the stock market is such an integral component of the economy as a whole, an increasing number of investors are focusing their attention on strategies that will allow them to maximize their returns while mitigating the negative effects of certain risks. The direction of the stock market is influenced by a wide variety of variables, and the information that is pertinent to this topic often takes the shape of a time series. The objective of this study was to anticipate the price at which the stock will close for the day using a composite model called LSTM and CNN-LSTM. The performance of the CNN-LSTM model was significantly better than the LSTM model. To complete this task, the Tesla and Apple stock market data were used. According to the findings of the experiments, the CNN-LSTM and LSTM stock prediction models were superior to the existing models in terms of their ability to make accurate forecasts. The forecasting of the stock price at the end of the trading day was included in this research. The deep learning models were used to predict the closing price of a stock on the next trading day, which is a valuable reference for investments. Because investors want to forecast the closing price and trend of a stock over the next time period, more in-depth studies on the changes in stocks are needed.
A limitation of this study is that we did not use the sentiment information that was derived from the investigation of the financial markets. One of the problems with this study is that it had this constraint.
In future work, we will use an advanced approach to deep learning or a hybrid model that uses both stock price indexes and sentiment news analysis in order to improve the results of the proposed system.