Skip to Content
DataData
  • Article
  • Open Access

22 May 2019

A Novel Hybrid Model for Stock Price Forecasting Based on Metaheuristics and Support Vector Machine

,
,
and
1
Department of Finance, Qom Branch, Islamic Azad University, Qom 3749113191, Iran
2
Young Researchers and Elite Club, Qom Branch, Islamic Azad University, Qom 88447678, Iran
3
Department of Accounting, Qom Branch, Islamic Azad University, Qom 3749113191, Iran
4
Department of Finance, Iranian Institute of Higher Education, Tehran 13445353, Iran
This article belongs to the Special Issue Data Analysis for Financial Markets

Abstract

This paper intends to present a new model for the accurate forecast of the stock’s future price. Stock price forecasting is one of the most complicated issues in view of the high fluctuation of the stock exchange and also it is a key issue for traders and investors. Many predicting models were upgraded by academy investigators to predict stock price. Despite this, after reviewing the past research, there are several negative aspects in the previous approaches, namely: (1) stringent statistical hypotheses are essential; (2) human interventions take part in predicting process; and (3) an appropriate range is complex to be discovered. Due to the problems mentioned, we plan to provide a new integrated approach based on Artificial Bee Colony (ABC), Adaptive Neuro-Fuzzy Inference System (ANFIS), and Support Vector Machine (SVM). ABC is employed to optimize the technical indicators for forecasting instruments. To achieve a more precise approach, ANFIS has been applied to predict long-run price fluctuations of the stocks. SVM was applied to create the nexus between the stock price and technical indicator and to further decrease the forecasting errors of the presented model, whose performance is examined by five criteria. The comparative outcomes, obtained by running on datasets taken from 50 largest companies of the U.S. Stock Exchange from 2008 to 2018, have clearly demonstrated that the suggested approach outperforms the other methods in accuracy and quality. The findings proved that our model is a successful instrument in stock price forecasting and will assist traders and investors to identify stock price trends, as well as it is an innovation in algorithmic trading.

1. Introduction

Stock price forecasting is surely one of the most important issues in finance and it has become one of the serious concerns of investors and shareholders since accurate and authentic forecasts of stock prices have attractive rewards and profitable advantages, and inaccurate and unreliable predictions can have irreparable consequences. Hence, it is essential to provide a precise and efficient model for predicting stock prices.
Stock price forecasting strategies are categorized into three wide classes that could overlap. The three classes are, respectively, fundamental analysis, technical analysis, and technological approaches [1]. Fundamental analysis analyzes economic, monetary, and financial variables which affect a company’s value and attempt to calculate it through financial statements [2]. Technical analysis is an analysis strategy for predicting the trend of prices and it reveals this concept that prices fluctuate in patterns that are determined by investors’ changing tendencies in the direction of various economic, commercial, financial, political, and psychological factors [3]. The philosophy of the technical analysis is the opinion that all of the variables which affect market price are instantly impressed in the market process. This means that the effect of these external variables will immediately cause fluctuations in stock prices. Technical analysts work with different analytical instruments like technical indicators to analyze a security’s strength or weakness and forecast future price variations. This is in contrast to fundamental experts, who examine the intrinsic value of securities.
The technical indicators are definitely one of the major criteria for investing in the stock market and they play an important task in buy/sell stocks signals. Technical indicators are typically utilized by dynamic investors and traders because they are planned to evaluate short period price trends; however, long term traders can also apply technical indicators to recognize entry and exit positions. Technical indicators are mathematical computations on the basis of the price, volume, etc. By evaluating historical information, technical analysts employ indicators to forecast upcoming price fluctuations. Conventional time series approaches in statistics have also been employed to stock price forecasting [4].
In this article, a novel approach integrating Artificial Bee Colony (ABC), Adaptive Neuro-Fuzzy Inference System (ANFIS), and Support Vector Machine (SVM) has been planned for stock price forecasting and technical analysis in the U.S. Stock Exchange.
The model includes three modules:
  • The ABC module for multi-objective optimization of technical indicators.
  • The ANFIS module to predict the upcoming price of stocks.
  • The SVM module to create the nexus between the stock price and technical indicator and to further decrease the forecasting errors.
The ABC is a metaheuristic algorithm for optimizing numerical problems and it is precisely on the basis of the model for the foraging behavior of honey bee colonies. It contains three necessary parts: employed and unemployed foraging bees, and food sources [5]. ANFIS is an adaptive network that employs supervised learning on the learning algorithm and there are two groups of the diverse parameter in the framework of ANFIS: hypothesis and result. Training ANFIS implies the determination of these parameters applying the optimization algorithms [6]. Given that ANFIS has been extended, it is employed in modeling and simulation of many mechanisms and efficient outcomes have been attained. SVM is one of the discriminative classifiers wherein classification is dependent on the decision levels and their borders and it is a collection of supervised learning procedures which applied for classification and regression [7]. The principal idea of SVM is to build a hyperplane as the decision surface in ways that the margin of separation between positive and negative instances is maximized [8]. SVM has been used in different areas such as time series and financial forecasting, the approximation of complicated engineering examines, convex quadratic programming, selection of loss functions, and so on. Lately, the SVM has been effectively employed on stock price forecasting and its trends.
In this investigation, our model employs three methods including ABC, ANFIS, and SVM and combines them. Each of the methods has benefits and drawbacks. One strategy to overcome challenging real-world issues, particularly in the finance and investment field, is to incorporate the application of several techniques in an effort to merge their various strong points and deal with a single technique’s weak point. This strategy creates hybrid models which provide more desirable outcomes compared to the ones reached with the application of each separated technique.
Certainly, stock price forecasting is difficult due to stock market fluctuations resulting from the fact that the prices of stock are extremely unstable, complicated, and dynamic.
Based on the abovementioned items, it is an essential issue for financial experts and portfolio managers, and is presently getting substantial consideration from both investigators and practitioners.
In this paper, the “Mathworks MATLAB R2019” software has been utilized for the presentation and test of the model.
The remainder of this article is arranged as follows: beginning with this introduction and in the next section, the literature reviews are carried out on the previous studies. The materials and methods are explained in Section 3, and Section 4 describes the results and evaluation of the proposed model. The conclusions are then discussed in the last section.

