Novel comparative methodology of hybrid support vector machine with meta-heuristic algorithms to develop an integrated candlestick technical analysis model

Armin Mahmoodi (Department of Aerospace Engineering, Carleton University, Ottawa, Canada)
Leila Hashemi (Department of Mechanical and Aerospace Engineering, Carleton University, Ottawa, Canada)
Amin Mahmoodi (Department of Mechanical Engineering, Islamic Azad University of Izeh, Izeh, Iran)
Benyamin Mahmoodi (Department of Industrial Engineering, Islamic Azad University of Izeh, Izeh, Iran)
Milad Jasemi (Stephens College of Business, University of Montevallo, Montevallo, Alabama, USA)

Journal of Capital Markets Studies

ISSN: 2514-4774

Article publication date: 8 December 2023

194

Abstract

Purpose

The proposed model has been aimed to predict stock market signals by designing an accurate model. In this sense, the stock market is analysed by the technical analysis of Japanese Candlestick, which is combined by the following meta heuristic algorithms: support vector machine (SVM), meta-heuristic algorithms, particle swarm optimization (PSO), imperialist competition algorithm (ICA) and genetic algorithm (GA).

Design/methodology/approach

In addition, among the developed algorithms, the most effective one is chosen to determine probable sell and buy signals. Moreover, the authors have proposed comparative results to validate the designed model in this study with the same basic models of three articles in the past. Hence, PSO is used as a classification method to search the solution space absolutelyand with the high speed of running. In terms of the second model, SVM and ICA are examined by the time. Where the ICA is an improver for the SVM parameters. Finally, in the third model, SVM and GA are studied, where GA acts as optimizer and feature selection agent.

Findings

Results have been indicated that, the prediction accuracy of all new models are high for only six days, however, with respect to the confusion matrixes results, it is understood that the SVM-GA and SVM-ICA models have correctly predicted more sell signals, and the SCM-PSO model has correctly predicted more buy signals. However, SVM-ICA has shown better performance than other models considering executing the implemented models.

Research limitations/implications

In this study, the authors to analyze the data the long length of time between the years 2013–2021, makes the input data analysis challenging. They must be changed with respect to the conditions.

Originality/value

In this study, two methods have been developed in a candlestick model, they are raw based and signal-based approaches which the hit rate is determined by the percentage of correct evaluations of the stock market for a 16-day period.

Keywords

Citation

Mahmoodi, A., Hashemi, L., Mahmoodi, A., Mahmoodi, B. and Jasemi, M. (2023), "Novel comparative methodology of hybrid support vector machine with meta-heuristic algorithms to develop an integrated candlestick technical analysis model", Journal of Capital Markets Studies, Vol. ahead-of-print No. ahead-of-print. https://doi.org/10.1108/JCMS-04-2023-0013

Publisher

:

Emerald Publishing Limited

Copyright © 2023, Armin Mahmoodi, Leila Hashemi, Amin Mahmoodi, Benyamin Mahmoodi and Milad Jasemi

License

Published in Journal of Capital Markets Studies. Published by Emerald Publishing Limited. This article is published under the Creative Commons Attribution (CC BY 4.0) license. Anyone may reproduce, distribute, translate and create derivative works of this article (for both commercial and non-commercial purposes), subject to full attribution to the original publication and authors. The full terms of this license may be seen at http://creativecommons.org/licences/by/4.0/legalcode


1. Introduction

There are several advantages in tracking stock price movement; hence investors and scientists invest time to study in this area. To forecast precisely, there are some prerequisites such as: correct data about stock market and its changes, trend prediction and an outcome of random-walk behavior of a stock series. However, with knowing all these factors, stock price prediction is still difficult due to its non-linear stocker market fluctuation, to overcome this issue investors and financial analysts need to have safe tools (Jasemi et al., 2011a, b; Mahmoodi et al., 2023b, c). Fortunately, artificial intelligence (AI) with its ability to analyze non-linear relations and since it can apply the dominant uncertainty in stock market, it can address this issue.

Through AI, more precise and new prediction methods compared to the previous ones have been achieved which are, however, not exempt from negative points. They are categorized into two classes: fundamental and technical analyses. The former analysis studies various factors with great influence on stock market, that mostly are unavailable, like micro-economics, macro-economic, political and even psychology. The latter, technical analysis, uses previous patterns for making new predictions, nevertheless these patterns are not easily noticeable (Xiao et al., 2013). Digital era's unprecedented advances have made forecasting also a technological matter. The most reliable and commonly used approaches are currently based on artificial neural networks (ANNs), recurrent neural networks, which are basically involved in machine learning (Olivia, 2008). In many instances the most challenging task is to train a deep neural network which can generalize well to new data. To tackle this issue, some methods such as cross-validation (regularization) or Bayesian methods have been proposed (MacKay, 1992).

A novel method recognized for supervising learning and overcoming limitations is SVM. The features of this method are classification and regression, and it is practically efficient since it is based on solid theoretical foundation. SVM helps to yield global optimal solutions, however, ANN frequently results are local optimal solutions. In SVM, a data component is assigned to a point in n-dimensional space (n is the number of accessible highlights of dataset) in which the esteem of highlight being the esteem of a specific facilitate. It classifies the data by realizing the hyper lane that separates the two classes; hence the precision of backup vectors is closely related to setting up the parameters. The interest of investors to use machine learning methods such as Japanese candlestick forecasting models, is based on the above-mentioned positive points including its optimization methods. A supervised feed-forward neural network has been applied by Jasemi et al. (2011a, b) and Mahmoodi et al. (2023b, c) as an example and Barak et al. (2015) uses a Wrapper ANFIS-ICA as a fuzzy neural network; a NARX as a non-dynamic neural network as an analyst for their candlestick models has been applied by Ahmadi et al. (2016). In all priorly mentioned studies meta-heuristic algorithms were applied for finding the suitable number of variables and computational intelligence methods for stock price forecasting. Among them, PSO has been implemented in their research methods, which indicates the increasing prevalence of them in predictive models. In most of these studies optimization is done by using optimizers which aim to yield local and global results. These optimizers act like crossover operations used by genetic algorithm (GA) (Mahmoodi et al., 2023b, c, 2021, Mehrjoo et al., 2014). In this way by choosing the most suitable optimizer the fitness function in PSO yields the optimum solution.

