Next Article in Journal
Ensemble Based Classification of Sentiments Using Forest Optimization Algorithm
Next Article in Special Issue
Treasury Bond Return Data Starting in 1962
Previous Article in Journal
A Study on Visual Representations for Active Plant Wall Data Analysis
Previous Article in Special Issue
A Business Rules Management System for Fixed Assets
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

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

by
Mojtaba Sedighi
1,2,*,
Hossein Jahangirnia
3,
Mohsen Gharakhani
4 and
Saeed Farahani Fard
5
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
5
Department of Management and Economics, University of Qom, Qom 3716146611, Iran
*
Author to whom correspondence should be addressed.
Submission received: 2 May 2019 / Revised: 19 May 2019 / Accepted: 20 May 2019 / Published: 22 May 2019
(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.

2. Related Works

Due to the importance of stock price forecasting, many researchers have studied this matter. Recently, there have been an increasing number of scientific researches presenting the forecasting models for future trends of different types of securities. In the following, we concentrate on the review of former investigations in line with this topic.
The first paper dealing with this subject, by Kimoto, Asakawa et al. [9], utilized modular NN to forecast the timing of buying or selling for the TOPIX. The outcomes demonstrated that a great profit was attained.
Kamijo and Tanigawa [10] improved a style identification method to forecast the stock prices in the Tokyo stock market. Their approach has been introduced to examine the recurrent networks to reduce the mismatching forms.
Yoon and Swale [11] offered a four-layered NN to forecast stock prices in the USA. The outcomes demonstrated that their technique works better than the MDA procedure.
Baba and Kozaki [12] suggested the BPNN method along with a random optimization strategy to forecast stock exchange in Japan. The outcomes confirmed that their method assisted to stock price forecasting.
Cheung, Lai et al. [13] applied an adaptive rival penalized competitive learning approach and a combined linear forecasting model to predict both the Shanghai stock and the US Dollar to the German exchange rate. The outcomes verified that their method enhanced profits along with time.
Saad, Prokhorov et al. [14] performed comparison research of TDNN, PNN, and RNN in forecasting daily closing prices in stock exchanges. The outcomes demonstrated that all networks are equally achievable but the simplest network is more suitable.
Takahashi, Tamada et al. [15] suggested a NN that embodied a multiple line-segments regression method to forecast stock prices. The tangent and length of multiple line-segments regression were determined as outputs of the NN neural networks. The outcomes demonstrated that their method worked properly in stock price predicting.
Kim [16] utilized SVM to forecast the trend of daily stock price alterations in the KOSPI. This research chose twelve technical indicators to design primary features and then assessed the possibility of implementing SVM in the financial forecast by comparing it with BPN and CBR. The outcomes verified that SVM works better than BPN and CBR.
Pai and Lin [17] utilized the advantages of the ARIMA and SVM to improve a hybrid method. The ARIMA approach utilized to design the linear dataset, while the SVMs were used to manage the nonlinear information pattern in time series predicting. Their outcomes revealed that their introduced strategy can noticeably improve the predicting capabilities of the single ARIMA or SVM model.
Manish and Thenmozhi [18] utilized SVM and random forest to forecast the daily volatility of trend of S&P CNX NIFTY Market Index of the National Stock Exchange and compared the outcomes with the traditional discriminant and logit methods and ANN. They utilized the same technical indicators as input factors which used by Kim (2003). The outcomes revealed that SVM operate better than random forest, artificial neural network (ANN), and other traditional methods.
Huang, Nakamori et al. [19] examined the predictability of financial changes trend with SVM by forecasting the weekly changes trend of NIKKEI 225 Index. To examine the forecast capability of SVM, they contrasted its functionality with the linear discriminant analysis, quadratic discriminant analysis and BPNN. The outcomes indicated that SVM works better than the other approaches.
Kumar and Thenmozhi [20] presented the SVM method to forecasting the S&P CNX NIFTY Index returns. They utilized the different criteria to evaluate the functionality of the SVM model and finally observed that the SVM method obtained higher precision and quality in comparison with other methods.
Chang and Liu [21] offered a TSK type fuzzy rule-based system to deal with stock price predicting troubles. They applied stepwise regression to examine and choose technical indicators which are more important to the stock price. Their offered method was examined on the Taiwan Stock Market and the outcomes outperformed other strategies and multiple regression analysis.
Ince and Trafalis [22] suggested a method for stock price predicting by two techniques, depending on the presumption which the upcoming value of a stock price relies on its technical indicators. The investigations were performed on the daily stock prices of the ten firms exchanged on the NASDAQ. The outcomes demonstrated that the SVR method generated more desirable achievements compared to the MLPN for short-term forecast concerning the MSE. Besides, they concluded that If the risk premium is utilized as a comparison measure, then the SVR method is as good as the MLP approach or better.
Huang and Tsai [23] presented a hybrid method utilizing filter-based feature selection, SOFM, and SVR, as a way to predict the stock price. Firstly, the filter-based feature selection was utilized to figure out crucial input technical indicators. After that, the SOFM was employed to cluster the training data into a number of disjointed clusters in ways that the components in every cluster are analogous. Lastly, the SVR was utilized to build an individual predicting approach for every cluster. Their approach was showed via a case study on predicting the price of next day in the Taiwan stock exchange and the outcomes demonstrated that their strategy can enhance predicting precision and decrease the training time over the traditional single SVR.
Hsu, Hsieh et al. [24] improved the two-phase structure by combining a self-organizing map and SVR for stock price forecasting. They analyzed seven main stock market indices. The outcomes indicated that their method presents a successful substitute for stock price forecasting.
Atsalakis and Valavanis [25,26] reviewed the related papers which working with techniques for stock market forecasting. In part I, they reviewed the conventional methods and in part II, the soft computing approaches were researched.
Liang, Zhang et al. [27] introduced a two-phase method to develop option price predicting by utilizing NN and SVR. In their research, NNs and SVRs were utilized to carry out nonlinear curve approximation to more decrease the predicting errors. Their method was revealed by tests on the information taken from the Hong Kong stock exchange. The outcomes indicated that the NN and SVR methods could substantially decrease the average predict errors, therefore increasing the predicting precision.
Hadavandi, Shavandi et al. [28] suggested a hybrid strategy by combining stepwise regression analysis, ANN, and genetic fuzzy systems. Firstly, they utilized the stepwise regression analysis to choose variables which could considerably impact stock prices. Then a SOM-NN was utilized to divide the real information into many clusters in ways wherein the components in every cluster are more uniform. Ultimately, information in every cluster was given into a genetic fuzzy system for stock price prediction. Their method was revealed via a test on predicting the closing prices of the next day for two IT companies and two airlines, and outcomes demonstrated that the recommended method performs better than other prior procedures.
Lu [29] offered a stock price predicting strategy by utilizing ICA and BPN. The ICA was utilized to the forecasting factors and the filtered predicting factors acted as the input factors of the BPN to create the predicting model. Their strategy was revealed by a case study on predicting the TAIEX closing cash and Nikkei 225 opening cash indicators. The outcomes showed that their strategy operates superior to the integrated wavelet-BPN model, the BPN model without filtered predicting factors, and the random walk model.
Cheng, Chen et al. [30] applied the CDPA, MEPA, RST, and GA to improve a hybrid method for stock price predicting. The CDPA and MEPA were implemented to partition technical indicator values and RST was implemented to produce linguistic rules. Ultimately, the GA was implemented to improve the rules. Their technique was approved by a case study on predicting the TAIEX.
Kara, Boyacioglu et al. [31] tried to improve two models which are based on the ANN and SVM. Ten technical indicators and daily stock price for the ISE National 100 Index were chosen to evaluate the model functionality. The outcomes demonstrated that the ANN method performs better than the SVM method. Their study also both the ANN and SVM methods revealed considerable functionality in the forecasting the trends of the stock price.
Svalina, Galzina et al. [32] were utilized ANFIS to forecast the closing stock price of the Zagreb Stock Exchange. The authors utilized information during the years 2010 to 2012. Their method forecast the close price for CRO in the five upcoming days. It was revealed that the forecasts have enhanced their errors for each day ahead.
Wei [33] presented a hybrid method utilizing GA and ANFIS for stock price forecasting. The method has been evaluated by RMSE during the six-year period of the TAIEX. The outcomes indicated that the method functioned better than the other three methods.
Chen and Kao [34] offered a hybrid PSO-SVM method with fuzzy time series. They demonstrated that their method works better than conventional approaches for stock market prediction.
Xiong, Bao et al. [35] presented a new hybrid method called FA-MSVR which utilized to predicting the three internationally traded market indexes including the S&P 500, the FTSE 100, and the Nikkei 225. The outcomes demonstrated that their method worked better than counterparts and it was a favorable substitute for predicting interval-valued financial time series.
Hafezi, Shahrabi et al [36] offered a novel smart model in a multi-agent structure named the BNNMAS for stock price forecasting. The model worked in a four-layer multi-agent structure to forecast eight years of DAX stock price. The ability of their method is examined by utilizing fundamental and technical DAX stock price information and compared the results with the various other approaches, for instance, GANN and GRNN, and so on. Their outcomes indicated that the BNNMAS works precisely and reliably, and therefore it is an appropriate method for stock price forecasting, particularly in long-time intervals.
Khuat, Le et al. [37] presented a method for stock price forecasting based on Haar wavelet transform and ANN which optimized by DABC. The method was examined on the historical price information for various corporations. The outcome was favorable that it could help the stock traders efficiently.
Pyo, Lee et al. [38] investigated the movements of the KOSPI 200 prices applying the ANN and SVM. Their outcomes proved the instability and high variability of machine-learning approaches on market predictions that are explained in [39] and various other studies, by way of hypothesis tests utilizing the KOSPI 200 index market.
Zhang, Aggarwal et al. [40] presented a new SFM-RN to record the multi-frequency exchanging templates from past market information to get a long-run and short-run forecasts. In their study, the future stock prices are forecasted as a nonlinear mapping of the composition of the elements in an Inverse Fourier Transform (IFT) fashion. The findings on the actual market information revealed more competitive capabilities by the SFM versus the state-of-the-art approaches.
Nguyen [41] employed the Hidden Markov Model (HMM), to forecast a daily stock price of three dynamic stocks—Apple, Google, and Facebook—depending on their historical information. Thus, the models to forecast close prices of these stocks applying single observation information and multiple observation information have utilized. This study utilized the forecasts as signals for stock dealing. The outcomes revealed that the HMM functioned better than the naïve approach in stock price predicting. Furthermore, the outcomes revealed that active dealers applying HMM obtained a higher return compared to applying the naïve predict for Facebook and Google stocks.
In another paper, Nguyen [42] presented the application of HMM in stocks dealing depending on the stock price forecasting. The process begins by employing four metrics as a way to identify an optimal number of states for the HMM. Next, it was utilized to forecast the monthly closing prices of the S&P 500 index. The outcomes obviously confirmed that the HMM operated more desirably than the traditional approach in the stocks dealing and forecasting.
Shah, Tairan et al. [43] offered a method named QGGABC-FFNN that depended on the ABC and NN to reduce the error in the stock price forecasting. Their method has been confirmed and examined to forecast the precise trend of Saudi Stock Market. The outcomes indicated that the QGGABC-FFNN works better than typical computational algorithms.
Dinh and Kwon [44] presented a developed technique for the stock price forecasting by taking into account the limitations and then created input variables by considering price and volume data. They also determined three modeling parameters: the input and the target window sizes and the profit threshold which the underlying functions are learned by multilayer perceptrons and the SVM. They examined their method by 6 stocks for 15 years and the expected functionality by the considered parameters were compared. Their method considerably enhanced the forecast precision more than the expected functionality and also the outcomes indicated that the method provided more stable profitability than other strategies.
Chandar [45] proposed a new hybrid method called WANFIS, which employed on past information of several firms. The outcomes demonstrated that the method received higher precision of the prediction compared to other methods.
After investigating the past studies, 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.
As mentioned, in the past scientific research, many models have been presented to predict stock prices, but each of the models presented in the previous researches has different advantages and disadvantages. With this in mind, we plan to improve the disadvantages of the previous models and fix their problems as much as possible.
In this paper, we intend to provide a robust and efficient hybrid model based on ABC, ANFIS, and SVM without human interference. Employing hybrid models or integrating numerous models has become a universal technique to enhance forecasting accuracy and the literature on this matter has extended noticeably [46].

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.

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 )
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.
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.

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).
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.
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.
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.
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 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.
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.

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] [Green Version]
  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] [Green Version]
  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]