3. Materials and Methods

In this section, a novel hybrid model for the stock price forecasting is created by using ABC, ANFIS, and SVM to achieve a more precise approach compared to previous approaches.
In the following, the detailed description of the different sections of our model is expressed.

3.1. Artificial Bee Colony (ABC)

The ABC algorithm is a recently improved swarm intelligence approach on the basis of the natural food searching behaviour of bees [47]. In the ABC algorithm, the colony of artificial bees includes three types of bees: (1) employed bees, (2) onlooker bees, (3) scouts bees. Half of the swarm includes employed bees and other half includes the onlooker bees. The number of employed bees or onlooker bees is equivalent to the number of solutions in the swarm. The ABC produces a randomly dispersed primary population of SN solutions wherein SN indicates the swarm size. In a D-dimensional lookup area, every solution ( S i j ) is indicated in the following:
S i j = { S i 1 ,   S i 2 ,   S i 3 ,   ,   S i D }
Wherein i and j ∈ {1, 2, 3, … , D}
D: The dimension size
S i j : The indicator for solutions of a population
The possibility value that is depending on the individuals’ fitness value to summation of fitness values of every food sources and determines whether a particular food source has potential to obtain position of a new food source is measured by:
P i = f i i = N S N f i
Wherein f i , P i : the fitness and possibility of the food source i.
After sharing the nectar information between the present onlookers and applied bees, for greater fitness compared to the earlier one, the situation of the new food source is computed as follows:
V i j ( n + 1 ) = S i j ( n ) + [ φ n × ( S i j ( n ) S k j ( n ) ) ]
Wherein: k ∈ {1, 2, 3, … , SN} is a randomly chosen indicator and has to be varying from i. n is the optimization variables indicator. S i j (n) is the food source situation at nth iteration, wherein V i j ( n + 1 ) is its modified situation in (n + 1)th iteration.
φn is a random number in the area of [−1, 1]. The parameter S i j is set to meet the appropriate value and is improved as:
S i j = S m i n , j + r a n d   ( 0 ,   1 )   ( S m a x , j S m i n , j )
Wherein:
r a n d   (0, 1): A random number within [0, 1]
S m a x , j ,   S m i n , j : The maximum, minimum y-th parameter values
The steps of the ABC algorithm and the flowchart of the ABC are as follows:
  • Step 1: Initialize stage
  • Step 2: Repeat
  • Step 3: Employed bees stage
  • Step 4: Onlooker bees stage
  • Step 5: Scout bees stage
  • Step 6: Memorize the best food source
  • Step 7: Until cycle = Maximum cycle number
The detailed procedures of the ABC are displayed in Figure 1.
Figure 1. Flowchart of the Artificial Bee Colony (ABC).

3.2. Adaptive Neuro-Fuzzy Inference System (ANFIS)

ANFIS was first released by Jang [48]. The ANFIS integrates the features of artificial neural networks (ANN) and Fuzzy Inference Systems (FIS). Hence, it has quick learning capability, the potential of achieving the nonlinear framework of a system, and ability of adaptation. The quick learning capability is utilized for automatic fuzzy if-then principle generation and parameter optimization in ANFIS. Its inference system matches with a collection of fuzzy if-then principles which have learning capability to estimate nonlinear functions [48,49].
The ANFIS has been effectively applied to a wide range of issues in many different matters such as finance, accounting, financial engineering, economics, and management in ways that various objectives which includes analysis, assessment, and forecasting. The use of ANFIS for high-frequency data trading is highly effective.

ANFIS Structure

The ANFIS could solve any type of complex and nonlinear issue successfully by integrating the benefits of the ANN and FIS, and it leads to fewer errors. The structure of ANFIS is displayed in Figure 2. The ANFIS is basically the rule-based fuzzy modeling. Two rules which have employed in this structure are stated below:
R 1 = If   x   is   A 1   and   y   is   B 1   Then   f 1 = ( p 1 x + q 1 y + r 1 ) R 2 = If   x   is   A 2   and   y   is   B 2   Then   f 2 = ( p 2 x + q 2 y + r 2 )
Figure 2. Adaptive Neuro-Fuzzy Interference System (ANFIS) Structure.
Wherein:
A 1 ,   B 1 ,   A 2 ,   B 2 : Membership functions of each input x and y
p 1 ,   p 2 ,   q 1 ,   q 2 ,   r 1 ,   r 2 : Linear parameters in part-Then (consequent part)
As shown in Figure 2, the ANFIS structure has five layers that the formulas of the layers are defined in Equations (5)–(12).
Layer 1:
μ A i ( x ) = e x p [ ( x c i 2 a i ) 2 ]
μ A i ( x ) = 1 1 + | x c i a i | 2 b
O 1 , i = μ A i ( x ) ,         i = 1 ,   2
O 1 , i = μ B i 2   ( y ) ,         i = 3 ,   4
Layer 2:
O 2 , i = μ A i   ( x ) μ B i   ( y )       i = 1 ,   2
Layer 3:
O 3 , i = w ¯ i = w i i w i V
Layer 4:
O 4 , i = w ¯ i f i = w ¯ i ( p i x + q i y + r i )
w ¯ i : The normalized firing power from the previous layer
( p i x + q i y + r i ) : A parameter in the node
Layer 5:
O 5 , i = i w ¯ i f i = i w i f i i w i