What differentiates the particle swarm optimization (PSO), and the evolutionary computing are flying potential ways through hyperspace. In swarm optimization concept it accelerates toward better solutions while in evolutionary computation schemes it directly does progress toward potential solutions that are explained as locations in hyperspace (Kennedy, 2003).

Due to the lack of literature focusing on SVM, in this study SVM along with three meta-heuristic algorithms is investigated. The objective is an optimization model which has investigation on movement prediction of stock prices for General Motors company with direct effect on the combination of input variables and analysis of the accuracy of such procrastinations (Ahmadi et al., 2018; Mahmoodi et al., 2023b, c). PSO, GA and the imperialist competition algorithm (ICA) are used as optimizers.

The contributions of this study can be summarized into below points.

  1. New machine learning methods for having the most suitable SVM parameters.

  2. Comprehensive analysis of candlestick coefficients to select the most suitable signal forecast methods.

  3. Implementation of PSO-SVM model in two different periods for the sake of the model's performance analysis.

  4. Results have been compared with three other developed models including SVM-GA, SVM-ICA, ANN algorithms (the base study) approaches to examine the consistency and reliability of the model.

The flow of this research is as below:

Literature review is written in the second section. In the third section, backgrounds and last studies are introduced, which explains this work completely. Three new models of the study as well as the conceptual basics of the models are explained in section 4. Section 5 runs the models with real data and presents the outcomes. Section 6 explains the final discussions of the study; and references are covered in section 7.

2. Literature review

Researchers and financial investors have so far shown the forceful impact that stock markets and efficient factors have on economic structures of countries. These factors to date show how they are important in the determination of prices in a market. Many techniques and procedures have been done which were analyzed in three parts: Technical, Fundamental and Combined analysis. Additionally, each of these analyses is structured through different aspects such as machine learning, data sources' nature, accuracy, error criteria and modeling heuristic or meta-heuristic approaches.

ANN has been applied for prediction of stock index by Farahani and Rahimi (2021) and meta-heuristic algorithms, social spider optimization (SSO) and bat algorithm (BA) for learning it. However, for feature selection he used GA and technical indexes for input data.

A new meta-heuristic method was used for prediction of a trade company's stock price which is a learner algorithm motivated by financial institutes' performance. The trader is as a weak learner in this method and provides the companies with slight information. Kumar et al. (2020) used ANNs, fuzzy logic and GAs to teach the data and feature selection and introduced an intelligent method to predict stock prices. Hegazy et al. (2013) presented for 13 financial data collection a machine learning approach which predicts stock price with the PSO algorithm and least square support vector machine (LS-SVM). Then the results were compared to the neural network algorithm and Levenberg–Marquardt (LM). Like the current research, in most of them, a combination of technical methods and meta-heuristic methods has been applied. Nevertheless, in this study the minimum-maximum method for data pre-processing and the wrapper method for feature selection has been used. Additionally, as the predictor neural network and SVM and nonlinear autoregressive network was used and mean squared error and hit rate were applied as function criteria. The model in this research has been organized from different dimensions.

  1. The data collection is considered the same as Ahmadi et al. (2018) and Mahmoodi et al., 2023b, c.

  2. The candlestick technical trading strategies input data was analyses by SVM.

  3. For optimization of SVM parameters and feature selection GA, colonial competition and PSO algorithm have been used for teaching and testing the data.

Finally, their function, and the gained accuracy degree of each presented hybrid model was evaluated by the hit rate index evaluated and then were compared with each other.

Even though many studies have been performed in this regard, their focus has not been on selecting the input data by the candlestick chart. Their focus was on choosing predictive methods. This study has considered two types of datasets like Jasemi et al.’s research. To yield different and excellent results the new hybrid model of SVM-PSO has been used by the achieved precision compared to the studies of Barak et al. (2015), Jasemi et al. (2011a, b), and Ahmadi et al. (2018). Several studies have investigated the advantages of candlestick in predicting the stock market (Lee and Jo, 1999; Xie et al., 2012; Lan et al., 2011).

Soft computing methods are popularly implemented for stock market problems (Barak et al., 2017) according to a nonlinear stock market system. They are useful tools for predicting such turbulent areas which suggest finding their nonlinear behavior. It is prevalent to use intelligent systems like neural networks, fuzzy systems and GA or hybrid models to foresee the financial implications. Financial time series of stock market funds forecasting problems are now common to be addressed by artificial neural network and SVM (Anbalagan and Maheswari, 2015). Many studies that combine evolutionary techniques with classification mechanisms can be found, nevertheless, even after developing many efficient models, few negative points can be realised in ANNs (Dahal et al., 2015; De Campos et al., 2016; Kuo et al., 2011). It results in lack of reproducibility of the process because of its learning proves based on strong likelihood, which is the reason that new approaches based on robust statistical principles like SVM is preferred by many researchers (Fernandez-Lozano et al., 2013). The SVM method, one of supervised learning methods, has recently become more popular as being one of the most advanced applications of regression and classification methods, due to its minimization of structural risk and its highly efficient practicality (Huang et al., 2005). Based on the above-mentioned advantages of SVM and the fact that it is present in Vapnik's statistical learning theory, much research concentrates on this theory and its applications. Even some researchers use SVM for times series prediction (Tay and Cao, 2001; Huang et al., 2005).

The SVM introduced by Vapnik (1995, 1998) is a machine learning approach that has been applied on problems of non-linear prediction because of its great performance (Wang et al., 2003).

It has been widely used in pattern recognition, regression and time series forecasting despite not being the best choice for researchers.

For instance, to predict time series Tay and Cao (2001) try to use this type of neural network. They concluded that SVM has better results than multi-layer propagation neural network in financial time series. In another example,

Examining these studies shows that although, in all recent research, prediction has implemented via justified approaches including various meta-heuristic methods without a comprehensive comparison between them and in none of them, PSO algorithm was superior in prediction. In this our study, more than presenting a developed SVM-PSO algorithm, GA and ICA are used to optimize the parameters of SVM which has never been done in the literature.

3. Methodology

Achievement of precision with the use of suitable stock market trading signals forecast models is the objective of this research. For this end, three structures are used to analyze the technical adjustment based on the background which is previously explained. It should be noted that each of these mentioned models will be explained in two different parts. The general methodology is as shown in Figure 1.

3.1 Input data