Figure 1. Flowchart of the Artificial Bee Colony (ABC).
Figure 1. Flowchart of the Artificial Bee Colony (ABC).
Data 04 00075 g001
Figure 2. Adaptive Neuro-Fuzzy Interference System (ANFIS) Structure.
Figure 2. Adaptive Neuro-Fuzzy Interference System (ANFIS) Structure.
Data 04 00075 g002
Figure 3. Support Vector Machine (SVM) Structure.
Figure 3. Support Vector Machine (SVM) Structure.
Data 04 00075 g003
Figure 4. Proposed Model.
Figure 4. Proposed Model.
Data 04 00075 g004
Figure 5. Samples of forecasted and observed prices for each year.
Figure 5. Samples of forecasted and observed prices for each year.
Data 04 00075 g005
Figure 6. Performance Evaluation of ABC-ANFIS-SVM.
Figure 6. Performance Evaluation of ABC-ANFIS-SVM.
Data 04 00075 g006
Figure 7. Model Fit (Training Data).
Figure 7. Model Fit (Training Data).
Data 04 00075 g007
Figure 8. Model Fit (Testing Data).
Figure 8. Model Fit (Testing Data).
Data 04 00075 g008
Figure 9. Model Matching Results (No. 1).
Figure 9. Model Matching Results (No. 1).
Data 04 00075 g009
Figure 10. Model Matching Results (No. 2).
Figure 10. Model Matching Results (No. 2).
Data 04 00075 g010
Figure 11. Model Testing Results
Figure 11. Model Testing Results
Data 04 00075 g011
Table 1. List of Selected Technical Indicators.
Table 1. List of Selected Technical Indicators.
No.IndicatorTypeClass
1Absolute Price Oscillator (APO)TrendOscillator
2Accumulation Distribution (AD)VolumeCumulative
3Average Directional Movement (ADX)TrendIndex
4Average True Range (ATR)VolatilityIndex
5Bollinger Bands (BBANDS)VolatilityOverlay
6Chande Momentum Oscillator (CMO)MomentumOscillator
7Commodity Channel Index (CCI)MomentumOscillator
8Directional Movement Index (DMI)TrendIndex
9Fast StochasticMomentumOscillator
10Fibonacci ArcSupport and ResistanceOverlay
11Fibonacci FanSupport and ResistanceOverlay
12Fibonacci RetracementSupport and ResistanceOverlay
13Fibonacci Time ZonesSupport and ResistanceOverlay
14Moving Average Convergence Divergence (MACD)TrendOscillator
15On Balance Volume (OBV)VolumeCumulative
16Parabolic Stop and Reverse (SAR)TrendOverlay
17Rate of Change (ROC)MomentumOscillator
18Relative Strength Index (RSI)MomentumOscillator
19Volume Oscillator (VO)VolumeOscillator
20Williams %RMomentumOscillator
Table 2. Training and Testing Data.
Table 2. Training and Testing Data.
Training DataObservationsTesting DataObservations
FromToFromTo
31 Jan 200831 Dec 200954431 Dec 200931 Dec 2010136
31 Dec 201031 Dec 201163631 Dec 201131 Dec 2012159
31 Dec 201231 Dec 201370431 Dec 201131 Dec 2014176
31 Dec 201431 Dec 201583231 Dec 201531 Dec 2016208
31 Dec 201631 Dec 201799631 Dec 201731 Dec 2018249
Table 3. Parameter Explanation.
Table 3. Parameter Explanation.
ParameterExplanation
Open PriceThe first stock price at the beginning of daily dealing
Close PriceThe last stock price at the end of daily dealing
High PriceThe maximum stock price at the during daily dealing
Low PriceThe minimum stock price at the during daily dealing
Table 4. ABC Parameter Settings.
Table 4. ABC Parameter Settings.
ParameterLevel
Swarm size100
LimitNumber of onlooker bees
Number of Onlookers50% of the swarm
Number of Employed Bees50% of the swarm
Number of Scouts1
Maximum Cycle3000
Table 5. SVM Parameter Settings.
Table 5. SVM Parameter Settings.
ParameterLevel
Degree of kernel function1, 2, 3, 4
Gamma in kernel function0, 0.1, 0.2, …, 5
Regularization parameter1, 10, 100
Table 6. The outcomes of key indexes (U.S. SE) in terms of RMSE.
Table 6. The outcomes of key indexes (U.S. SE) in terms of RMSE.
RMSE
20082009201020112012201320142015201620172018
DOW 301.96351.74151.25881.00720.91520.82530.81450.74950.68240.13740.1072
NASDAQ 1001.84051.86731.45681.24750.93140.96520.87520.75100.67250.10490.0641
S&P 5001.72511.74251.53251.32470.92540.08440.74840.71550.66490.04580.0367
Table 7. The outcomes of key indexes (U.S. SE) in terms of MAE.
Table 7. The outcomes of key indexes (U.S. SE) in terms of MAE.
MAE
20082009201020112012201320142015201620172018
DOW 300.00860.00740.01530.01100.02440.01690.02810.03520.03240.01720.0158
NASDAQ 1000.01250.01450.04210.04720.02960.02310.03270.00430.04410.02550.0241
S&P 5000.08370.02100.01680.00880.00720.00530.03450.01140.01470.01250.0014
Table 8. The outcomes of key indexes (U.S. SE) in terms of MAPE.
Table 8. The outcomes of key indexes (U.S. SE) in terms of MAPE.
MAPE (%)
20082009201020112012201320142015201620172018
DOW 300.86420.74350.69410.56380.48250.34760.27240.15860.14350.13250.1272
NASDAQ 1000.81250.71580.65470.54180.42740.35950.26430.16140.14960.13590.1324
S&P 5000.88470.78560.62140.51690.45320.37510.27850.16950.15240.13630.1398
Table 9. The outcomes of key indexes (U.S. SE) in terms of U1.
Table 9. The outcomes of key indexes (U.S. SE) in terms of U1.
U1
20082009201020112012201320142015201620172018
DOW 300.00920.00860.00820.00750.00690.00670.00620.00590.00420.00310.0014
NASDAQ 1000.02010.01150.01470.02240.00770.00690.00560.00480.00370.00240.0018
S&P 5000.01520.00970.01310.00830.00810.00740.00690.00510.00440.00380.0023
Table 10. The outcomes of key indexes (U.S. SE) in terms of U2.
Table 10. The outcomes of key indexes (U.S. SE) in terms of U2.
U2
20082009201020112012201320142015201620172018
DOW 300.01280.01410.01240.01090.00830.00810.00660.00520.00410.00280.0017
NASDAQ 1000.01730.01550.01470.01360.01120.00920.00710.00460.00650.00330.0021
S&P 5000.01690.01650.01620.01410.01010.00950.00790.00750.00540.00370.0025
Table 11. The final outcomes of the model in comparison with other methods.
Table 11. The final outcomes of the model in comparison with other methods.
MethodRMSEMAEMAPE (%)U1U2
ABC-ANFIS-SVM0.00920.00880.72830.00120.0009
ARIMA-SVM1.00210.01422.37690.04890.0324
ABC-SVM0.88640.00981.82370.02720.0256
ABC-ANFIS0.92350.00951.29200.01950.0144
ANFIS-SVM1.89340.01170.94360.01210.0132
ARIMA-ANFIS1.14730.01822.91240.10250.0763
WANFIS [46]0.03780.01361.45150.01960.0056
SVM [45]0.02760.01290.93070.00210.0049
QGGABC-FFNN [44]0.06350.01551.12500.10360.0042
ANN-SVM [39]0.04140.03720.84030.11280.0053
HWT-ANN-DABC [38]0.05260.04361.49370.02550.0071
FA-MSVR [36]0.03870.01301.05330.10720.0178
PSO-SVM [35]0.04430.02271.17140.13690.0144
GA-ANFIS [34]0.07250.03160.93250.01410.0058
ANFIS [33]0.08470.04071.27460.00950.0082
ANN-SVM [32]0.04810.05211.02550.01220.0039
NN-SVR [28]0.05320.03681.03670.00860.0052
SOFM-SVR [24]0.06540.04450.93660.00740.0095
KPCA-SVR [23]0.07930.05040.89410.00980.0077
ARIMA-ANN-SVM [20]0.04490.01720.84520.00590.0086
SVM-RF [18]0.01720.02451.34170.01320.0047
Table 12. The final signal obtained from ABC-ANFIS-SVM (Example 1).
Table 12. The final signal obtained from ABC-ANFIS-SVM (Example 1).
Microsoft Corp
IndicatorValueSignal
RSI82.763Overbought
STOCH72.536Buy
STOCHRSI101.000Overbought
MACD0.671Buy
ADX43.619Buy
Williams %R−3.778Overbought
CCI145.277Buy
ATR0.6043High Volatility
Highs/Lows1.254Buy
Ultimate Oscillator62.808Buy
ROC2.142Buy
Bull/Bear Power2.035Buy
Note: Buy: 8; Sell: 0; Neutral: 0; Final Signal: Strong Buy.
Table 13. The final signal obtained from ABC-ANFIS-SVM (Example 2).
Table 13. The final signal obtained from ABC-ANFIS-SVM (Example 2).
Exxon Mobil
IndicatorValueSignal
RSI40.631Sell
STOCH35.256Sell
STOCHRSI0.000Oversold
MACD−0.020Sell
ADX51.807Buy
Williams %R−92.659Oversold
CCI−128.731Sell
ATR0.346High Volatility
Highs/Lows−0.185Sell
Ultimate Oscillator52.112Buy
ROC−0.114Sell
Bull/Bear Power−0.0600Sell
Note: Buy: 2; Sell: 7; Neutral: 0; Final Signal: Strong Sell.
Table 14. The final signal obtained from ABC-ANFIS-SVM (Example 3).
Table 14. The final signal obtained from ABC-ANFIS-SVM (Example 3).
BHP Group PLC
IndicatorValueSignal
RSI44.272Neutral
STOCH73.881Buy
STOCHRSI92.153Overbought
MACD−7.042Sell
ADX37.850Buy
Williams %R−23.489Buy
CCI83.704Buy
ATR7.258Less Volatility
Highs/Lows2.965Buy
Ultimate Oscillator59.423Buy
ROC0.462Buy
Bull/Bear Power−1.257Sell
Note: Buy: 7; Sell: 2; Neutral: 1; Final Signal: Strong Buy.
Table 15. The final signal obtained from ABC-ANFIS-SVM (Example 4).
Table 15. The final signal obtained from ABC-ANFIS-SVM (Example 4).
Walmart Inc
IndicatorValueSignal
RSI57.117Buy
STOCH45.756Neutral
STOCHRSI0.020Oversold
MACD0.541Buy
ADX14.236Neutral
Williams %R−46.287Neutral
CCI55.763Buy
ATR0.404Less Volatility
Highs/Lows0.005Neutral
Ultimate Oscillator47.624Sell
ROC0.345Buy
Bull/Bear Power0.372Buy
Note: Buy: 5; Sell: 1; Neutral: 4; Final Signal: Strong Buy.
Table 16. The final signal obtained from ABC-ANFIS-SVM (Example 5).
Table 16. The final signal obtained from ABC-ANFIS-SVM (Example 5).
Apple Inc
IndicatorValueSignal
RSI72.445Buy
STOCH80.078Overbought
STOCHRSI91.363Overbought
MACD1.202Buy
ADX54.495Buy
Williams %R−7.114Overbought
CCI99.103Buy
ATR1.605Less Volatility
Highs/Lows0.712Buy
Ultimate Oscillator55.762Buy
ROC2.225Buy
Bull/Bear Power2.189Buy
Note: Buy: 8; Sell: 0; Neutral: 0; Final Signal: Strong Buy.
Table 17. The final signal obtained from ABC-ANFIS-SVM (Example 6).
Table 17. The final signal obtained from ABC-ANFIS-SVM (Example 6).
Facebook Inc
IndicatorValueSignal
RSI51.247Buy
STOCH42.320Neutral
STOCHRSI8.673Oversold
MACD0.299Buy
ADX33.412Sell
Williams %R−40.350Buy
CCI43.931Neutral
ATR0.520Less Volatility
Highs/Lows0.001Neutral
Ultimate Oscillator51.715Buy
ROC−0.482Sell
Bull/Bear Power0.325Buy
Note: Buy: 5; Sell: 2; Neutral: 3; Final Signal: Buy.
Table 18. The final signal obtained from ABC-ANFIS-SVM (Example 7).
Table 18. The final signal obtained from ABC-ANFIS-SVM (Example 7).
Amazon Inc
IndicatorValueSignal
RSI58.431Buy
STOCH51.572Neutral
STOCHRSI43.215Sell
MACD1.507Buy
ADX32.725Buy
Williams %R−39.439Buy
CCI69.247Buy
ATR3.234Less Volatility
Highs/Lows0.005Neutral
Ultimate Oscillator51.734Buy
ROC−0.080Sell
Bull/Bear Power3.933Buy
Note: Buy: 7; Sell: 2; Neutral: 2; Final Signal: Strong Buy.
Table 19. The final signal obtained from ABC-ANFIS-SVM (Example 8).
Table 19. The final signal obtained from ABC-ANFIS-SVM (Example 8).
General Electric Co.
IndicatorValueSignal
RSI64.423Buy
STOCH60.363Buy
STOCHRSI100.000Overbought
MACD0.060Buy
ADX53.721Buy
Williams %R0.000Overbought
CCI199.423Overbought
ATR0.073Less Volatility
Highs/Lows0.157Buy
Ultimate Oscillator65.176Buy
ROC2.349Buy
Bull/Bear Power0.301Buy
Note: Buy: 8; Sell: 0; Neutral: 0; Final Signal: Strong Buy.
Table 20. The final signal obtained from ABC-ANFIS-SVM (Example 9).
Table 20. The final signal obtained from ABC-ANFIS-SVM (Example 9).
Intel Corp
IndicatorValueSignal
RSI66.472Buy
STOCH60.356Buy
STOCHRSI11.225Oversold
MACD6.078Buy
ADX29.523Buy
Williams %R−31.782Buy
CCI42.860Neutral
ATR6.107Less Volatility
Highs/Lows0.006Neutral
Ultimate Oscillator49.041Neutral
ROC0.906Buy
Bull/Bear Power1.923Buy
Note: Buy: 7; Sell: 0; Neutral: 3; Final Signal: Strong Buy.
Table 21. The final signal obtained from ABC-ANFIS-SVM (Example 10).
Table 21. The final signal obtained from ABC-ANFIS-SVM (Example 10).
Chevron Corp
IndicatorValueSignal
RSI40.965Sell
STOCH63.746Buy
STOCHRSI100.000Overbought
MACD−0.907Sell
ADX25.058Sell
Williams %R−28.655Buy
CCI30.627Neutral
ATR1.736Less Volatility
Highs/Lows0.0812Buy
Ultimate Oscillator55.311Buy
ROC−4.073Sell
Bull/Bear Power−0.665Sell
Note: Buy: 4; Sell: 5; Neutral: 1; Final Signal: Sell.
Table 22. The final signal obtained from ABC-ANFIS-SVM (Example 11).
Table 22. The final signal obtained from ABC-ANFIS-SVM (Example 11).
Bank of America Corp
IndicatorValueSignal
RSI49.352Neutral
STOCH55.964Buy
STOCHRSI26.398Sell
MACD0.019Buy
ADX23.120Buy
Williams %R−50.342Neutral
CCI−33.156Neutral
ATR0.0834Less Volatility
Highs/Lows0.009Neutral
Ultimate Oscillator50.057Neutral
ROC−1.385Sell
Bull/Bear Power−0.013Sell
Note: Buy: 3; Sell: 2; Neutral: 5; Final Signal: Neutral.
Table 23. The final signal obtained from ABC-ANFIS-SVM (Example 12).
Table 23. The final signal obtained from ABC-ANFIS-SVM (Example 12).
Nike Inc
IndicatorValueSignal
RSI49.632Neutral
STOCH57.925Buy
STOCHRSI25.302Sell
MACD0.014Buy
ADX20.072Buy
Williams %R−55.631Neutral
CCI−31.305Neutral
ATR0.081Less Volatility
Highs/Lows0.009Neutral
Ultimate Oscillator51.204Neutral
ROC−1.627Sell
Bull/Bear Power−0.0107Sell
Note: Buy: 3; Sell: 3; Neutral: 5; Final Signal: Neutral.

Share and Cite

MDPI and ACS Style

Sedighi, M.; Jahangirnia, H.; Gharakhani, M.; Farahani Fard, S. A Novel Hybrid Model for Stock Price Forecasting Based on Metaheuristics and Support Vector Machine. Data 2019, 4, 75. https://0-doi-org.brum.beds.ac.uk/10.3390/data4020075

AMA Style

Sedighi M, Jahangirnia H, Gharakhani M, Farahani Fard S. A Novel Hybrid Model for Stock Price Forecasting Based on Metaheuristics and Support Vector Machine. Data. 2019; 4(2):75. https://0-doi-org.brum.beds.ac.uk/10.3390/data4020075

Chicago/Turabian Style

Sedighi, Mojtaba, Hossein Jahangirnia, Mohsen Gharakhani, and Saeed Farahani Fard. 2019. "A Novel Hybrid Model for Stock Price Forecasting Based on Metaheuristics and Support Vector Machine" Data 4, no. 2: 75. https://0-doi-org.brum.beds.ac.uk/10.3390/data4020075

Article Metrics

Back to TopTop