3.3. Support Vector Machine (SVM)

SVM is a learning machine applying structural risk and minimizing inductive principle to get beneficial generalization on a restricted number of learning patterns. Firstly, SVM has been released by Vapnik [50] and it is a learning program utilizing a high dimensional feature space.
SVM executes a learning algorithm and it is beneficial for identifying delicate patterns in complicated information collections. This algorithm runs discriminative category learning by instance to forecast the categories of earlier unobserved information. Figure 3 illustrates the SVM structure.
Figure 3. Support Vector Machine (SVM) Structure.
SVM evolved from studies in statistical learning theory on how to adjust generalization, and discover an optimum trade-off between structural intricacy and empirical risk.
SVM categorize points by allocating them to one of two disjoint half areas, either in the pattern area or in a higher-dimensional characteristic area [51,52]. The equation of standard SVM as follows:
f ( x ) = w x i T + b = ( w 1 x 1 + w 2 x 2 + w 3 x 3 + + w n x n + b )
Considering the f(x), the classification is obtained as:
Y ^ = s i g n ( f ( x ) ) = { + 1     f ( x ) > 0 1     f ( x ) < 0
Considering a linearly separable data-collection, the role of learning coefficients w and b of f ( x ) = ( w x i T + b ) decreases to fixing the following constrained optimization issue:
Find w and b that minimize: 1 2 w 2
Subject to constraints: y i = ( w x i T + b ) 1 ,     i
This optimization issue could be fixed by applying the Lagrangian function determined as:
L   ( w , b , α ) = 1 2 W T W i = 1 N α i [ y i ( w x i T + b ) 1 ]
α i 0   ,             i
α i [ y i ( w x i T + b ) 1 ] = 0 ,       i
Wherein α 1 ,   α 2 , … α N are Lagrange multipliers and α = [ α 1 ,   α 2 , … α N ]T.
The answer of original limited optimization issue is specified by the saddle point of L ( w , b , α ) that has to be minimized with regards to w and b and maximized with regards to α .
Consider the following about Lagrange multipliers:
  • If ( w T x i + b ) > 1 , the value of α i that maximizes L ( w , b , α ) is α i = 0.
  • If ( w T x i + b ) < 1 , the value of α i that maximizes L ( w , b , α ) is α i = +∞.
  • Considering that w and b are attempting to minimize L , they will be modified in such a way to make X at least equal to +1.
Data points x i with α i > 0 are known as the support vectors.

3.3.1. Optimality Conditions

The essential statuses for the saddle point of L (w, b, α) are:
L W j = 0 ,     j
L a i = 0 ,     j
Or expressed α several procedures, w L = 0 ,     a L = 0
Solving for the essential conditions leads to:
w = i = 1 N α i   y i   x i
i = 1 N α i   y i = 0
By changing w = i = 1 N α i   y i   x i into the Lagrangian function and by applying i = 1 N α i   y i = 0 as a new limitation, the dual optimization issue could be designed as follow:
Find α that maximizes: i = 1 N α i 1 2   i = 1 N i = 1 N α i   α j   y i   y j   X i T X j
Subject   to :   i = 1 N α i y i = 0 ,         α i 0 ,                 i

3.3.2. Final Forecaster

Since the values α 1 , α 2 , … α N acquired by the answer of the dual issue, the final SVM forecaster could be given from Equation (17) as:
f ( x ) = W T X i = i = 1 N α j   y i   X i T X + b
Wherein:
b = 1 | I s u p p o r t | i I s u p p o r t N ( y i j = 1 N α j   y j   X j T X i )
I s u p p o r t : The set of support vectors.
We consider the following about support vectors:
  • Given that α i ≠ 0 merely for the support vectors, just support vectors are employed in achieving to forecasting model.
  • Notice that x j T   x i is a scalar.

3.4. Technical Indicators

Technical indicators are concentrated on historical information, for instance, price and volume, instead of the fundamental analysis of the trade. There are plenty of indicators in the market that can be utilized to reveal the momentum, trend, volatility, etc., and they are based on mathematical equations, which are the interpreters of the market. They check out price data and convert it into easy and useful signals which can assist investors and traders to specify when to buy or sell. Any technical indicator presents exclusive data and check out historical price information. They could be utilized as numerous indicators in combination with other indicators.
After the review of the past studies and related papers, we selected twenty original technical indicators that have major roles in the technical analysis and stock price forecasting. These technical indicators, which are listed in Table 1, could cover all stock data by considering the four classes including Oscillator, Index, Overlay, and Cumulative. Based on previous researches and viewpoints of technical experts and professionals, the twenty chosen technical indicators are the most essential indicators in the technical analysis.
Table 1. List of Selected Technical Indicators.

3.5. Proposed Model

Figure 4 illustrates the architecture of the presented model for the stock price forecasting. This figure shows that the ABC and ANFIS modules have been employed to multi-objective optimization of technical indicators, and the SVM module has been used to produce trading signals (Buy/Sale/Hold/Neutral).
Figure 4. Proposed Model.
After the calculations of the technical indicators outlined in Table 1, they have been applied in the model as input variables. At the first stage, the ABC is applied to optimize the technical indicators for forecasting tools. At the second stage, the ANFIS is implemented to predict the future price of stocks. At the third stage, the SVM has been used to data preprocessing by coding and then the data have been normalized. The determination of the input vector and sample learning are the last phases of the SVM. Eventually, the final signal will be obtained from the model.

3.6. Data and Parameter Setting

We execute the ABC-ANFIS-SVM by applying the daily stock price of the 50 largest American companies on the stock market, which are listed in Table A1 (see Appendix A). All of the information is collected from www.nyse.com, www.nasdaq.com, and www.marketwatch.com.
The periods of our research are adequate for testing and validation of the model because the boom and bust cycle and the economic fluctuations and important political events have happened during the years 2008–2018. To increase accuracy and avoid mistakes, sample selection in the training and testing data is divided into five periods of two years.
The details about the training and testing data are provided in Table 2. Approximately 80% of the data was intended for training, and 20% for testing. Four parameters from the stock exchange are employed to create the vectors and explanations of the parameters are mentioned in Table 3.
Table 2. Training and Testing Data.
Table 3. Parameter Explanation.
The parameter adjustments are essential since they can have a negative impact on the model performance if they are not correctly regulated. The adjustments of parameters are detailed in Table 4 and Table 5. The best-suited adjustments are planned for comparison with the other methods.
Table 4. ABC Parameter Settings.
Table 5. SVM Parameter Settings.
The technical indicators are the input variables and the output objectives are stock’s future price and the signals for buy/hold/sell.

4. Results and Evaluation

In this section, we evaluate the performance of the offered model and compare it with the other approaches. To enhance the credibility of the proposed model, five criteria for accuracy and quality are evaluated. These criteria determine the deviation between observed and forecasted values. These measures include RMSE, MAE, MAPE, and Theil’s U (U1, U2) and the formulas for them are as follows:
R M S E = 1 N t = 1 N ( O t F t ) 2
M A E = 1 N   t = 1 N | O t F t |
M A P E = 1 N   t = 1 N | O t F t O t |
T h e i l s   U 1 = [ t = 1 N ( O t F t ) 2 ] 1 2 [ t = 1 N F t 2 ] 1 2
T h e i l s   U 2 = [ 1 N     t = 1 N ( O t F t ) 2 ] 1 2 [ 1 N t = 1 N O t 2 ] 1 2 + [ 1 N t = 1 N F t 2 ] 1 2
Wherein O t indicates the observed price and F t shows the forecasted price at time t.
Theil suggested two U statistics contains U1 and U2, employed in finance. The U1 is a criterion of prediction accuracy [53]. The U2 is a criterion of prediction quality [54]. The interpretation of the Theil’s U is mentioned in Table A2 (see Appendix A).
The comparison outcomes of three key indexes in the U.S. Stock Exchange are shown in Table 6, Table 7, Table 8, Table 9 and Table 10, which prove that our technique has increased the forecasting precision and quality for all the three indexes.
Table 6. The outcomes of key indexes (U.S. SE) in terms of RMSE.
Table 7. The outcomes of key indexes (U.S. SE) in terms of MAE.
Table 8. The outcomes of key indexes (U.S. SE) in terms of MAPE.
Table 9. The outcomes of key indexes (U.S. SE) in terms of U1.
Table 10. The outcomes of key indexes (U.S. SE) in terms of U2.
To validation the model, the final results have been revealed in Table 6, Table 7, Table 8, Table 9, Table 10 and Table 11. According to the outcomes in these tables, it can be observed that the ABC-ANFIS-SVM could provide the lowest error and the topmost accuracy under the testing model.
Table 11. The final outcomes of the model in comparison with other methods.
Table 11 indicates that the RMSE, MAE, and MAPE for the ABC-ANFIS-SVM are less than the other models. Moreover, U1 and U2 for our method are higher than the other methods.
When implementing ANFIS the articles cited in the references were used [55,56]. All of the methods have been executed in “Mathworks MATLAB R2019” software. All in all, according to RMSE, MAE, MAPE, U1, and U2 criteria, we derived that ABC-ANFIS-SVM functions best in terms of accuracy and quality. The ABC-ANFIS-SVM is evaluated to other methods which are proved by five criteria. All values of our model are higher than other methods for all indices. For SVM implementations, all tests were executed on “Mathworks MATLAB” software utilizing LIBSVM [57].
The actual values and forecasted values for ABC-ANFIS-SVM are displayed in Figure 5, Figure 6, Figure 7, Figure 8, Figure 9, Figure 10 and Figure 11. The blue points represent forecasted values and the red lines represent observed values.
Figure 5. Samples of forecasted and observed prices for each year.
Figure 6. Performance Evaluation of ABC-ANFIS-SVM.
Figure 7. Model Fit (Training Data).
Figure 8. Model Fit (Testing Data).
Figure 9. Model Matching Results (No. 1).
Figure 10. Model Matching Results (No. 2).
Figure 11. Model Testing Results
The functionality for every year is computed and the outcomes have been displayed in Figure 5. Figure 6 illustrates the performance evaluation of ABC-ANFIS-SVM that corroborates the best performance. The forecasted prices approximately correspond with the trend of the observed prices.
Figure 7 and Figure 8 indicate the model performance for both training data and testing data which confirmed that our model is a prosperous tool for stock price forecasting. The results of the testing model and model matching are displayed in Figure 9, Figure 10 and Figure 11 which are so satisfactory and adequate.
Table 12, Table 13, Table 14, Table 15, Table 16, Table 17, Table 18, Table 19, Table 20, Table 21, Table 22 and Table 23 show the final signals of ABC-ANFIS-SVM model, which will offer trading signals to investors and financial analysts after calculating technical indicators and accurate stock price forecasts. These tables are provided as examples for the 12 largest American companies for the validation and verification of the presented model. Consequently, all the signals are approved according to the period of a particular transaction.
Table 12. The final signal obtained from ABC-ANFIS-SVM (Example 1).
Table 13. The final signal obtained from ABC-ANFIS-SVM (Example 2).
Table 14. The final signal obtained from ABC-ANFIS-SVM (Example 3).
Table 15. The final signal obtained from ABC-ANFIS-SVM (Example 4).
Table 16. The final signal obtained from ABC-ANFIS-SVM (Example 5).
Table 17. The final signal obtained from ABC-ANFIS-SVM (Example 6).
Table 18. The final signal obtained from ABC-ANFIS-SVM (Example 7).
Table 19. The final signal obtained from ABC-ANFIS-SVM (Example 8).
Table 20. The final signal obtained from ABC-ANFIS-SVM (Example 9).
Table 21. The final signal obtained from ABC-ANFIS-SVM (Example 10).
Table 22. The final signal obtained from ABC-ANFIS-SVM (Example 11).
Table 23. The final signal obtained from ABC-ANFIS-SVM (Example 12).

5. Conclusions

In this paper, a new approach for the stock price forecasting was created by integrating ABC, ANFIS, and SVM to more precisely predict the stock prices. Forecasting the trends of activities of the stock price is crucial for the progress of efficient investment policies. In this investigation, we have integrated the ABC-ANFIS into the SVM forecasting model to optimize the technical indicators. We have tried with ABC-ANFIS-SVM to achieve an approximation of the topmost attainable accuracy and quality for stock price forecasting. With the purpose to analyze the ABC-ANFIS-SVM, we employed it on stock price data of the U.S. Stock Exchange from 2008 to 2018, which has been applied as the case study. Twenty technical indicators were employed in our model as input variables.
To display the functionality and superiority of the model, five criteria were examined. After examining the experimental results, we unmistakably have noticed that the presented approach is designed to simulate the active unpredictable stock markets efficiently, which produces a more accurate and high-quality model as compared with other methods. It is obvious that the outcomes authenticate that the novel approach substantially boosts the reliability of the ABC-ANFIS-SVM model. In fact, our approach is the first hybrid model that combines three modules ABC, ANFIS, and SVM together with performance evaluation by the criteria of accuracy and quality. It implies that the model has lesser diversions between forecasted and observed prices than the other methods. Furthermore, the output signals confirmed that the twenty selected technical indicators were absolutely appropriate and comprehensive. The key advantages of our model include enhancing speed and precision in computation, reaching the most optimal technical indicators and the ability to obtain an active strategy to invest in the stock exchange and portfolio building. In future works, the presented model can be further studied by using other soft computing methods or by attaching other techniques or additional input variables. Additionally, the model can be employed for other financial markets.
The computational analysis has revealed that ABC-ANFIS-SVM is the most efficient approach for stock price forecasting and it could be employed in other challenges associated with financial predicting. From the point of view of the authors, the overall functionality of the presented model in the stock price forecasting works better than related studies in the previous investigations. Nevertheless, the function of our model may be developed by two ideas. Firstly, by setting the model parameters by running more sensitive and extensive variables adjustment, which can be subsequent articles for research workers. Secondly, the supplementary or alternative variables can be used as inputs of the model, for instance: foreign exchange rates, interest rates, and many others.
According to the results of the model evaluation and its performance, we conclude that the investigation aims have been achieved. Even so, we are encountered with two limitations about forces that move stock prices. Besides the technical factors, there are two other important factors that can affect stock prices: (1) Fundamental factors and (2) market sentiment. Our model can be improved considerably by taking into account these two items. In our future work, we intend to take into account these items and will present a newer model.
The unique attributes of this work:
  • Proposing a novel efficient hybrid model based on ABC, ANFIS, and SVM
  • Applying the comprehensive and major technical indicators
  • Multi-objective optimization of technical indicators
Ultimately, we summarize the key outcomes of the article in the following cases:
  • This study indicates that the challenge of stock price forecasting can be solved by employing ABC-ANFIS-SVM.
  • This study indicates that the forecasting accuracy and reliability of the ABC-ANFIS-SVM is more accurate than the other models.
  • This study indicates the strength of the ABC-ANFIS-SVM model by comparing its predicting quality with different methods.

Author Contributions

M.S., Writing—Original Draft Preparation, Conceptualization, Software, Writing—Review & Editing, Methodology, Formal Analysis; H.J., Project Administration, Visualization; M.G., Data Curation, Investigation, Validation; S.F.F., Supervision, Resources.

Funding

This research received no external funding.

Acknowledgments

The authors thank Mehdi Sedighi from University of Qom, Iran, and Majid Mohammadi from Qom University of Technology, Iran, for worthwhile discussions and cooperation.

Conflicts of Interest

The authors declare no conflict of interest.

Abbreviations

The following abbreviations are used in this manuscript:
NNNeural Network
ANNArtificial Neural Networks
BPNNBack-Propagation Neural Networks
TDNNTime Delay Neural Networks
RNNRecurrent Neural Networks
PNNProbabilistic Neural Networks
ARIMAAutoregressive Integrated Moving Average
CBRCase-Based Reasoning
TSKTakagi–Sugeno–Kang
SVRSupport Vector Regression
MLPMulti-Layer Perceptron
SOFMSelf-Organizing Feature Map
SOM-NNSelf-Organizing Map Neural Networks
ICAIndependent Component Analysis
CDPACumulative Probability Distribution Approach
GAGenetic Algorithm
RSTRough Sets Theory
MEPAEntropy Principle Approach
PSOParticle Swarm Optimization
FA-MSVRMulti-Output Support Vector Regression Firefly Algorithm
BNNMASBat-Neural Network Multi-Agent System
GANNGenetic Algorithm Neural Network
GRNNGeneralized Regression Neural Network
NASDAQNational Association of Securities Dealers Automated Quotations (American Stock Exchange)
DAXDeutscher Aktienindex (German Stock Index)
KOSPIKorea Composite Stock Price Index
TOPIXTokyo Stock Price Index
SFM-RNState Frequency Memory Recurrent Network
QGGABC-FFNNQuick Gbest Guided Artificial Bee Colony - Feedforward Neural Network
WANFISWavelet-Adaptive Network-Based Fuzzy Inference System
HMMHidden Markov Mode
DABCDirected Artificial Bee Colony Algorithm
MDAMultiple Discriminant Analysis
LIBSVMLibrary For Support Vector Machines
MSEMean Squared Error
MAPEMean Absolute Percentage Error
MAEMean Absolute Error
RMSERoot Mean Square Error

Appendix A

Table A1. The 50 Largest American Companies on the Stock Market.
Table A1. The 50 Largest American Companies on the Stock Market.
1Apple Inc26Boeing Co
2Microsoft Corp27Coca-Cola Co
3Amazon.com Inc28Comcast Corp
4Alphabet Inc29Oracle Corp
5Facebook Inc30PepsiCo Inc
6Berkshire Hathaway Inc31Netflix Inc
7Johnson & Johnson32Citigroup Inc
8Exxon Mobil Corp33Mcdonald’s Corp
9Visa Inc34Abbott Laboratories
10JPMorgan Chase & Co35Philip Morris International Inc
11Walmart Inc36Nike Inc
12Bank of America Corp37Eli Lilly and Co
13Procter & Gamble Co38Adobe Inc
14Intel Corp39International Business Machines Corp
15Cisco Systems Inc40PayPal Holdings Inc
16Mastercard Inc41Salesforce.Com Inc
17Verizon Communications Inc42AbbVie Inc
18UnitedHealth Group Inc433M Co
19Chevron Corp44Broadcom Inc
20Pfizer Inc45Amgen Inc
21AT&T Inc46Union Pacific Corp
22Home Depot Inc47Accenture PLC
23Wells Fargo & Co48Medtronic PLC
24Walt Disney Co49Honeywell International Inc
25Merck & Co Inc50NVIDIA Corp
Table A2. Theil’s U Interpretation.
Table A2. Theil’s U Interpretation.
LevelConcept
<1The predicting approach is superior to estimation.
1The predicting approach is equivalent to estimation.
>1The predicting approach is weaker than estimation.

References

  1. Tsang, P.M.; Kwok, P.; Choy, S.O.; Kwan, R.; Ng, S.C.; Mak, J.; Tsang, J.; Koong, K.; Wong, T.L. Design and implementation of NN5 for Hong Kong stock price forecasting. Eng. Appl. Artif. Intell. 2007, 20, 453–461. [Google Scholar] [CrossRef]
  2. Ritchie, J.C. Fundamental Analysis: A Back-to-the-Basics Investment Guide to Selecting Quality Stocks; Irwin Professional Pub: Burr Ridge, IL, USA, 1996. [Google Scholar]
  3. Murphy, J.J. Technical Analysis of the Financial Markets: A Comprehensive Guide to Trading Methods and Applications; Penguin: London, UK, 1999. [Google Scholar]
  4. Box, G.E.; Jenkins, G.M. Time Series Analysis: Forecasting and Control San Francisco; Holden-Day: San Francisco, CA, USA, 1976. [Google Scholar]
  5. Karaboga, D.; Basturk, B. On the performance of artificial bee colony (ABC) algorithm. Appl. Soft Comput. 2008, 8, 687–697. [Google Scholar] [CrossRef]
  6. Kim, J.; Kasabov, N. HyFIS: Adaptive neuro-fuzzy inference systems and their application to nonlinear dynamical systems. Neural Netw. 1999, 12, 1301–1319. [Google Scholar] [CrossRef]
  7. Sharma, M.; Sharma, S.; Singh, G. Performance Analysis of Statistical and Supervised Learning Techniques in Stock Data Mining. Data 2018, 3, 54. [Google Scholar] [CrossRef]
  8. Chapelle, O.; Vapnik, V.; Bousquet, O.; Mukherjee, S. Choosing multiple parameters for support vector machines. Mach. Learn. 2002, 46, 131–159. [Google Scholar] [CrossRef]
  9. Kimoto, T.; Asakawa, K.; Yoda, M.; Takeoka, M. Stock market prediction system with modular neural networks. In Proceedings of the 1990 IJCNN International Joint Conference on Neural Networks, San Diego, CA, USA, 17–21 June 1990; pp. 1–6. [Google Scholar]
  10. Kamijo, K.-I.; Tanigawa, T. Stock price pattern recognition-a recurrent neural network approach. In Proceedings of the 1990 IJCNN International Joint Conference on Neural Networks, San Diego, CA, USA, 17–21 June 1990; pp. 215–221. [Google Scholar]
  11. Yoon, Y.; Swales, G. Predicting stock price performance: A neural network approach. In Proceedings of the Twenty-Fourth Annual Hawaii International Conference on System Sciences, Kauai, HI, USA, 8–11 January 1991; pp. 156–162. [Google Scholar]
  12. Baba, N.; Kozaki, M. An intelligent forecasting system of stock price using neural networks. In Proceedings of the 1992 IJCNN International Joint Conference on Neural Networks, Baltimore, MD, USA, 7–11 June 1992; pp. 371–377. [Google Scholar]
  13. Cheung, Y.-M.; Lai, H.Z.; Xu, L. Application of adaptive RPCL-CLP with trading system to foreign exchange investment. In Proceedings of the International Conference on Neural Networks (ICNN’96), Washington, DC, USA, 3–6 June 1996; pp. 131–136. [Google Scholar]
  14. Saad, E.W.; Prokhorov, D.V.; Wunsch, D.C. Comparative study of stock trend prediction using time delay, recurrent and probabilistic neural networks. IEEE Trans. Neural Netw. 1998, 9, 1456–1470. [Google Scholar] [CrossRef]
  15. Takahashi, T.; Tamada, R.; Nagasaka, K. Multiple line-segments regression for stock prices and long-range forecasting system by neural network. In Proceedings of the 37th SICE Annual Conference. International Session Papers, Chiba, Japan, 29–31 July 1998; pp. 1127–1132. [Google Scholar]
  16. Kim, K.-J. Financial time series forecasting using support vector machines. Neurocomputing 2003, 55, 307–319. [Google Scholar] [CrossRef]
  17. Pai, P.-F.; Lin, C.-S. A hybrid ARIMA and support vector machines model in stock price forecasting. Omega 2005, 33, 497–505. [Google Scholar] [CrossRef]
  18. Manish, K.; Thenmozhi, M. Forecasting stock index movement: A comparison of support vector machines and random forest. In Proceedings of the Ninth Indian Institute of Capital Markets Conference, Mumbai, India, 19–20 December 2005. [Google Scholar]
  19. Huang, W.; Nakamori, Y.; Wang, S.-Y. Forecasting stock market movement direction with support vector machine. Comput. Oper. Res. 2005, 32, 2513–2522. [Google Scholar] [CrossRef]
  20. Kumar, M.; Thenmozhi, M. Support vector machines approach to predict the S&P CNX NIFTY index returns. SSRN Electron. J. 2007. [Google Scholar] [CrossRef]
  21. Chang, P.-C.; Liu, C.-H. A TSK type fuzzy rule based system for stock price prediction. Expert Syst. Appl. 2008, 34, 135–144. [Google Scholar] [CrossRef]
  22. Ince, H.; Trafalis, T.B. Short term forecasting with support vector machines and application to stock price prediction. Int. J. Gen. Syst. 2008, 37, 677–687. [Google Scholar] [CrossRef]
  23. Huang, C.-L.; Tsai, C.-Y. A hybrid SOFM-SVR with a filter-based feature selection for stock market forecasting. Expert Syst. Appl. 2009, 36, 1529–1539. [Google Scholar] [CrossRef]
  24. Hsu, S.-H.; Hsieh, J.P.-A.; Chih, T.-C.; Hsu, K.-C. A two-stage architecture for stock price forecasting by integrating self-organizing map and support vector regression. Expert Syst. Appl. 2009, 36, 7947–7951. [Google Scholar] [CrossRef]
  25. Atsalakis, G.S.; Valavanis, K.P. Surveying stock market forecasting techniques–Part II: Soft computing methods. Expert Syst. Appl. 2009, 36, 5932–5941. [Google Scholar] [CrossRef]
  26. Atsalakis, G.S.; Valavanis, K.P. Surveying stock market forecasting techniques-Part I: Conventional methods. J. Comput. Optim. Econ. Financ. 2010, 2, 45–92. [Google Scholar]
  27. Liang, X.; Zhang, H.; Xiao, J.; Chen, Y. Improving option price forecasts with neural networks and support vector regressions. Neurocomputing 2009, 72, 3055–3065. [Google Scholar] [CrossRef]
  28. Hadavandi, E.; Shavandi, H.; Ghanbari, A. Integration of genetic fuzzy systems and artificial neural networks for stock price forecasting. Knowl. Based Syst. 2010, 23, 800–808. [Google Scholar] [CrossRef]
  29. Lu, C.-J. Integrating independent component analysis-based denoising scheme with neural network for stock price prediction. Expert Syst. Appl. 2010, 37, 7056–7064. [Google Scholar] [CrossRef]
  30. 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]
  31. Kara, Y.; Boyacioglu, M.A.; Baykan, Ö.K. Predicting direction of stock price index movement using artificial neural networks and support vector machines: The sample of the Istanbul Stock Exchange. Expert Syst. Appl. 2011, 38, 5311–5319. [Google Scholar] [CrossRef]
  32. Svalina, I.; Galzina, V.; Lujić, R.; ŠImunović, G. An adaptive network-based fuzzy inference system (ANFIS) for the forecasting: The case of close price indices. Expert Syst. Appl. 2013, 40, 6055–6063. [Google Scholar] [CrossRef]
  33. Wei, L.-Y. A hybrid model based on ANFIS and adaptive expectation genetic algorithm to forecast TAIEX. Econ. Model. 2013, 33, 893–899. [Google Scholar] [CrossRef]
  34. Chen, S.-M.; Kao, P.-Y. TAIEX forecasting based on fuzzy time series, particle swarm optimization techniques and support vector machines. Inf. Sci. 2013, 247, 62–71. [Google Scholar] [CrossRef]
  35. Xiong, T.; Bao, Y.; Hu, Z. Multiple-output support vector regression with a firefly algorithm for interval-valued stock price index forecasting. Knowl. Based Syst. 2014, 55, 87–100. [Google Scholar] [CrossRef]
  36. Hafezi, R.; Shahrabi, J.; Hadavandi, E. A bat-neural network multi-agent system (BNNMAS) for stock price prediction: Case study of DAX stock price. Appl. Soft Comput. 2015, 29, 196–210. [Google Scholar] [CrossRef]
  37. Khuat, T.T.; Le, Q.C.; Nguyen, B.L.; Le, M.H. Forecasting Stock Price using Wavelet Neural Network Optimized by Directed Artificial Bee Colony Algorithm. J. Telecommun. Inf. Technol. 2016, 2, 43–52. [Google Scholar]
  38. Pyo, S.; Lee, J.; Cha, M.; Jang, H. Predictability of machine learning techniques to forecast the trends of market index prices: Hypothesis testing for the Korean stock markets. PLoS ONE 2017, 12, e0188107. [Google Scholar] [CrossRef]
  39. Preethi, G.; Santhi, B. Stock Market Forecasting Techniques: A Survey. J. Theor. Appl. Inf. Technol. 2012, 46, 24–30. [Google Scholar]
  40. Zhang, L.; Aggarwal, C.; Qi, G.-J. Stock price prediction via discovering multi-frequency trading patterns. In Proceedings of the 23rd ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, Halifax, NS, Canada, 13–17 August 2017; ACM: New York, NY, USA, 2017; pp. 2141–2149. [Google Scholar]
  41. Nguyen, N. An Analysis and Implementation of the Hidden Markov Model to Technology Stock Prediction. Risks 2017, 5, 62. [Google Scholar] [CrossRef]
  42. Nguyen, N. Hidden Markov Model for Stock Trading. Int. J. Financ. Stud. 2018, 6, 36. [Google Scholar] [CrossRef]
  43. Shah, H.; Tairan, N.; Garg, H.; Ghazali, R. A quick gbest guided artificial bee colony algorithm for stock market prices prediction. Symmetry 2018, 10, 292. [Google Scholar] [CrossRef]
  44. Dinh, T.-A.; Kwon, Y.-K. An empirical study on importance of modeling parameters and trading volume-based features in daily stock trading using neural networks. In Informatics; Multidisciplinary Digital Publishing Institute: Basel, Switzerland, 2018; p. 36. [Google Scholar]
  45. Chandar, S.K. Fusion model of wavelet transform and adaptive neuro fuzzy inference system for stock market prediction. J. Ambient Intell. Humaniz. Comput. 2019, 1–9. [Google Scholar] [CrossRef]
  46. Khashei, M.; Bijari, M.; Ardali, G.A.R. Improvement of auto-regressive integrated moving average models using fuzzy logic and artificial neural networks (ANNs). Neurocomputing 2009, 72, 956–967. [Google Scholar] [CrossRef]
  47. Karaboga, D. An. Idea Based on Honey Bee Swarm for Numerical Optimization; Technical report-tr06; Erciyes University: Erciyes, Turkey, 2005. [Google Scholar]
  48. Jang, J.-S. ANFIS: Adaptive-network-based fuzzy inference system. IEEE Trans. Syst. Man Cybern. 1993, 23, 665–685. [Google Scholar] [CrossRef]
  49. Nayak, P.C.; Sudheer, K.; Rangan, D.; Ramasastri, K. A neuro-fuzzy computing technique for modeling hydrological time series. J. Hydrol. 2004, 291, 52–66. [Google Scholar] [CrossRef]
  50. Vapnik, V.N. The Nature of Statistical Learning Theory; Springer: Berlin/Heidelberg, Germany, 1995. [Google Scholar]
  51. Khemchandani, R.; Chandra, S. Optimal kernel selection in twin support vector machines. Optim. Lett. 2009, 3, 77–88. [Google Scholar] [CrossRef]
  52. Khemchandani, R.; Chandra, S. Knowledge based proximal support vector machines. Eur. J. Oper. Res. 2009, 195, 914–923. [Google Scholar] [CrossRef]
  53. Theil, H. Economic Forecasts and Policy; North-Holland Publishing Company: Amsterdam, The Netherlands, 1958. [Google Scholar]
  54. Theil, H. Applied Economic Forecasting; Rand-McNally: Chicago, IL, USA, 1966. [Google Scholar]
  55. Sedighi, M.; Jahangirnia, H.; Gharakhani, M. A New Efficient Metaheuristic Model for Stock Portfolio Management and its Performance Evaluation by Risk-adjusted Methods. Int. J. Financ. Manag. Account. 2019, 3, 63–77. [Google Scholar]
  56. Alizadeh, M.; Gharakhani, M.; Fotoohi, E.; Rada, R. Design and analysis of experiments in ANFIS modeling for stock price prediction. Int. J. Ind. Eng. Comput. 2011, 2, 409–418. [Google Scholar] [CrossRef]
  57. Chang, C.-C.; Lin, C.-J. LIBSVM: A library for support vector machines. ACM Trans. Intell. Syst. Technol. 2011, 2, 27. [Google Scholar] [CrossRef]

Article Metrics

Citations

Article Access Statistics

Multiple requests from the same IP address are counted as one view.