As mentioned above, the input dataset of this research is retrieved from the insights introduced by Jasemi et al. (2011a, b) and Mahmoodi et al. (2023a) per these two approaches, the daily stock prices including low, high, open and close prices change into 15 and 24 indicators.

3.2 The introduction of the models

3.2.1 SVM-PSO

3.2.1.1 Development of the initial particles in PSO

X matrix with (nf+2)×np dimensions have been made to produce the position of the primary particle so that nf equals to features numbers. It means that 15 and 24 in raw approach and signal approach, and np equals to the number of particles (18). Therefore, each column in the X matrix position shows the positions of the particles in the space of (nf+2) dimension.

Figure 2 reports one column of the X matrix. The first two components are C and Gamma parameters from SVM hyper parameters in this column. Parameter C first selects the values of Cmin = 0 and Cmax = 100. The Gamma parameter and the other components select a random number from the uniform random distribution over [0, 1). If its value is higher than 0.05, the feature is selected for SVM teaching for the third component. Otherwise, it will not be selected. Only the second feature is selected from the four features shown in Figure 6. V matrix speed is the same as the X matrix position, and their components are produced in the forms of random normal distribution with a mean of 0 and a standard deviation of 0.1.

3.2.1.2 Objective function

Figure 3 shows how a particle moves in the response space. Only two dimensions of (nf+2) dimension has been drawn for displaying. When moving, each particle should consider its previous moving direction. In addition, it should regard the best position that it has achieved so far (Pbest) and the best position that all the particles have received (gbest) and update its position based on nine and ten steps in pseudo code. Due to considering the best position of each particle and all the particles, an objective function of which the output minimum is in the best position should be regarded. The objective function used in this research is calculated in relation 1.

(1)ObjectiveFunction=accuracy

With regards to the fact that PSO naturally aims to find the minimum, symmetric accuracy has been used as the objective f2unction. It should be considered that accuracy is for a six-day signal.

3.2.2 SVM-GA

3.2.2.1 Initial chromosome creation in GA

Each chromosome in the taught model is modeled the same as each particle in the PSO algorithm. Nevertheless, the first and second genes are a random uniform number in the [lb, ub] range. Therefore, Figure 1 can be considered a chromosome. Further, each chromosome has a fitness value of which the value equals the output of the objective function of the problem highlighted in relation 1.

3.2.2.2 Parent selection and crossover

After each navigation from respective niter navigation, at first crossover will be done and its children will be produced.

First, the crossover is performed for each navigation of the niter from which the children are produced. Figure 4 shows how to select parents and crossover. First, the selection is made among the current 20 chromosomes via the Roulette wheel algorithm. Since this algorithm gives more acceptance chances to the chromosome with high fitness and objective function stresses the minimum, the reverse fitness of each chromosome is used for this algorithm. Finally, the parents' chromosome is divided into two sections among the two selected parents via the single-point crossover method. The first child takes the first parcel from the first parent and the second parcel from the second parent. In addition, the second child gets the first parcel from the second parent and the second parcel from the first parent. The mentioned operation is repeated ncross/2 times, and finally, children are produced in the amount of ncross, meaning that ncross is achieved according to relation (2).

(2)ncross=2×nchromosomes×pc2

In relation 2, if the pc value of an odd number in decimal part is selected to be 0.9, then multiplying it by nchromosomes such as ten and dividing it into two will be 4.5. After floor, 4 is multiplied by 2, and the result is 8. Therefore, it is concluded that ncross is an even number that is dividable into 2 in parent selection navigation and crossover.

3.2.2.3 Mutation

After producing children from the crossover, the mutation children should be produced. In so doing, the children are produced in the amount of nmut, meaning that nmut is achieved from relation 3.

(3)nmut=nchromosomes×pm

One chromosome is randomly selected among the 20 current chromosomes in each navigation for mutation, and one child is produced with its components. Then, a uniform mutation happens so that two genes of the child's genes are randomly selected. If the selected genes are from the primary two genes (C and Gamma parameters), the component is summed with a uniform random number in the range of [lb, ub). Otherwise, it will be summed with a random number in the [0, 1) range. It should be noticed that the primary two genes should not select the value smaller than lb, and the other genes should not select the value less than 0 or higher than 1. Thus, a check bound is performed, and the invalid values change to boundary values. Figure 5 shows mutation for one time.

3.2.2.4 Selection of chromosomes for the next generation

To do so, first, the current chromosomes are merged to chromosomes achieved from crossover and mutation. After that, the number of chromosomes chromosomes that have the best fitness value is selected based on the ordered fitness value.

3.2.3 SVM-ICA

3.2.3.1 Initial population creation

First, the colony is produced in countries numbers that each of them selects Figure 6 parameters like the two methods of SVM-GA and SVM-PSO. The primary quantifying of the parameters is identical to SVM-GA. The fitness value of each colony is the output of the objective function in relation 1. After colony production, they are ordered based on fitness value, and the first nimp is selected as imperialist. The rest of the colonies were once shuffled to balance imperialist power, and then they are devoted to imperialist, respectively. It means that the first remaining colony is devoted to the first imperialist, and the second remaining colony is devoted to the second imperialist, and this process continues to nimp. The remaining colony of nimp + 1 is again devoted to the first imperialist, and this process continues to the last. Figure 10 shows a sample of this process.

3.2.3.2 Assimilation

To catch the colony to imperialist, a uniform random error in [0, 1) range will be produced in the amount of (nf+2). Then, the new position of the colony is calculated based on relation 4, in which the assimilation coefficient of β and U (0, 1) are the uniform random number between 0 and 1.

(4)xcolony=(ximperalistxcolony)×βU(0,1)

It should be noticed that the first two members of colony position (C and Gamma) should not be less than lb, and the rest of the components should not pass over the [0, 1] range. Therefore, the bounds checking procedure occurs after relation 4.

3.2.3.3 Revolution

In this phase, revolution happens for each colony in each imperialist in the probability of prevolve. It means that some components of (nf+2) that report the current position of the colony are selected randomly. Thus, if these components are from the first two components, they select a uniform random value in [lb, ub) range. Otherwise, they select in [0, 1) range.

3.2.3.4 Exchange

After performing the two previous steps on the colonies, if a colony has fitness value better than its imperialist, the position of itself and the imperialist change. In so doing, for each imperialist, the fitness value of its best colony is checked with its fitness value, and if it is less, an exchange operation will be performed.

3.2.3.5 Imperialist total fitness

Given that by performing the previous three steps, the general fitness value of the imperialist is expected to change, this updating is performed regarding relation 5 in which the Sigma of cost-efficient of colonies means and n are the colonies number in imperialist.

(5)TotalFitness(Imperialist)=fitness(imperialist)+ξni=1nfitness(colonyi)

3.2.3.6 Imperialist competition

The weakest colony in the weakest imperialist will be selected in this step. After that, it is assigned to other imperialists based on the Roulette Wheel algorithm. It should be claimed that the reverse fitness value has been used for the Roulette wheel algorithm, of which the fitness with less value has more opportunity to be selected. Figure 7 offers this process in terms of the five imperials' existence.

After assigning the worst colony, the worst imperial might have only one imperialist. In this scenario, the relevant imperialist is calculated similarly as a colony and is assigned to an imperial regarding the Roulette wheel algorithm.

3.3 Calculate the total number of signals and hit rate

Implementation measures can be categorized in two parts that are statistical and non-statistical.

As per this research, the statistical part is more popular with the most popular one is hit rate (Atsalakis and Valavanis, 2009). Hit rate is defined as (number of success)/(total signals). It is worth mentioning that if the hit rate is higher than 51%, the model is useful (Lee, 2009). Since the base of this study is retrieved from the article of Jasemi et al. (2011a, b), reading that paper is recommended for better understanding. At this step, sell and buy signals and total number of signals are figured out and the number of correct signals during a six-day period are calculated. Additionally, the number of correct signals is calculated during a period of six days.

In his stem by using model outputs, all number of signals and sell and buy signals are discovered. Additionally, the number of correct signals is calculated during a period of six days. Due to the base study of this research which is Jasemi et al. (2011a, b), all details are set based on that study and for understanding better, reading that paper is suggested.

4. Results and discussion

4.1 Experimental results of models

4.1.1 Results of SVM-PSO

Values used are as below.

  • niter = 500,

  • nparticles = 18

  • c1 = c2 = 2

  • wmin = 0.4

  • wmax = 1.4

  • Cmin = 0

  • Cmax = 100

4.1.1.1 Results of accuracy of the implementation SVM-PSO model raw approach and signal approach

Table 1 reports the parameters and the selected features in the raw approach and the signal approach of the SVM-PSO model. The trained model in these two approaches has achieved the mean accuracy of 78.72 and 79.19%, respectively.

4.1.1.2 Confusion matrix SVM-PSO

Figure 8 shows the one-day signal prediction of the SVM-PSO model, meaning that tags of zero, one and two are sell, buy and neutral signals, respectively. According to the confusion matrix, the SVM-PSO model shows a relatively appropriate performance in buy and sell signals and can select an appropriate signal with an accuracy of 52.19%. For increasing this accuracy, a six-day assemblage has been used. It means that if the model predicts a buy signal, but the value decreases the next day, and we have a negative financial return, the signal is considered correct when we have a positive financial return in at least one day from the second day until the sixth day. In other words, the predicted signal might be correct until the following six days and have a positive financial return. Using this technique, the model accuracy in this dataset increases by 79.82%.

It should be noticed that the neutral signal is not considered for calculating accuracy because if the model exports the neutral signal, the user does not observe any disadvantage. On the other hand, if the buy and sell signal is exported, but the price does not change, it will be considered a disadvantage because of the person's investment. Thus, the last column of the confusion matrix is removed to calculate accuracy.

4.1.1.3 Bar chart SVM-PSO

Figure 9 (a) shows the accuracy and selected features numbers in the SVM-PSO model in the raw approach and Figure 9 (b) in signal approach. According to this figure, selecting seven features to teach the model has happened nine times in the raw approach as the most repeating action in the dataset; however, it has occurred once in signal approach. The best accuracy in each of these approaches (signal approach and raw approach) has happened in dataset 15 selected for features 10 and 6 with 85.37 and 86.95%, respectively.

4.1.1.4 Produced signals by SVM-PSO model in raw approach and signal approach

Table 2 shows the correctly predicted signals by the SVM-PSO model in each dataset. For example, in dataset 1, the model has produced 248 signals that each of them is the qualitative agent of increase, decrease and absence of stock change. If the predicted signal is a buy signal, the stock price must increase until the following six days at most, and if it is a sell signal, the stock price must decrease until the following six days at most. Of the 248 exported signals by the model, 114 signals happen in one day. In other words, if it is a buy signal, the price increases the next day, and if the signal is a sell one, the price decreases the next day. Among the 134 signals that had not been predicted correctly in the next day, 39 signals were correctly predicted in the following two days. Put another way, if a signal is a buy one, the price increases in the following two days and if it is a sell, the price decreases in the following two days. In this regard, this process continues until the following six days. Moreover, of the 248 exported signals by the model in dataset 1, 205 signals happen correctly, and the model predicts an 82.66% accuracy value.

4.1.2 Results of SVM-GA

Values use are as below.

  • niter = 50

  • pc = 0.8

  • pm = 0.2

  • nchromosomes = 20

  • ub = 10,000

  • lb = 1×1010

4.1.2.1 Results of accuracy of the implementation SVM-GA model raw approach and signal approach

Table 3 reports the parameter and the achieved features and their accuracy in the available 48 datasets in the SVM-GA model. The achieved accuracy mean for raw approach and signal approach is 79.46 and 80.10%, respectively, which offers the preference of signal approach to raw approach in this model.

4.1.2.2 Bar chart SVM-GA

Figure 10 (a) and (b) show the accuracy and selected features of teaching the SVM-GA model in the raw approach and signal approach, respectively. In terms of accuracy, the best performance has been done in dataset 48 with 84.80% accuracy in the raw approach, selecting six features of the available 15 features. On the other hand, the worst performance in dataset 10 with 71.60% accuracy has occurred with selecting ten features. This statistic has happened for the signal approach with 84.58% accuracy in dataset 48, selecting seven features, and 74.89% accuracy in dataset 34, selecting nine features. In terms of frequency, the utilized features to teach the models have occurred six times in the raw approach and 14 times in the signal approach.

4.1.2.3 Produced signals by SVM-GA model in raw approach and signal approach

Table 4 shows the correctly predicted signals by the SVM-GA model in each dataset. As can be seen, in dataset 1, Of the 236 exported signals that have been produced correctly by the model, 114 signals happen in one day. This indicates that like SVM-PSO model, the combination of SVM-GA in our model, has high accuracy in its performance.

4.1.3 Results of SVM-ICA

Used Values.

  • maxiter = 100

  • ncountries = 30

  • nimp = 5

  • beta = 0.5

  • zeta = 0.1

  • prevolve = 0.7

  • ub = 10,000

  • lb = 1×1010

4.1.3.1 Results of accuracy of the implementation SVM-ICA model raw approach and signal approach

Table 5 indicates the accuracy of chosen features for teaching of the model and its parameters. Average accuracy in raw approach and signal approach are 80.66 and 81.59% respectively.

4.1.3.2 Bar chart SVM-ICA

A and B in Figure 11 report accuracy and selected features in the SVM-ICA model in the raw approach and the signal approach, respectively. The maximum accuracy of the raw approach that has occurred in dataset 48 has reached 84.98% accuracy, selecting the eight features to teach the model. Further, the maximum accuracy of the signal approach has occurred in dataset 48 with 85.77% accuracy, selecting eight features. In terms of frequency, the selected features in the raw approach have been eight features with 11 frequencies, and in the signal approach, they have been nine features with 13 frequencies.

4.1.3.3 Signals produced by SVM-ICA model in raw approach and signal approach

Table 6 shows the correctly predicted signals by the SVM-ICA model in each dataset. Compared to the other hybrid model (SVM-GA, and SVM-PSO), out of 232 correctly predicted signals, 112 signals happened in one day. Therefore, the SVM-ICA model had a weaker performance than the other two models.

4.2 Compare models and best result

Figures 12–14 report the achieved accuracy frequency in various models in the total of the raw approach and the signal approach (96 datasets). Considering the figure, the SVM-ICA and SVM-GA models have had the most frequencies, with 80% value happening in 20 datasets of the 96 datasets. The SVM-PSO has performed better than the other models; however, it has achieved the best accuracy in the dataset with 86.96%.

It should be claimed that seed = 35 has been used for teaching all the models in all the datasets to select all the identical initial random values and prevent different results in different performances.

According to Table 7 the developed models in one-day signals have performed better than the previous models. Compared with the six-day signals, using the ICA as a heuristic algorithm (Barak et al., 2015) performs better than the other models. However, this article's developed GA has performed better than other algorithms.

4.2.1 Heatmap comparison

Figures 15 and 16 show the accuracy comparison of the raw approach and signal approach models. It is observed that SVM-ICA has performed in the best way. However, it is observed that the models in the raw approach do not perform appropriately in the 3, 10 and 34 datasets. When accuracy improvement happens in using the signal approach in these datasets, it is observed that the models perform differently in different datasets. For example, the SVM-ICA model performs better in most datasets, while the SVM-PSO has performed better than the other models in dataset 15.

4.2.2 Confusion matrix comparison

Figure 17 shows the comparison of the confusion matrix of the different models in dataset 37 in the raw approach. It means that (1) is the SVM-PSO model, (2) is the SVM-GA model and (3) is the SVM-ICA model. Based on the confusion matrixes, the models of SVM-GA and SVM-ICA correctly predict more sell signals, and the SVM-PSO model correctly predicts more buy signals in this dataset.

5. Conclusion

The SVM-ICA has performed better than the other models according to the implemented models. Further, considering Figure 14, the performance of the correct sell and buy signals numbers are relatively different in different models. Thus, an ensemble approach can be used to improve the performance. It means that three different models are each taught with different initial random values, and a majority voting occurs when producing a signal. This process provides higher accuracy, but its execution requires much time.

Figures

Research method

Figure 1

Research method

Demonstration of one column in matrix X

Figure 2

Demonstration of one column in matrix X

Movement of a particle in the solution space

Figure 3

Movement of a particle in the solution space

Parent selection and crossover

Figure 4

Parent selection and crossover

Parent selection and mutation

Figure 5

Parent selection and mutation

Assigning colonies to the imperialists for the first time

Figure 6

Assigning colonies to the imperialists for the first time

Moving weakest colony in weakest empire to another empire

Figure 7

Moving weakest colony in weakest empire to another empire

Confusion matrix of SVM-PSO in dataset 39 – raw approach

Figure 8

Confusion matrix of SVM-PSO in dataset 39 – raw approach

Accuracy and number of selected features in SVM-PSO

Figure 9

Accuracy and number of selected features in SVM-PSO

Accuracy and number of selected features in SVM-GA

Figure 10

Accuracy and number of selected features in SVM-GA

Accuracy and number of selected features in SVM-ICA

Figure 11

Accuracy and number of selected features in SVM-ICA

Prediction raw approach accuracy of different methods

Figure 12

Prediction raw approach accuracy of different methods

Prediction signal approach accuracy of different methods

Figure 13

Prediction signal approach accuracy of different methods

Frequency of model accuracies

Figure 14

Frequency of model accuracies

Heatmap diagram of models over 48 datasets – raw approach

Figure 15

Heatmap diagram of models over 48 datasets – raw approach

Heatmap diagram of models over 48 datasets – signal approach

Figure 16

Heatmap diagram of models over 48 datasets – signal approach

Confusion matrix comparison of different models

Figure 17

Confusion matrix comparison of different models

Optimal features and parameters with predicted accuracy of each dataset

Raw approachSignal approach
No.CσOptimal featureAccuracyNo.CσOptimal featuresAccuracy
124.1335.4[2,6,7,9,10,13,14]82.661233.74101.69[1,3,4,6,8,12,13,14,18,19,20,21,22,23]84.68
2107.023.36[2,6,7,10,14]80.95217.060.79[1,2,4,6,7,9,11,12,13,14,16,19]80.16
3155.934.38[1,7,8,13,14]75368.46201[1,4,10,11,12,15,16,18,19]75.77
441.70.65[1,5,6,8,10,12,13]76.19446.060.32[1,4,5,6,8,9,10,11,13,15,17,20]75.79
459.8218.64[2,7,8,12,14]83.334549.450.69[1,2,3,4,5,6,7,8,9,10,11,12,13,15,17,18,19,20]82.14
462246.641.89[2,4,5,6,7,9,10,11,13]74.946312.1910.55[1,4,5,6,7,9,10,11,12,13,14,15,18,19,22]76.92
47172.541.13[1,2,4,5,6,8,11,13]75.74765.460.49[1,2,4,5,6,7,8,9,12,13,14,15,16,17,19,20,23]76.1
4896.510.38[2,5,6,7,8,9,14]84.984851.310.19[2,3,11,12,14,16,18,21,22,23]84.98

Source(s): Table created by authors

Hit rate (SVM-PSO model raw approach and signal approach)

Raw approachSignal approach
No.1d2d3d4d5d6dCorrect signalsTotal signalsNo.1d2d3d4d5d6dCorrect signalsTotal signals
1114392016115205248111133161396188222
213523261055204252213625211055202252
3115421568318925231053516844172227
4984026157619225249838271576191252
45130362015452102524512739161555207252
4610736171279188251461242617977190247
471173716974190251471213416875191251
48139341515842152534813934151584215253

Source(s): Table created by authors

Optimal features and parameters with predicted accuracy of each dataset

Raw approachSignal approach
No.CΣOptimal featureAccuracyNo.CσOptimal featuresAccuracy
19144.748042.69[4,8,10,13,14]82.215316.34525.6[1,2,4,5,7,10,11,12,17,1920,23]84.42
26877.283941.39[1,2,3,8,9,12]8029591.192460.49[2,4,6,7,9,10,11,12,18,19,20,21,22,23]79.76
39024.556695.42[5,9,12,13]72.7336968.573544.99[9,10,11,13,14,15,18,20]78.93
49744.177576.62[1,2,7,8,13,14]77.647215.863560.21[2,4,5,8,9,10,13,14,15,17,19,20,21]78.97
457790.6320631.74[1,2,3,4,5,6,10,11,14]80.95452461.8117613.43[2,4,5,8,9,10,11,13,14,15,17,19,20,21,23]80.56
465108.473687.77[2,4,6,7,8,11]79.34468595.52303.06[2,3,4,5,9,11,12,14,15,16,17,20,23]79.65
4717567.4912977.23[2,7,8,10,12,14]78.37479591.192460.49[2,10,11,12,15,16,17,18,19,20,22,23]80.83
481858.829887.25[7,8,10,11,12,14]84.848110.377675.28[3,5,8,9,12,13,14,20,23]84.58

Source(s): Table created by authors

Hit rate (SVM-GA model raw approach and signal approach)

Raw approachSignal approach
No.1d2d3d4d5d6dCorrect signalsTotal signalsNo.1d2d3d4d5d6dCorrect signalsTotal signals
111835161465194236111735161665195231
212536201054200250213127231145201252
31003214877168231311738151065191242
41014122176719425049840311866199252
45124391516552042524512338171645203252
46112361812951922424611633151262184231
471282719774192245471213714994194240
48139321514842122504813834151584214253

Source(s): Table created by authors

Results of accuracy of the implementation SVM-ICA model raw approach and signal approach

Raw approachSignal approach
No.CσOptimal featureAccuracyNo.CσOptimal featuresAccuracy
12112.091303.18[2,3,5,6,7,9,12,13]83.6216480.31952.49[3,5,9,11,12,15,16,19]85.25
28141.182042.47[2,8,9,12,14]81.227595.161495.86[4,11,12,13,18,21,23]82.61
37935.568171.45[1,6,12]75.5736971.73320.93[9,10,11,13,15,22]78.1
41240.543917.43[1,2,3,7,8,10,11,14]81.7544373.265479.12[4,5,7,8,9,10,12,15,17,18,21]78.97
452442.19019.13[1,2,3,4,8,10,11,12]80.89457425.249603.14[1,2,4,5,6,7,9,10,11,12,13,14,15,16,18,22]81.35
463833.014764.31[1,3,5,6,10,11]81.07462657.721757.3[2,6,7,8,10,11,12,13,15,17,23]83.47
477948.774809.19[3,4,6,7,10,12,13]79.17473401.363938.22[2,8,10,11,13,16,19,20,23]81.93
486103.426332.48[3,6,7,10,11,12,13,14]84.98483400.017328.41[4,8,9,15,18,19,20,23]85.77

Source(s): Table created by authors

Hit rate (SVM-ICA model raw approach and signal approach)

Raw approachSignal approach
No.1d2d3d4d5d6dCorrect signalsTotal signalsNo.1d2d3d4d5d6dCorrect signalsTotal signals
11123919156319423211083422975185217
211930231242190234212132211015190230
310727129931672213104337857164210
41134620165620625249644301478199252
45118372114451992464512337181665205252
46123312010761972434612534181465202242
471193616964190240471343210973195238
48141331514842152534814035161484217253

Source(s): Table created by authors

Model comparison

Raw approach (mean accuracy)Signal approach (mean accuracy)
Model name1-day (%)6-days (%)1-day (%)6-days (%)
Our paperSVM-PSO47.7178.7248.5179.19
SVM-ICA49.4280.6649.7881.59
SVM-GA48.3779.4648.8280.10
Ahmadi et al. (2018)SVM-ICA19702779
SVM-GA33593361
Barak et al. (2015)ANFIS-GA35763878
ANFIS-ICA40854387
Jasemi et al. (2011a, b)Neural network4574.843.473.6

Source(s): Mahmoodi et al. (2023b, c), Table created by authors

References

Ahmadi, E., Abooie, M.H., Jasemi, M. and Zare Mehrjardi, Y. (2016), “A nonlinear autoregressive model with exogenous variables neural network for stock market timing: the candlestick technical analysis”, International Journal of Engineering, Vol. 29 No. 12, pp. 1717-1725.

Ahmadi, E., Jasemi, M., Monplaisir, L., Nabavi, M., Mahmoodi, A. and Amini Jam, P. (2018), “New efficient hybrid candlestick technical analysis model for stock market timing on the basis of the Support Vector Machine and Heuristic Algorithms of Imperialist Competition and Genetic”, Expert Systems with Applications, Vol. 94, pp. 21-31, ISSN: 0957-4174, doi: 10.1016/j.eswa.10.023.

Anbalagan, T. and Maheswari, S.U. (2015), “Classification and prediction of stock market index based on fuzzy metagraph”, Procedia Computer Science, Vol. 47, pp. 214-221.

Atsalakis, G.S. and Valavanis, K.P. (2009), “Surveying stock market forecasting techniques–Part II: soft computing methods”, Expert Systems with Applications, Vol. 36 No. 3, pp. 5932-5941.

Barak, S., Heidary, J. and Dahooie, T.T. (2015), “Wrapper ANFIS-ICA method to do stock market timing and feature selection on the basis of Japanese Candlestick”, Expert Systems with Applications, Vol. 42 No. 23, pp. 9221-9235.

Barak, S., Arjmand, A. and Ortobelli, S. (2017), “Fusion of multiple diverse predictors in stock market”, Journal of Information Fusion, Vol. 36, pp. 90-102.

Dahal, K., Almejalli, K., Hossain, M.A. and Chen, W. (2015), “GA-based learning for rule identification in fuzzy neural networks”, Applied Soft Computing, Vol. 35, pp. 605-617.

De Campos, L.M.L., de Oliveira, R.C.L. and Roisenberg, M. (2016), “Optimization of neural networks through grammatical evolution and a genetic algorithm”, Expert Systems with Applications, Vol. 56, pp. 368-384.

Farahani, H.V. and Rahimi, A. (2021), “An optimized support vector regression for identification of in-phase faults in control moment Gyroscope assembly”, 2021 IEEE International Conference on Prognostics and Health Management (ICPHM), Detroit (Romulus), MI, USA, pp. 1-7, doi: 10.1109/ICPHM51084.2021.9486438.

Fernandez-Lozano, C., Canto, C., Gestal, M., Andrade-Garda, J.M., Rabuñal, J.R., Dorado, J. and Pazos, A. (2013), “Hybrid model based on genetic algorithms and SVM applied to variable selection within fruit juice classification", The Scientific World Journal, Vol. 2013, 982438, p. 13, doi: 10.1155/2013/982438.

Hegazy, O., Soliman, O. and Abdul Salam, M. (2013), “A machine learning model for stock market prediction”, International Journal of Computer Science and Telecommunications, Vol. 4 No. 12, pp. 16-32.

Huang, W., Nakamori, Y. and Wang, S.Y. (2005), “Forecasting stock market movement direction with support vector machine”, Computers and Operations Research, Vol. 32 No. 10, pp. 2513-2522.

Jasemi, M., Kimiagari, A.M. and Memariani, A. (2011a), “A conceptual model for portfolio management sensitive to mass psychology of market”, International Journal of Industrial Engineering-Theory Application and Practice, Vol. 18 No. 1, pp. 1-15.

Jasemi, M., Kimiagari, A.M. and Memariani, A. (2011b), “A modern neural network model to do stock market timing on the basis of the ancient investment technique of Japanese Candlestick”, Expert Systems with Applications, Vol. 38 No. 4, pp. 3884-3890.

Kennedy, J. (2003), “Bare bones particle swarms”, Proceedings of the IEEE Swarm Intelligence Symposium (SIS), IEEE, Piscataway, Indianapolis, IN, pp. 80-87.

Kumar, M., Alshehri, M., AlGhamdi, R., Sharma, P. and Deep, V. (2020), “A de-ann inspired skin cancer detection approach using fuzzy c-means clustering”, Mobile Networks and Applications, Vol. 25, pp. 1319-1329, doi: 10.1007/s11036-020-01550-2.

Kuo, S.C., Lin, C.J. and Liao, J.R. (2011), “3D reconstruction and face recognition using kernel-based ICA and neural networks”, Expert Systems with Applications, Vol. 38 No. 5, pp. 5406-5415.

Lan, Q., Zhang, D. and Xiong, L. (2011), “Reversal pattern discovery in financial time series based on fuzzy candlestick lines”, Systems Engineering Procedia, Vol. 2, pp. 182-190.

Lee, M.C. (2009), “Using support vector machine with a hybrid feature selection method to the stock trend prediction”, Expert Systems with Applications, Vol. 36 No. 8, pp. 10896-10904.

Lee, K.H. and Jo, G.S. (1999), “Expert system for predicting stock market timing using a candlestick chart”, Expert Systems with Applications, Vol. 16 No. 4, pp. 357-364.

MacKay, D.J.C. (1992), “Bayesian interpolation”, Neural Computation, Vol. 4 No. 3, pp. 415-447.

Mahmoodi, A., Hashemi, L. and Jasemi, M. (2023a), “Develop an integrated candlestick technical analysis model using meta-heuristic algorithms”, EuroMed Journal of Business, Vol. 19, pp. 32-68, doi: 10.1108/EMJB-02-2022-0034.

Mahmoodi, A., Hashemi, L., Jasemi, M., Soroush Mehraban, S., Jeremy, L. and Richard C.M. (2023b), “A developed stock price forecasting model using support vector machine combined with metaheuristic algorithms”, OPSEARCH, Vol. 60, pp. 59-86, doi: 10.1007/s12597-022-00608-x.

Mahmoodi, A., Hashemi, L., Jasemi, M., Laliberté, J., Millar, R.C. and Noshadi, H. (2023c), “A novel approach for candlestick technical analysis using a combination of the support vector machine and particle swarm optimization”, Asian Journal of Economics and Banking, Vol. 7 No. 1, pp. 2-24, doi: 10.1108/AJEB-11-2021-0131.

Mahmoudi, A., Hashemi, L., Jasemi, M. and Pope, J. (2021), “A comparison on particle swarm optimization and genetic algorithm performances in deriving the efficient Frontier of stocks portfolios based on a mean‐lower partial moment model”, International Journal of Finance and Economics, Vol. 26 No. 4, pp. 5659-5665.

Mehrjoo, S., Jasemi, M. and Mahmoudi, A. (2014), “A new methodology for deriving the efficient frontier of stocks portfolios: an advanced risk-return model”, Journal of Artificial Intelligence and Data Mining, Vol. 2, pp. 113-123.

Olivia, D. (2008), “Machine learning based electronic triage for emergency department”, in Chen, Q., Wu, J., Zhang, S., Yuan, C., Batten, L. and Li, G. (Eds), Applications and Techniques in Information Security. ATIS 2018. Communications in Computer and Information Science, Springer, Singapore, Vol. 950, doi: 10.1007/978-981-13-2907-4_19.

Tay, F.E. and Cao, L. (2001), “Application of support vector machines in financial time series forecasting”, Omega, Vol. 29 No. 4, pp. 309-317.

Vapnik, V. (1995), The Nature of Statistical Learning Theory, Springer-Verlag, New York.

Vapnik, V.N. (1998), Statistical Learning Theory, John Wiley & Sons, New York.

Wang, W., Xu, Z. and Weizhen Lu, J. (2003), “Three improved neural network models for air quality forecasting”, Engineering Computations, Vol. 20 No. 2, pp. 192-210.

Xiao, Y., Xiao, J., Lu, F. and Wang, Sh. (2013), “Ensemble ANNs-PSO-GA approach for day-ahead stock E-exchange prices forecasting”, International Journal of Computational Intelligence Systems, Vol. 6 No. 1, pp. 96-114.

Xie, H., Zhao, X. and Wang, S. (2012), “A comprehensive look at the predictive information in Japanese candlestick”, Procedia Computer Science, Vol. 9, pp. 1219-1227.

Further reading

Ardjani, F. and Sadouni, K. (2010), “Optimization of SVM multiclass by particle swarm (PSO-SVM). I.J”, Modern Education and Computer Science, Vol. 2, pp. 32-38.

Bartz-Beielstein, T. (2010), “SPOT: an R package for automatic and interactive tuning of optimization algorithms by sequential parameter optimization”, arXiv preprint arXiv:1006.4645.

Bashath, S. and Ismail, A.R. (2018), Comparison of Swarm Intelligence Algorithms for High Dimensional Optimization Problems, Vol. 11 No. 1, pp. 300-307.

Boutte, D. and Santhanam, B. (2009), “A hybrid ICA-SVM approach to continuous phase modulation recognition”, IEEE Signal Processing Letters, Vol. 16 No. 5, pp. 402-405.

Chen, Q.C.Q., Wu, Y.W.Y., Zhang, X.Z.X. and Chen, X.C.X. (2008), “Forecasting system based on wavelet transform and PSO-SVM”, 2nd Int. Conf. Anti-counterfeiting, Secur. Identif.

Cherkassky, V. and Ma, Y. (2004), “Practical selection of SVM parameters and noise estimation for SVM regression”, Neural Networks, Vol. 17 No. 1, pp. 113-126.

Cristianini, N. and Shawe-Taylor, J. (2000), An Introduction to Support Vector Machines, Cambridge University Press, University of London, John Shawe-Taylor, Royal Holloway.

Demidova, L., Nikulchev, E. and Sokolova, Y. (2016), “The SVM classifier based on the modified particle swarm optimization”, IJACSA International Journal of Advanced Computer Science and Applications, Vol. 7 No. 2, pp. 16-24.

Hong, W.C., Dong, Y., Zheng, F. and Lai, C.Y. (2011a), “Forecasting urban traffic flow by SVR with continuous ACO”, Applied Mathematical Modelling, Vol. 35 No. 3, pp. 1282-1291.

Hong, W.C., Dong, Y., Chen, L.Y. and Wei, S.Y. (2011b), “SVR with hybrid chaotic genetic algorithms for tourism demand forecasting”, Applied Soft Computing, Vol. 11 No. 2, pp. 1881-1890.

Huang, C.J., Yang, D.X. and Chuang, Y.T. (2008), “Application of wrapper approach and composite classifier to the stock trend prediction”, Expert Systems with Applications, Vol. 34 No. 4, pp. 2870-2878.

Indra, G., Jemi gold, P., Pavithra, P. and Akila, K. (2021), “Applicability of svm & Narx for prediction alayis of flood in humid and semi-humid regions”, Annals of the Romanian Society for Cell Biology, Vol. 25 No. 6, pp. 6282-6293.

Jamous, R.A. (2015), “Modifications of particle swarm optimization techniques and its application on stock market”, A Survey, Vol. 6 No. 3, pp. 99-108.

Liu, Q., Chen, W., Hu, H., Zhu, Q. and Xie, Z. (2020), “An optimal NARX neural network identification model for a magnetorheological damper with force-distortion behavior”, Frontiers of Materials, Vol. 7, p. 10.

Majhi, B., Rout, M. and Baghel, V. (2014), “On the development and performance evaluation of a multiobjective GA-based RBF adaptive model for the prediction of stock indices”, Journal of King Saud University-Computer and Information Sciences, Vol. 26 No. 3, pp. 319-331.

Niveditha Pandith, T.S. and Babu, C.N. (2017), “Development of pso based hybrid lssvm model for time series prediction”, 2017 2nd International Conference for Convergence in Technology (I2CT), Mumbai, pp. 376-381, doi: 10.1109/I2CT.2017.8226155.

Nunno, F., de Marinis, G., Gargano, R. and Granata, F. (2021), “Tide prediction in the Venice Lagoon using nonlinear autoregressive exogenous (NARX) neural network”, Water, Vol. 13, p. 1173.

Pai, P.F. and Hong, W.C. (2005), “An improved neural network model in forecasting arrivals”, Annals of Tourism Research, Vol. 32 No. 4, pp. 1138-1141.

Pai, P.F. and Hong, W.C. (2006), “Software reliability forecasting by support vector machines with simulated annealing algorithms”, Journal of Systems and Software, Vol. 79 No. 6, pp. 747-755.

Sahin, U. and Ozbayoglu, A.M. (2014), “TN-RSI: trend-normalized RSI indicator for stock trading systems with evolutionary computation”, Procedia Computer Science, Vol. 36, pp. 240-245.

Samad Hasan Basari, A., Hussin, B., Gede Pramudya Ananta, I. and Zeniarja, J. (2013), “Opinion mining of movie review using hybrid method of support vector machine and particle swarm optimization”, Procedia Engineering, Vol. 53, pp. 453-462, ISSN: 1877-7058, doi: 10.1016/j.proeng.2013.02.059.

Sankar, C.P., Vidyaraj, R. and Kumar, K.S. (2015), “Trust based stock recommendation system–A social network analysis approach”, Procedia Computer Science, Vol. 46, pp. 299-305.

Singh, J. and Khushi, M. (2021), “Feature learning for stock price, prediction shows a significant role of analyst rating”, Application System Innovation, Vol. 17, doi: 10.3390/asi4010017.

Wang, G.L.G. (2017), “The performance of PSO-SVM in inflation forecasting”, 10th Int. Conf. Intell. Comput. Technol. Autom., Vol. 1 No. 1, pp. 259-262.

Xia, Y., Zhao, J., Ding, Q. and Jiang, A. (2021), “Incipient chiller fault diagnosis using an optimized least squares support vector machine with gravitational search algorithm”, Frontiers in Energy Research, Vol. 9, 755649, doi: 10.3389/fenrg.2021.755649.

Corresponding author

Armin Mahmoodi can be contacted at: im.mahmodi@yahoo.com

Related articles