Next Article in Journal
Contextuality or Nonlocality: What Would John Bell Choose Today?
Previous Article in Journal
Study on the Swelling Characteristics of the Offshore Natural Gas Hydrate Reservoir
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

An IPSO-FW-WSVM Method for Stock Trading Signal Forecasting

1
Department of Computer Science and Technology, Tongji University, Shanghai 201804, China
2
School of Health Science and Engineering, University of Shanghai for Science and Technology, Shanghai 200093, China
*
Author to whom correspondence should be addressed.
Entropy 2023, 25(2), 279; https://doi.org/10.3390/e25020279
Submission received: 16 December 2022 / Revised: 19 January 2023 / Accepted: 30 January 2023 / Published: 2 February 2023
(This article belongs to the Section Signal and Data Analysis)

Abstract

:
Trading signal detection is a very popular yet challenging research topic in the financial investment area. This paper develops a novel method integrating piecewise linear representation (PLR), improved particle swarm optimization (IPSO) and a feature-weighted support vector machine (FW-WSVM) to analyze the nonlinear relationships between trading signals and the stock data hidden in historical data. First, PLR is applied to generate numerous trading points (valleys or peaks) based on the historical data. These turning points’ prediction is formulated as a three-class classification problem. Then, IPSO is utilized to find the optimal parameters of FW-WSVM. Lastly, we conduct a series of comparative experiments between IPSO-FW-WSVM and PLR-ANN on 25 stocks with 2 different investment strategies. The experiment results show that our proposed method achieves higher prediction accuracy and profitability, which indicates the IPSO-FW-WSVM method is effective in the prediction of trading signals.

1. Introduction

Designing and implementing various predictive techniques for complex data analysis has attracted great scientific interest [1,2]. Among the research, stock trading point prediction has been an attractive yet challenging research topic. Therefore, many investors and researchers have conducted plenty of research in this field. However, the stock market is a nonlinear, changeable and complex system affected by many factors such as government policies, international situations, economic environments, interest rates and market capitalization. Despite the volatility of the stock market, researchers are still trying to develop more effective prediction techniques due to the benefits involved in accurate predictions.
With regard to the techniques used to find optimal trading points, some of them are based on financial analysis, and others are artificial intelligence methods. Financial analysis usually uses two main analysis methods, which are fundamental and technical analysis [3,4]. Fundamental analysis uses macroeconomic, industrial and business indicators to predict trend reversals [5,6,7]. Technical analysis assumes that past behavior has an impact on price evolution and trading decisions are made based on historical prices and some useful technical indicators such as moving averages and the relative strength index [8,9,10]. Financial time series data are inherently dynamic, nonlinear [11,12] and do not follow the fixed patterns. Therefore, making the right trading decisions is very difficult through financial analysis. In contrast, artificial intelligence algorithms excel at handling dynamic and nonlinear data in financial markets and are widely applied to predict trading points.
Over the past few decades, many artificial intelligence and machine learning algorithms have been developed as major tools in the financial investment field, such as artificial neural networks [13,14,15], support vector machines [16,17,18,19], rough set theory [20,21,22,23], Bayesian analysis [24,25,26,27] and evolutionary learning algorithms [28,29,30,31]. However, most past studies have focused on the accurate prediction of stock prices rather than trading decisions, since it is more difficult to predict the buying and selling points of stocks than to predict the changes in stock prices.
In recent years, artificial neural networks have been widely used to predict the turning points of a stock. For example, Chiang et al. proposed an adaptive intelligent stock trading decision support system using a particle swarm algorithm and neural network to predict the future movement direction [32]. This method overcame the weakness of the selection of inputs and parameter settings in the traditional ANN approach. However, artificial neural networks have many disadvantages, such as black box technology, easy overfitting, large computational complexity, slow convergence speed and easily falling into local minima. To overcome these disadvantages, the SVM [33] has attracted much attention. It has become a very popular research method in the financial investment field. Luo et al. conducted a set of improvements to the PLR-WSVM by adding some relative indicators with more valuable information into the input variables [34], simplifying the turning point prediction into a two-class problem, adapting the threshold values of PLR and using the WSVM to find the stock trading signals. Chen and Hao proposed a novel method, PLR-FW-WSVM, to predict trading points [35]. Despite the SVM having good generalization performance, whether the parameters are appropriate often affects its classification performance and the generalization ability [36,37]. The traditional grid search algorithm has low efficiency and a large amount of calculations, in addition to being time-consuming and having an unsatisfactory effect [38]. PSO not only has the global optimization ability but also has an efficient convergence ability and strong local optimization ability [39]. The optimal solution can be found through coordination and information exchange among individuals. In order to find the optimal solution to the FW-WSVM model, this paper proposes improved particle swarm optimization (IPSO) and integrates it into FW-WSVM to find the trading signals in the financial field (IPSO-FW-WSVM). First, the turning points are generated by a PLR algorithm. Secondly, the information gain is calculated in order to set the weight of each feature. Lastly, we utilize IPSO to optimize the FW-WSVM model parameters for stock trading decision.
The rest of this paper is organized as follows. In Section 2, we briefly present the theories of PLR, the FW-WSVM based on the information gain and FW-WSVM parameter optimization based on IPSO. In Section 3, we present the research design, which contains input variable selection, data labeling and performance measuring. Section 4 presents some experimental results to validate the performance of our proposed method. Section 5 gives a summary of this work and some brief future work.

2. Methodology

This paper utilizes the IPSO-FW-WSVM method to detect trading signals in financial time series data. PLR first generates trading points from the historical stock price database. Secondly, the whole dataset is divided into a lot of overlapping training-testing sets, which can reduce the time-varying characteristics of stock data. Thirdly, the IPSO-FW-WSVM model is applied to learn the relationship between the input features and trading signals. Finally, the trained model is adopted to compute the accuracy of the model and evaluate the profitability with two investment strategies. The flow chart of the proposed framework is shown in Figure 1.

2.1. PLR

PLR was developed for pattern matching, and it can be used to generate turning points in financial time series data. Let X = { x 1 , x 2 , , x N } denote the financial time series data. X can be divided into M segments, which are expressed as follows:
S P L R = { L 1 ( x 1 , x 2 , , x t 1 ) , L 2 ( x t 1 + 1 , x t 1 + 2 , , x t 2 ) , , L M ( x t M 1 + 1 , x t M 1 + 2 , , x t M ) }
where t i ( i = 1 , 2 , , M ) is the end of the i th segment. Therefore, S P L R provides a lot of segments belonging to an uptrend or a downtrend with low and high price points, as shown in Figure 2.
The threshold of segment representation is a significant parameter affecting the results of PLR. Figure 3 shows some different segmentation graphs based on different threshold values for the Shenzhen Stock Exchange Component Index (SZSE COMP SUB IND). As shown in Figure 3, the higher threshold value created longer trend patterns and generated only a few segments, while a smaller threshold generated a lot of segments. Therefore, it should be more reasonable to specify different thresholds for different price fluctuations. In this paper, we utilized the SD algorithm [34] to automatically select the threshold, and different thresholds for different price fluctuations were calculated according to a percentage of turning points in the parameter p c t .

2.2. FW-WSVM Based on the Information Gain

In this section, a brief introduction for the FW-WSVM method based on information gain is given, and more details can be found in [35]. Let T t r a i n = { ( x 1 , y 1 ) , ( x 2 , y 2 ) , , ( x N , y N ) } be the training dataset, where x i = ( x i 1 , x i 2 , , x i n ) X = R n denotes the i th ( i = 1 , 2 , N ) input vector, n is the size of vector and y i Y = { 1 , + 1 } denotes the label. The dataset T t r a i n is separated into two classes through the hyperplane ω · ϕ ( x P ) + b = 0 , where P is a n × n feature-weighted matrix. The classifier should satisfy the following conditions:
y i ( ω · ϕ ( x P ) + b ) 1 ζ i , ( ζ i 0 , i = 1 , 2 , , N )
where ϕ : R n R m is used to map the input space R n to the high-dimensional feature space R m and ζ i is the slack variable. Therefore, The objective optimization can be expressed as follows:
min ω , b , ζ : J ( ω , ζ ) = 1 2 | | ω | | 2 + i = 1 N C i ζ i subject to : y i ( ω · ϕ ( x P ) + b ) 1 ζ i , i = 1 , 2 , , N ζ i 0 , i = 1 , 2 , , N
where C i is the weighted constant parameter, which is defined as follows:
C i = v i C
where v i is the weight of the instance x i . Thus, the corresponding Lagrangian function is Equation (5):
L p ( ω , b , ζ , α , μ ) = 1 2 | | ω | | 2 + i = 1 N C i ζ i i = 1 N α i [ y i ( ω · ϕ ( x i P ) + b ) 1 + ζ i ] i = 1 N μ i ζ i
where α i and μ i are the non-negative Lagrange multipliers. Therefore, the dual problem can be expressed as follows:
max α : Q ( α ) = i = 1 N α i 1 2 i = 1 N j = 1 N α i α j y i y j ϕ ( x i P ) ϕ ( x j P ) subject to : i = 1 N α i y i = 0 , i = 1 , 2 , , N 0 α i C i , i = 1 , 2 , , N
The decision function of the classification problem can be obtained with Equation (7):
f ( x ) = s i g n ( i = 1 N α i y i K ( x i P , x j P ) + 1 N S 0 < α j < C i [ y j i = 1 N α i y i K ( x i P , x j P ) ] )
where N S is the number of the support vectors and P is the feature-weighted matrix.
How to obtain the weighted matrix P is the key to the FW-WSVM algorithm. In this research, information gain is used to measure the weighted matrix P. Let | C { i , T t r a i n } | be the size of the dataset C { i , T t r a i n } . The probability of a sample belonging to class C + 1 / C 1 can be approximately calculated through | C { i , T t r a i n } | / N . The expected information is as follows:
I n f o ( T t r a i n ) = i { 1 , + 1 } | C { i , T t r a i n } | N log ( | C { i , T t r a i n } | N )
Let F f e a t u r e be the feature selected to split the set T t r a i n , and let F f e a t u r e have v different values. It can produce v subsets, indicated by D 1 , D 2 , , D v . Then, the expected information is as follows:
I n f o F ( T t r a i n ) = j = 1 v | D j | N I n f o ( D j ) = j = 1 v | D j | N i { 1 , + 1 } | C { i , D j } | | D j | log ( | C { i , D j } | | D j | )
where | D j | is the size of the set D j , | C { i , D j } | is the size of samples belonging to the class C + 1 / C 1 in set D j and i = 1 , + 1 , j = 1 , 2 , , v . Thus, the information gain is as follows:
I n f o G a i n ( F ) = I n f o ( T t r a i n ) I n f o F ( T t r a i n ) 2
If the information gain is greater, then the corresponding feature is more important, and the contribution to classification is greater. Consequently, the feature-weighted matrix P is as follows:
P = I n f o G a i n ( f 1 ) 0 0 0 I n f o G a i n ( f 2 ) 0 0 0 0 0 I n f o G a i n ( f n )
where I n f o G a i n ( f i ) describes the weight of each feature and i = 1 , 2 , , n .

2.3. FW-WSVM Parameter Optimization Based on IPSO

In the FW-WSVM algorithm, the value of factor C and the value of δ in the kernel function can obviously affect the performance of the system. It is difficult to choose the two important optimal parameters (C and δ ) by virtue of expert experience. In order to find the optimal values for these parameters with the smallest generalization error, PSO is used to optimize the parameter selection of the FW-WSVM model.
The PSO algorithm is a heuristic search algorithm which was derived from the flocking behavior of insects, herds of animals, flocks of birds, schools of fish, etc. The algorithm searches the solution space of the problem by simulating the foraging behavior of birds. In the PSO algorithm, each particle moves at a certain speed in the search space, changes its position according to the fitness value in the environment and shares the information with other particles.
Let the total number of particles be n, the dimension be d, the position of the i particle be x i = ( x i 1 , x i 2 , , x i d ) and the corresponding velocity be v i = ( v i 1 , v i 2 , , v i d ) , where i = 1 , 2 , , n . In each iteration, the particle updates its position by tracking two optimal solutions. The first one is the individual historical optimal solution, indicated as pbest, where p i = ( p i 1 , p i 2 , , p i d ) , and the other is the global optimal solution, indicated as gbest, where p g = ( p g 1 , p g 2 , , p g d ) . The particle updates its velocity and position as follows:
v i k + 1 = ω k · v i k + c 1 k · γ 1 · ( p i k x i k ) + c 2 k · γ 2 · ( p g k x i k )
x i k + 1 = x i k + β k · v i k + 1
where ω k is the inertia weight, c 1 k and c 2 k are the local search ability and global search ability learning factors, respectively, γ 1 and γ 2 represent random numbers between [ 0 , 1 ] and β k is the factor to speed up the convergence speed of the algorithm when updating the positions of particles:
β k = 1 tan ( π 4 · k T max )
where T max is the maximum evolutionary quantity.
The setting of the inertia weight has a great influence on the convergence speed of the algorithm. A larger inertia weight has a stronger global search ability for jumping out of the local optimal solution, and a smaller inertia weight is conducive to local searches, increasing the convergence speed of the algorithm. The inertia weight has a great influence on the performance of the algorithm, and there have been many studies on it [40,41,42,43]. The more successful one is the linearly adjusted inertia weight particle swarm algorithm [44]. The idea is that the inertia weight decreases linearly with the increase in the number of iterations of the algorithm. The actual search process of the PSO algorithm is nonlinear and highly complex, and the strategy of linearly decreasing the inertia weight often cannot reflect the actual optimal search process. In order to overcome the deficiency of a linearly decreasing weight, this paper proposes a non-linear decreasing strategy:
ω k = ω m a x ( ω m a x ω m i n ) · exp ( 1 T max k )
where ω m a x and ω m i n are the maximum and minimum of the inertial weight, respectively, and ω k is expressed in the inertia weight value of the kth iteration.
In this paper, we control the better global searching and local searching of particles by changing the learning factors c 1 k and c 2 k [45]. In the early stage of a search, a larger cognition coefficient c 1 k and a smaller social coefficient c 2 k are set so individual cognition occupies a dominant position, and the particles can develop new search areas in a larger search space. In the later stage, a larger social coefficient and a smaller cognitive coefficient are set. The updated formulas of c 1 k and c 2 k are as follows:
c 1 k = c 1 min + ( c 1 max c 1 min ) · T max k T max
c 2 k = c 2 min + ( c 2 max c 2 min ) · k T max
The flow of optimization of the FW-WSVM parameters using IPSO is illustrated in Algorithm 1.    
Algorithm 1: Description of FW-WSVM parameter optimization based on IPSO
Step 1
Determine the range of C and δ in FW-WSVM.
Step 2
Initialize IPSO algorithm parameters T max , ω m i n , ω m a x , c 1 min , c 1 max , c 2 min and c 2 max .
Step 3
Train the FW-WSVM model with training set. The parameters C and δ vary as the particle travels.
Step 4
Judge whether the desired accuracy is reached, if yes, output the optimal combined parameters C and δ of FW-WSVM model, and turn to Step 6;otherwise turn to Step 5 and continue iterating.
Step 5
Update the parameters.
substep 1
Update pbest by comparing the current fitness value of the particle with its individual history optimal value.
substep 2
Update gbest by comparing the current fitness value of particles with the global optimal value of population.
substep 3
Update the particle velocity according to Equation (12).
substep 4
Update particle position are updated according to Equation (13).
Step 6
Substitute C and δ into FW-WSVM, train the model by training set and output the trained model.

3. Research Design

3.1. Input Variable Selection

Let S be the dataset, which is described as follows:
S = s 1 , o p e n s 1 , l o w s 1 , h i g h s 1 , c l o s e v 1 s 2 , o p e n s 2 , l o w s 2 , h i g h s 2 , c l o s e v 2 s N , o p e n s N , l o w s N , h i g h s N , c l o s e v N
where s i , o p e n , s i , l o w , s i , h i g h , and s i , c l o s e denote the opening, lowest, highest and closing price, respectively, while v i is the trading volume for the i th ( i = 1 , 2 , , N ) day. In the stock prediction problem, s i , o p e n , s i , l o w , s i , h i g h , s i , c l o s e and v i provide very useful information and can usually be used as the input features. Recently, some research has shown that some technical indicators are more informative than prices [16,46,47,48,49]. Consequently, many important technical indicators will be taken into consideration as input features. These technical indicators are defined in Table 1. A brief description of each indicator is described here:
(i)
Simple Moving Average (SMA)
The SMA is a method of statistical analysis that averages prices within a certain period of time for smoothing data.
(ii)
Exponential Moving Average (EMA)
The EMA is a trend indicator. Its construction principle is to carry out a weighted arithmetic average on the price to judge the change trend for the price in the future.
(iii)
Moving Average Convergence/Divergence (MACD)
The MACD is a technical indicator that uses the aggregation and separation between the short-term exponential moving average and the long-term exponential moving average of the closing price to judge the time of buying and selling.
(iv)
Average Transaction Price (ATP)
The ATP is used to identify the average cost of a transaction and can provide more useful information.
(v)
Relative Strength Index (RSI)
The RSI is a technical curve made according to the ratio of the sum of the rise and fall in a certain period of time. It can reflect the prosperity of the market in a certain period of time.
(vi)
Average True Range (ATR)
The ATR measures volatility, taking into account any gaps in the price movement.
(vii)
William’s %R Oscillator
This is a momentum indicator that measures the overbought and oversold levels.
(viii)
Stochastic %K %D
This indicates the momentum of a stock and uses the current close price of the stock.
(ix)
Average Directional Movement Index (ADX)
The ADX can be used to help measure the overall strength of a trend.
After adding technical indicators, the new dataset S is reformulated as follows:
s 1 , o p e n s 1 , l o w s 1 , h i g h s 1 , c l o s e v 1 T I 1 , 1 T I 1 , 2 T I 1 , 3 T I 1 , m s 2 , o p e n s 2 , l o w s 2 , h i g h s 2 , c l o s e v 2 T I 2 , 1 T I 2 , 2 T I 2 , 3 T I 2 , m s N , o p e n s N , l o w s N , h i g h s N , c l o s e v N T I N , 1 T I N , 2 T I N , 3 T I N , m
where T I i , j represents the technical indicators.

3.2. Data Labeling

We used PLR to generate class labels. We first used PLR to generate turning points for the stock data. We then classified these turning points into three categories, which were valley turning points, peak turning points and other turning points. The turning point with a trough was marked as a buying point, while the peak was marked as a selling point, and the other points were marked as holding points. The holding point, buying point and selling point were numbered zero, one and two, respectively. After generating the class labels y i { 0 , 1 , 2 } , the variables were scaled between 0 and +1 using the standard min-max formula. The dataset S was reformulated as follows:
s ^ 1 , o p e n s ^ 1 , l o w s ^ 1 , h i g h s ^ 1 , c l o s e v ^ 1 T I 1 , 1 T I 1 , 2 T I 1 , 3 T I 1 , m s ^ 2 , o p e n s ^ 2 , l o w s ^ 2 , h i g h s ^ 2 , c l o s e v ^ 2 T I 2 , 1 T I 2 , 2 T I 2 , 3 T I 2 , m s ^ N , o p e n s ^ N , l o w s ^ N , h i g h s ^ N , c l o s e v ^ N T I N , 1 T I N , 2 T I N , 3 T I N , m y 1 y 2 y N

3.3. Performance Measure

The most important goal of stock forecasting is to obtain high and stable profits. We used two investment strategies to objectively test the profitability of the forecast effect. Let b s t o c k ( i ) be the balance number, b m o n e y ( i ) be the balance money, A v g i be the average price for day i, v m o n e y ( i ) be the total investment money until day i and c b u y and c s e l l be the transaction cost rates of buying and selling, respectively.
Strategy 1: This investment strategy is used to assess the benefits of having a large amount of funds.
(1) Buying strategy: If the forecast signal is a buying signal ( y i = 1 ), then the investors spend N e e d i = 100 × ( A v g i × ( 1 + c b u y ) ) money to buy 100 shares. After buying the stock, b s t o c k ( i ) , v m o n e y ( i ) and b m o n e y ( i ) are calculated as follows:
b s t o c k ( i ) = 100 i f i = 1 b s t o c k ( i 1 ) + 100 i f i > 1
v m o n e y ( i ) = 100 × ( A v g 1 × ( 1 + c b u y ) ) i f i = 1 v m o n e y ( i 1 ) + ( N e e d i b m o n e y ( i 1 ) ) i f 0 b m o n e y ( i 1 ) N e e d i , i > 1 v m o n e y ( i 1 ) + N e e d i i f b m o n e y ( i 1 ) > N e e d i , i > 1
b m o n e y ( i ) = 0 i f i = 1 b m o n e y ( i 1 ) N e e d i i f b m o n e y ( i 1 ) > N e e d i , i > 1 0 i f 0 b m o n e y ( i 1 ) N e e d i , i > 1
(2) Selling strategy: If the forecast signal is the selling signal ( y i = 2 ) and b s t o c k ( i ) > 0 , then the investors sell all their shares. After selling the stock, b m o n e y ( i ) and b s t o c k ( i ) are calculated according to Equations (24) and (25), respectively:
b m o n e y ( i ) = b m o n e y ( i 1 ) + b s t o c k ( i ) × A v g i × ( 1 c s e l l )
b s t o c k ( i ) = 0
Strategy 2: This investment strategy is used to evaluate the return of having limited capital. The initial investment capital is set by v m o n e y ( 1 ) = b m o n e y ( 1 ) = 10 , 000 , expressed in CNY.
(1) Buying strategy: If y i = 1 , then the investors spend the balance money to buy the number of shares N e e d B u y i = b m o n e y ( i ) N e e d i × 100 , where x denotes the minimal positive integer that is less than x. After buying the stock, b s t o c k ( i ) , v m o n e y ( i ) and b m o n e y ( i ) are calculated as follows:
b s t o c k ( i ) = N e e d B u y i i f i = 1 b s t o c k ( i 1 ) + N e e d B u y i i f i > 1
v m o n e y ( i ) = N e e d B u y 1 × ( A v g 1 × ( 1 + c b u y ) ) i f i = 1 v m o n e y ( i 1 ) + N e e d B u y i × ( A v g i × ( 1 + c b u y ) ) i f b m o n e y ( i 1 ) > N e e d i , i > 1
b m o n e y ( i ) = 10000 N e e d B u y 1 × ( A v g 1 × ( 1 + c b u y ) ) i f i = 1 b m o n e y ( i 1 ) N e e d B u y i × ( A v g i × ( 1 + c b u y ) ) i f b m o n e y ( i 1 ) > N e e d i , i > 1 b m o n e y ( i 1 ) i f 0 b m o n e y ( i 1 ) N e e d i , i > 1
(b) Selling strategy: If y i = 2 and b s t o c k ( i ) > 0 , then the investors always sell all their shares. Thus, b m o n e y ( i ) and b s t o c k ( i ) are updated according to Equations (24) and (25), respectively.
At the end of an investment cycle, all shares must be sold on the last day. The profit of this strategy is calculated as follows:
p r o f i t = b m o n e y v m o n e y v m o n e y

4. Experimental Results and Analysis

4.1. Data Collection and Experimental Set-Up

To demonstrate the IPSO-FW-WSVM model’s performance, 25 stocks were randomly selected from the Shanghai and Shenzhen exchange markets. Table 2 describes the collected datasets. The time span for these stocks was from 1 June 2012 to 30 June 2014. The 25 stocks could be divided into 3 types according to the change rate of the closing price: uptrend, downtrend and steady trend. If the rate of change of the closing price from the starting day to the end of the test period was higher than 10%, then it was classified as an uptrend. If the rate of change was lower than 10%, then it was classified as a downtrend; otherwise, it was classified as a steady trend.
In the experiments, Matlab 2016B and libsvm-3.11 [50] are used. Table 3 depicts the parameters used in the Shanghai and Shenzhen stock exchanges, where the size of each training set was 220, the size of each testing set was 20, the transaction fee for buying and selling was 0.0015 and the parameter p c t was 0.35 . Table 4 depicts the parameters used in IPSO. Table 5 depicts the technical indicators used as input variables.

4.2. Experimental Results

In this section, we conduct some comparative experiments between the IPSO-FW-WSVM and PLR-ANN models to illustrate the effectiveness of the proposed model. We used the neural network toolbox in Matlab R2016B to construct the compared ANN model, which had a three-layered feedforward structure, and the number of neurons in the hidden layer was selected using searching through five-fold cross-validation.
Table 6, Table 7 and Table 8 list the comparison results between the IPSO-FW-WSVM and PLR-ANN models on testing set in the uptrend stocks, the steady trend stocks and the downtrend stocks.
In Table 6, it can be seen that the IPSO-FW-WSVM model outperformed the PLR-ANN model in all five uptrend stocks listed in both aspects of trading point prediction accuracy and trading profits. The average accuracy for the trading signal prediction of the IPSO-FW-WSVM method was 52.85% while it was 46.61% for the PLR-ANN model in all five stocks. Even in the accuracy of individual stocks, the IPSO-FW-WSVM method also performed better than the PLR-ANN method. In terms of profit, the IPSO-FW-WSVM model outperformed the PLR-ANN model for all stocks using strategy 1, with the average profit being 42.66%, which was 34.39 points higher than that for the PLR-ANN model. Meanwhile, the IPSO-FW-WSVM algorithm requires less capital and less time to purchase than the PLR-ANN method, which shows that our proposed method is effective when using strategy 1. In the transaction with strategy 2, the IPSO-FW-WSVM model stood out against the PLR-ANN for five stocks receiving higher profits, in which the average profit of the IPSO-FW-WSVM model was 63.87%, while it was 11.18% for the PLR-ANN. In this way, we can conclude that our proposed method was more effective in the uptrend category and achieved better profitability using different investment strategies.
Table 7, demonstrates the similar comparative performances results between the IPSO-FW-WSVM and PLR-ANN models for the steady trend stocks and those for the uptrend stocks. The prediction accuracy of the IPSO-FW-WSVM model was higher than that for the PLR-ANN model for all steady trend stocks, being 51.56% for the IPSO-FW-WSVM while it was 47.80% in the PLR-ANN. In the transaction with strategy 1, the average profit for the IPSO-FW-WSVM method was 19.23%, while it was 7.04% for the PLR-ANN method. In the transaction with strategy 2, the IPSO-FW-WSVM also performed better than the PLR-ANN in terms of profit making with the same investment fund, with the average profit for the IPSO-FW-WSVM being 26.91%, while it was 0.41% for the PLR-ANN. The table also shows that the IPSO-FW-WSVM model needed to invest less capital and less time for purchases than the PLR-ANN model. From the above analysis, we can see that our proposed IPSO-FW-WSVM method can get better profit with different transaction strategies in the steady trend.
The results in Table 8 show that the IPSO-FW-WSVM model outperformed the PLR-ANN method for the downtrend stocks. Therefore, our proposed method was more effective in the downtrend category.
Figure 4, Figure 5, Figure 6, Figure 7, Figure 8, Figure 9, Figure 10, Figure 11, Figure 12, Figure 13, Figure 14, Figure 15, Figure 16, Figure 17, Figure 18, Figure 19, Figure 20, Figure 21, Figure 22, Figure 23, Figure 24, Figure 25, Figure 26, Figure 27 and Figure 28 show the buying and selling signals when adopting the IPSO-FW-WSVM model on testing set for the uptrend stocks, the steady trend stocks and the downtrend stocks with two strategies. In the figures, the upper triangle () denotes the buying signal, and the lower triangle () denotes the selling signal. In the Figure 4, Figure 5, Figure 6, Figure 7, Figure 8, Figure 9, Figure 10, Figure 11, Figure 12, Figure 13, Figure 14, Figure 15, Figure 16, Figure 17, Figure 18, Figure 19, Figure 20, Figure 21, Figure 22, Figure 23, Figure 24, Figure 25, Figure 26, Figure 27 and Figure 28, it is shown that the buy and sell signals for both strategies were still far from optimal. We think this is reasonable. Due to the characteristics of the stock market, such as uncertainty, noise, non-stationarity and nonlinearity, stock trend forecasting is a very hard problem.

5. Conclusions

An amount of research has been carried out on the behavior of stock price movements. However, investors are more interested in obtaining profits. Therefore, trading decisions are more important than forecasting the stock prices themselves. This paper proposes a comprehensive and efficient trading signal forecasting framework. First, we applied PLR to decompose the historical data into different segments and model trading signal prediction as a three-class classification problem. Then, we trained the IPSO-FW-WSVM model using historical training data and compared the proposed method with a PLR-ANN on the stocks under different trends in Chinese stock exchange markets. The experiment’s results clearly illustrate that the IPSO-FW-WSVM model can obtain a significantly higher forecasting accuracy than the PLR-ANN model for stocks in three different tends. Moreover, the proposed framework can make a significant amount of profit with different trading strategies, and the proposed system is very effective at predicting future trading points. However, there are still some problems to be studied further. Although the algorithm we proposed has many advantages, which we mentioned above, it also has some disadvantages. For example, it is difficult to implement for large-scale training samples and sensitive to missing data. Future research work will involve designing better forecasting models to make the results more accurate. Future research will also explore other good investment strategies, since different investment strategies have a large effect on profits, and an unsuitable strategy can lead to poor returns despite the high forecasting performance.

Author Contributions

Methodology, Y.C. and Z.Z.; Software, Y.C.; Validation, Y.C.; Formal analysis, Y.C.; Writing—original draft, Y.C.; Writing—review & editing, Z.Z. All authors have read and agreed to the published version of the manuscript.

Funding

The authors gratefully acknowledge financial support from the University Capacity Building Project of the Shanghai Science and Technology Commission (21010502800).

Institutional Review Board Statement

Not applicable.

Data Availability Statement

Not applicable.

Acknowledgments

The authors gratefully acknowledge financial support from the University Capacity Building Project of the Shanghai Science and Technology Commission (21010502800).

Conflicts of Interest

All authors declare that they have no conflict of interest.

References

  1. Liu, Y.; Shengdong, M.; Jijian, G.; Nedjah, N. Intelligent prediction of customer churn with a fused attentional deep learning model. Mathematics 2022, 10, 4733. [Google Scholar] [CrossRef]
  2. Cosma, O.; Pop, P.; Sabo, C.; Cosma, L. Forecasting the number of bugs and vulnerabilities in software components using neural network models. In Computational Intelligence in Security for Information Systems Conference, International Conference on European Transnational Education; Springer: Berlin/Heidelberg, Germany, 2023; pp. 159–168. [Google Scholar]
  3. Chavarnakul, T.; Enke, D. A hybrid stock trading system for intelligent technical analysis-based equivolume charting. Neurocomputing 2009, 72, 3517–3528. [Google Scholar] [CrossRef]
  4. Bagheri, A.; Peyhani, H.M.; Akbari, M. Financial forecasting using anfis networks with quantum-behaved particle swarm optimization. Expert Syst. Appl. 2014, 41, 6235–6250. [Google Scholar] [CrossRef]
  5. Samaras, G.D.; Matsatsinis, N.F.; Zopounidis, C. A multicriteria dss for stock evaluation using fundamental analysis. Eur. J. Oper. Res. 2008, 187, 1380–1401. [Google Scholar] [CrossRef]
  6. Chen, Y.-J.; Chen, Y.-M.; Lu, C.L. Enhancement of stock market forecasting using an improved fundamental analysis-based approach. Soft Comput. 2017, 21, 3735–3757. [Google Scholar] [CrossRef]
  7. Huang, Y.; Capretz, L.F.; Ho, D. Machine learning for stock prediction based on fundamental analysis. In Proceedings of the 2021 IEEE Symposium Series on Computational Intelligence (SSCI), Orlando, FL, USA, 5–7 December 2021; pp. 1–10. [Google Scholar]
  8. Shynkevich, Y.; McGinnity, T.; Coleman, S.; Belatreche, A.; Li, Y. Forecasting price movements using technical indicators: Investigating the impact of varying input window length. Neurocomputing 2017, 264, 71–88. [Google Scholar] [CrossRef]
  9. Detzel, A.; Liu, H.; Strauss, J.; Zhou, G.; Zhu, Y. Learning and predictability via technical analysis: Evidence from bitcoin and stocks with hard-to-value fundamentals. Financ. Manag. 2021, 50, 107–137. [Google Scholar] [CrossRef]
  10. Yao, Y.; Cai, S.; Wang, H. Are technical indicators helpful to investors in china’s stock market? a study based on some distribution forecast models and their combinations. Econ. Res.-Ekon. Istraž. 2022, 35, 2668–2692. [Google Scholar] [CrossRef]
  11. Guegan, D. Chaos in economics and finance. Annu. Rev. Control 2009, 33, 89–93. [Google Scholar] [CrossRef]
  12. Xue, G.; Zhong, M.; Li, J.; Chen, J.; Zhai, C.; Kong, R. Dynamic network embedding survey. Neurocomputing 2022, 472, 212–223. [Google Scholar] [CrossRef]
  13. Aras, S.; Kocakoç, İ.D. A new model selection strategy in time series forecasting with artificial neural networks: Ihts. Neurocomputing 2016, 174, 974–987. [Google Scholar] [CrossRef]
  14. Shahvaroughi Farahani, M.; Razavi Hajiagha, S.H. Forecasting stock price using integrated artificial neural network and metaheuristic algorithms compared to time series models. Soft Comput. 2021, 25, 8483–8513. [Google Scholar] [CrossRef] [PubMed]
  15. Sharma, D.K.; Hota, H.; Brown, K.; Handa, R. Integration of genetic algorithm with artificial neural network for stock market forecasting. Int. J. Syst. Assur. Eng. Manag. 2022, 13, 828–841. [Google Scholar] [CrossRef]
  16. Chen, Y.; Hao, Y. Integrating principle component analysis and weighted support vector machine for stock trading signals prediction. Neurocomputing 2018, 321, 381–402. [Google Scholar] [CrossRef]
  17. Hao, P.-Y.; Kung, C.-F.; Chang, C.-Y.; Ou, J.-B. Predicting stock price trends based on financial news articles and using a novel twin support vector machine with fuzzy hyperplane. Appl. Soft Comput. 2021, 98, 106806. [Google Scholar] [CrossRef]
  18. Nayak, R.K.; Tripathy, R.; Mishra, D.; Burugari, V.K.; Selvaraj, P.; Sethy, A.; Jena, B. Indian stock market prediction based on rough set and support vector machine approach. In Intelligent and Cloud Computing; Springer: Berlin/Heidelberg, Germany, 2021; pp. 345–355. [Google Scholar]
  19. Dash, R.K.; Nguyen, T.N.; Cengiz, K.; Sharma, A. Fine-tuned support vector regression model for stock predictions. Neural Comput. Appl. 2021, 1–15. [Google Scholar] [CrossRef]
  20. Tang, G.; Chiclana, F.; Liu, P. A decision-theoretic rough set model with q-rung orthopair fuzzy information and its application in stock investment evaluation. Appl. Soft Comput. 2020, 91, 106212. [Google Scholar] [CrossRef]
  21. Podsiadlo, M.; Rybinski, H. Financial time series forecasting using rough sets with time-weighted rule voting. Expert Syst. Appl. 2016, 66, 219–233. [Google Scholar] [CrossRef]
  22. Jiang, H.; Hu, B.Q. A decision-theoretic fuzzy rough set in hesitant fuzzy information systems and its application in multi-attribute decision-making. Inf. Sci. 2021, 579, 103–127. [Google Scholar] [CrossRef]
  23. Cao, B.; Zhao, J.; Liu, X.; Arabas, J.; Tanveer, M.; Singh, A.K.; Lv, Z. Multiobjective evolution of the explainable fuzzy rough neural network with gene expression programming. IEEE Trans. Fuzzy Syst. 2022, 30, 4190–4200. [Google Scholar] [CrossRef]
  24. Miao, J.; Wang, P.; Xu, Z. A bayesian dynamic stochastic general equilibrium model of stock market bubbles and business cycles. Quant. Econ. 2015, 6, 599–635. [Google Scholar] [CrossRef]
  25. Gong, X.; Si, Y.-W.; Fong, S.; Biuk-Aghai, R.P. Financial time series pattern matching with extended ucr suite and support vector machine. Expert Syst. Appl. 2016, 55, 284–296. [Google Scholar] [CrossRef]
  26. Chandra, R.; He, Y. Bayesian neural networks for stock price forecasting before and during COVID-19 pandemic. PLoS ONE 2021, 16, e0253217. [Google Scholar] [CrossRef]
  27. Vo-Van, T.; Che-Ngoc, H.; Le-Dai, N.; Nguyen-Trang, T. A new strategy for short-term stock investment using bayesian approach. Comput. Econ. 2022, 59, 887–911. [Google Scholar] [CrossRef]
  28. Rout, A.K.; Dash, P.K.; Dash, R.; Bisoi, R. Forecasting financial time series using a low complexity recurrent neural network and evolutionary learning approach. J. King Saud Univ.-Comput. Inf. Sci. 2017, 29, 536–552. [Google Scholar] [CrossRef]
  29. Sheng, W.; Shan, P.; Chen, S.; Liu, Y.; Alsaadi, F.E. A niching evolutionary algorithm with adaptive negative correlation learning for neural network ensemble. Neurocomputing 2017, 247, 173–182. [Google Scholar] [CrossRef]
  30. Kumar, G.; Jain, S.; Singh, U.P. Stock market forecasting using computational intelligence: A survey. Arch. Comput. Methods Eng. 2021, 28, 1069–1101. [Google Scholar] [CrossRef]
  31. Kumar, G.; Singh, U.P.; Jain, S. Hybrid evolutionary intelligent system and hybrid time series econometric model for stock price forecasting. Int. J. Intell. Syst. 2021, 36, 4902–4935. [Google Scholar] [CrossRef]
  32. Chiang, W.-C.; Enke, D.; Wu, T.; Wang, R. An adaptive stock index trading decision support system. Expert Syst. Appl. 2016, 59, 195–207. [Google Scholar] [CrossRef]
  33. Vapnik, V.N.; Vapnik, V. Statistical Learning Theory; Wiley: New York, NY, USA, 1998; Volume 1. [Google Scholar]
  34. Luo, L.; You, S.; Xu, Y.; Peng, H. Improving the integration of piece wise linear representation and weighted support vector machine for stock trading signal prediction. Appl. Soft Comput. 2017, 56, 199–216. [Google Scholar] [CrossRef]
  35. Chen, Y.; Hao, Y. A novel framework for stock trading signals forecasting. Soft Comput. 2020, 24, 12111–12130. [Google Scholar] [CrossRef]
  36. Huang, L.; Wu, K.; Huang, W.; Dong, Y.; Ma, H.; Liu, Y.; Liu, L. Detection of fusarium head blight in wheat ears using continuous wavelet analysis and pso-svm. Agriculture 2021, 11, 998. [Google Scholar] [CrossRef]
  37. Raj, S.; Ray, K.C. Ecg signal analysis using dct-based dost and pso optimized svm. IEEE Trans. Instrum. Meas. 2017, 66, 470–478. [Google Scholar] [CrossRef]
  38. Huang, L.; Zhang, H.; Ruan, C.; Huang, W.; Hu, T.; Zhao, J. Detection of scab in wheat ears using in situ hyperspectral data and support vector machine optimized by genetic algorithm. Int. J. Agric. Biol. Eng. 2020, 13, 182–188. [Google Scholar] [CrossRef]
  39. Liang, Y.; Zhang, H. Ship track prediction based on ais data and pso optimized lstm network. Int. Core J. Eng. 2020, 6, 23–33. [Google Scholar]
  40. Chatterjee, A.; Siarry, P. Nonlinear inertia weight variation for dynamic adaptation in particle swarm optimization. Comput. Oper. Res. 2006, 33, 859–871. [Google Scholar] [CrossRef]
  41. Nickabadi, A.; Ebadzadeh, M.M.; Safabakhsh, R. A novel particle swarm optimization algorithm with adaptive inertia weight. Appl. Soft Comput. 2011, 11, 3658–3670. [Google Scholar] [CrossRef]
  42. Pant, M.; Radha, T.; Singh, V. Particle swarm optimization using gaussian inertia weight. In Proceedings of the International Conference on Computational Intelligence and Multimedia Applications (ICCIMA 2007), Sivakasi, India, 13–15 December 2007; Volume 1, pp. 97–102. [Google Scholar]
  43. Yue-lin, G.; Yu-hong, D. A new particle swarm optimization algorithm with random inertia weight and evolution strategy. In Proceedings of the 2007 International Conference on Computational Intelligence and Security Workshops (CISW 2007), Harbin, China, 15–19 December 2007; pp. 199–203. [Google Scholar]
  44. Shi, Y.; Eberhart, R. A modified particle swarm optimizer. In Proceedings of the 1998 IEEE International Conference on Evolutionary Computation Proceedings. IEEE World Congress on Computational Intelligence (Cat. No. 98TH8360), Anchorage, AK, USA, 4–9 May 1998; pp. 69–73. [Google Scholar]
  45. Ratnaweera, A.; Halgamuge, S.K.; Watson, H.C. Self-organizing hierarchical particle swarm optimizer with time-varying acceleration coefficients. IEEE Trans. Evol. Comput. 2004, 8, 240–255. [Google Scholar] [CrossRef]
  46. Neely, C.J.; Rapach, D.E.; Tu, J.; Zhou, G. Forecasting the equity risk premium: The role of technical indicators. Manag. Sci. 2014, 60, 1772–1791. [Google Scholar] [CrossRef]
  47. Panigrahi, S.; Behera, H. A hybrid ETS-ANN model for time series forecasting. Eng. Appl. Artif. Intell. 2017, 66, 49–59. [Google Scholar] [CrossRef]
  48. Yeh, I.-C.; Lien, C.-H.; Tsai, Y.-C. Evaluation approach to stock trading system using evolutionary computation. Expert Syst. Appl. 2011, 38, 794–803. [Google Scholar] [CrossRef]
  49. Żbikowski, K. Using volume weighted support vector machines with walk forward testing and feature selection for the purpose of creating stock trading strategy. Expert Syst. Appl. 2015, 42, 1797–1805. [Google Scholar] [CrossRef]
  50. 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. The flow chart of the proposed framework.
Figure 1. The flow chart of the proposed framework.
Entropy 25 00279 g001
Figure 2. The segments generated by PLR.
Figure 2. The segments generated by PLR.
Entropy 25 00279 g002
Figure 3. The turning points obtained using different thresholds. (a) Results for PLR (threshold = 0.1). (b) Results for PLR (threshold = 0.15). (c) Results for PLR (threshold = 0.2).
Figure 3. The turning points obtained using different thresholds. (a) Results for PLR (threshold = 0.1). (b) Results for PLR (threshold = 0.15). (c) Results for PLR (threshold = 0.2).
Entropy 25 00279 g003
Figure 4. Trading signals for 600220 adopting IPSO-FW-WSVM.
Figure 4. Trading signals for 600220 adopting IPSO-FW-WSVM.
Entropy 25 00279 g004
Figure 5. Trading signals for 600628 adopting IPSO-FW-WSVM.
Figure 5. Trading signals for 600628 adopting IPSO-FW-WSVM.
Entropy 25 00279 g005
Figure 6. Trading signals for 600109 adopting IPSO-FW-WSVM.
Figure 6. Trading signals for 600109 adopting IPSO-FW-WSVM.
Entropy 25 00279 g006
Figure 7. Trading signals for 600327 adopting IPSO-FW-WSVM.
Figure 7. Trading signals for 600327 adopting IPSO-FW-WSVM.
Entropy 25 00279 g007
Figure 8. Trading signals for 000606 adopting IPSO-FW-WSVM.
Figure 8. Trading signals for 000606 adopting IPSO-FW-WSVM.
Entropy 25 00279 g008
Figure 9. Trading signals for 600283 adopting IPSO-FW-WSVM.
Figure 9. Trading signals for 600283 adopting IPSO-FW-WSVM.
Entropy 25 00279 g009
Figure 10. Trading signals for 600360 adopting IPSO-FW-WSVM.
Figure 10. Trading signals for 600360 adopting IPSO-FW-WSVM.
Entropy 25 00279 g010
Figure 11. Trading signals for 600509 adopting IPSO-FW-WSVM.
Figure 11. Trading signals for 600509 adopting IPSO-FW-WSVM.
Entropy 25 00279 g011
Figure 12. Trading signals for 600791 adopting IPSO-FW-WSVM.
Figure 12. Trading signals for 600791 adopting IPSO-FW-WSVM.
Entropy 25 00279 g012
Figure 13. Trading signals for 600895 adopting IPSO-FW-WSVM.
Figure 13. Trading signals for 600895 adopting IPSO-FW-WSVM.
Entropy 25 00279 g013
Figure 14. Trading signals for 601099 adopting IPSO-FW-WSVM.
Figure 14. Trading signals for 601099 adopting IPSO-FW-WSVM.
Entropy 25 00279 g014
Figure 15. Trading signals for 000514 adopting IPSO-FW-WSVM.
Figure 15. Trading signals for 000514 adopting IPSO-FW-WSVM.
Entropy 25 00279 g015
Figure 16. Trading signals for 000949 adopting IPSO-FW-WSVM.
Figure 16. Trading signals for 000949 adopting IPSO-FW-WSVM.
Entropy 25 00279 g016
Figure 17. Trading signals for 002083 adopting IPSO-FW-WSVM.
Figure 17. Trading signals for 002083 adopting IPSO-FW-WSVM.
Entropy 25 00279 g017
Figure 18. Trading signals for 002161 adopting IPSO-FW-WSVM.
Figure 18. Trading signals for 002161 adopting IPSO-FW-WSVM.
Entropy 25 00279 g018
Figure 19. Trading signals for 600036 adopting IPSO-FW-WSVM.
Figure 19. Trading signals for 600036 adopting IPSO-FW-WSVM.
Entropy 25 00279 g019
Figure 20. Trading signals for 600162 adopting IPSO-FW-WSVM.
Figure 20. Trading signals for 600162 adopting IPSO-FW-WSVM.
Entropy 25 00279 g020
Figure 21. Trading signals for 600558 adopting IPSO-FW-WSVM.
Figure 21. Trading signals for 600558 adopting IPSO-FW-WSVM.
Entropy 25 00279 g021
Figure 22. Trading signals for 600609 adopting IPSO-FW-WSVM.
Figure 22. Trading signals for 600609 adopting IPSO-FW-WSVM.
Entropy 25 00279 g022
Figure 23. Trading signals for 600875 adopting IPSO-FW-WSVM.
Figure 23. Trading signals for 600875 adopting IPSO-FW-WSVM.
Entropy 25 00279 g023
Figure 24. Trading signals for 601600 adopting IPSO-FW-WSVM.
Figure 24. Trading signals for 601600 adopting IPSO-FW-WSVM.
Entropy 25 00279 g024
Figure 25. Trading signals for 000650 adopting IPSO-FW-WSVM.
Figure 25. Trading signals for 000650 adopting IPSO-FW-WSVM.
Entropy 25 00279 g025
Figure 26. Trading signals for 002039 adopting IPSO-FW-WSVM.
Figure 26. Trading signals for 002039 adopting IPSO-FW-WSVM.
Entropy 25 00279 g026
Figure 27. Trading signals for 002061 adopting IPSO-FW-WSVM.
Figure 27. Trading signals for 002061 adopting IPSO-FW-WSVM.
Entropy 25 00279 g027
Figure 28. Trading signals for 002140 adopting IPSO-FW-WSVM.
Figure 28. Trading signals for 002140 adopting IPSO-FW-WSVM.
Entropy 25 00279 g028
Table 1. Used technical indicators with formulae.
Table 1. Used technical indicators with formulae.
Technical IndicatorFormulae
1. Simple Moving Average (SMA) S M A i ( n ) = 1 n j = max { 1 , i n } i s j , c l o s e
2. Exponential Moving Average (EMA) E M A i ( n ) = s 1 , c l o s e i f n = 1 2 n + 1 s i , c l o s e + n 1 n + 1 E M A i 1 ( n ) i f n > 1
3. Moving Average Convergence
/Divergence (MACD)
D I F i ( n ) = E M A i ( n f a s t ) E M A i ( n s l o w ) D E A i ( n ) = α D E A i 1 ( n ) + ( 1 α ) D I F i ( n ) M A C D i ( n ) = 2 ( D I F i ( n ) D E A i ( n ) )
4. Average Transaction Price (ATP) A T P i = s i , m o n e y v o l i
s i , m o n e y indicates the transaction money in one day
5. Relative Strength Index (RSI) R S I i ( n ) = 100 100 1 + E M A i ( n u p ) / E M A i ( n d o w n )
E M A i ( n u p ) is upward change, and E M A i ( n d o w n ) is downward change
6. Average True Range (ATR) A T R i = E M A i ( m a x ( s i , h i g h s i , l o w , | s i , h i g h s i , c l o s e 1 | , | s i , l o w s i 1 , c l o s e | ) )
| | denotes the absolute value, and n is the input window length
7. William’s %R Oscillator W i l l i a m s _ R i = 100 ( s i , h i g h s i , c l o s e ) / ( s i , h i g h s i , l o w )
8. Stochastic %K %D K i ( n ) = 100 ( s i , c l o s e m e a n n , l o w / ( m e a n n , h i g h m e a n n , l o w ) % D i ( n ) = E M A 3 ( % K i ( n ) )
m e a n n , h i g h and m e a n n , l o w are the mean high and low prices in the last n days,
respectively
9. Average Directional Movement Index (ADX) A D X i ( n ) = A D X i 1 ( n ) ( N 1 ) + D X n
Table 2. Description of data samples.
Table 2. Description of data samples.
TrendStock Code in Shanghai and Shenzhen MarketsData Range
uptrend600220, 600628, 600109, 600327, 000606from 1 June 2012 to 30 June 2014
steady trend600283, 600360, 600509, 600791, 600895
601099, 000514, 000949, 002083, 002161
from 1 June 2012 to 30 June 2014
downtrend600036, 600162, 600558, 600609, 600875
601600, 000650, 002039, 002061, 002140
from 1 June 2012 to 30 June 2014
Table 3. Description of the parameters.
Table 3. Description of the parameters.
L train L test c buy c sell pct
22020 0.0015 0.0015 0.35
Table 4. Description of parameters used in IPSO.
Table 4. Description of parameters used in IPSO.
n T max ω min ω max c 1 min c 1 max c 2 min c 2 max
10100 0.9 0.3 0.5 2.5 0.5 2.5
Table 5. Technical indicators used as input variables.
Table 5. Technical indicators used as input variables.
No.TI.No.TI.No.TI.No.TI.No.TI.No.TI.No.TI.
1ATP29K39DIF49DEA514RSI612ROC7Williams
85MA910MA105EMA119D129K1314ATR1414ADX
Table 6. The comparison results between IPSO-FW-WSVM and PLR-ANN models for stocks in the uptrend.
Table 6. The comparison results between IPSO-FW-WSVM and PLR-ANN models for stocks in the uptrend.
Stock CodeMethodAccuracyStrategy 1Strategy 2
V money Profit (%) N buy N sell V money Profit (%) N buy N sell
600220IPSO-FW-WSVM 54.79 2348.55 30.43 401610,000 37.31 1616
PLR-ANN 50.50 3505.79 1.49 681510,000 23.94 1615
600628IPSO-FW-WSVM 46.53 7717.44 27.89 441210,000 50.97 1212
PLR-ANN 43.56 45,344.00 15.29 133410,000 8.79 54
600109IPSO-FW-WSVM 51.18 10,108.92 35.77 22510,000 81.77 55
PLR-ANN 45.12 29,094.58 18.85 991310,000 5.30 1413
600327IPSO-FW-WSVM 52.81 2153.97 49.19 271310,000 86.05 1313
PLR-ANN 46.53 35,816.77 12.08 107510,000 30.70 55
000606IPSO-FW-WSVM 58.94 1461.73 70.00 6310,000 63.25 33
PLR-ANN 47.35 20,000.81 6.36 821010,000 2.23 1110
AverageIPSO-FW-WSVM 52.85 4758.12 42.66 27.80 9.80 10,000 63.87 9.80 9.80
PLR-ANN 46.61 26,752.39 8.27 97.80 9.40 10,000 11.18 10.20 9.40
Table 7. The comparison results between IPSO-FW-WSVM and PLR-ANN models for stocks in the steady trend.
Table 7. The comparison results between IPSO-FW-WSVM and PLR-ANN models for stocks in the steady trend.
Stock CodeMethodAccuracyStrategy 1Strategy 2
V money Profit (%) N buy N sell V money Profit (%) N buy N sell
600283IPSO-FW-WSVM 48.96 2912.90 25.67 261410,000 34.61 1614
PLR-ANN 45.14 21,431.51 17.45 95710,000 2.47 77
600360IPSO-FW-WSVM 52.65 2977.73 11.03 231210,000 15.17 1312
PLR-ANN 50.33 16,218.29 6.94 59510,000 9.81 55
600509IPSO-FW-WSVM 49.34 10489.10 10.76 531610,000 8.36 1616
PLR-ANN 47.35 39,822.34 5.22 98410,000 16.35 44
600791IPSO-FW-WSVM 53.16 2122.90 24.21 241110,000 42.83 1111
PLR-ANN 46.51 23,834.09 0.36 94510,000 18.74 65
600895IPSO-FW-WSVM 49.01 8335.45 29.82 35710,000 33.13 77
PLR-ANN 44.70 46,109.99 7.92 1131410,000 12.10 1614
601099IPSO-FW-WSVM 48.18 4160.28 9.55 481610,000 11.83 1716
PLR-ANN 42.24 16,495.44 1.42 851210,000 9.05 1212
000514IPSO-FW-WSVM 55.12 3532.42 10.92 361010,000 19.22 1010
PLR-ANN 48.18 9404.20 6.56 951210,000 12.75 1212
000949IPSO-FW-WSVM 52.61 1317.13 24.78 351410,000 20.76 1414
PLR-ANN 50.52 8255.36 17.49 86810,000 11.34 88
002083IPSO-FW-WSVM 54.79 2385.71 13.71 231310,000 23.64 1313
PLR-ANN 52.81 12,855.85 7.68 74610,000 19.42 66
002161IPSO-FW-WSVM 51.84 4235.11 31.87 502310,000 59.50 2323
PLR-ANN 50.17 37,128.73 0.60 86410,000 10.77 44
AverageIPSO-FW-WSVM 51.56 4246.87 19.23 35.30 13.60 10,000 26.91 14.00 13.60
PLR-ANN 47.80 23,155.58 7.04 88.50 7.70 10,000 0.41 8.00 7.70
Table 8. The comparison results between IPSO-FW-WSVM and PLR-ANN models for stocks in downtrend.
Table 8. The comparison results between IPSO-FW-WSVM and PLR-ANN models for stocks in downtrend.
Stock CodeMethodAccuracyStrategy 1Strategy 2
V money Profit (%) N buy N sell V money Profit (%) N buy N sell
600036IPSO-FW-WSVM 51.18 5510.71 2.43 18910,000 1.92 99
PLR-ANN 49.83 37,849.97 2.11 79610,000 11.82 66
600162IPSO-FW-WSVM 46.69 5434.19 5.84 311210,000 9.27 1212
PLR-ANN 42.72 40,799.91 22.02 931010,000 40.07 1110
600558IPSO-FW-WSVM 49.67 3251.21 4.81 221310,000 4.74 1313
PLR-ANN 44.70 33,107.92 1.96 102810,000 16.45 98
600609IPSO-FW-WSVM 53.49 880.33 9.40 13710,000 20.09 77
PLR-ANN 50.17 14,745.39 1.10 67410,000 20.88 44
600875IPSO-FW-WSVM 45.54 4327.49 12.37 301510,000 19.70 1515
PLR-ANN 42.57 42,984.28 8.28 981010,000 10.07 1010
601600IPSO-FW-WSVM 51.99 5194.73 20.26 531310,000 10.81 1313
PLR-ANN 43.05 11,981.77 9.94 1431110,000 25.50 1111
000650IPSO-FW-WSVM 51.68 2568.85 0.53 241810,000 2.21 1918
PLR-ANN 47.99 33,281.13 10.22 87310,000 14.08 33
002039IPSO-FW-WSVM 53.97 5207.73 1.63 421810,000 6.31 1818
PLR-ANN 47.35 25,229.79 22.27 69910,000 42.19 99
002061IPSO-FW-WSVM 50.66 1202.87 1.84 12810,000 1.09 88
PLR-ANN 43.38 23,466.05 20.45 87510,000 66.88 65
002140IPSO-FW-WSVM 49.50 12,493.64 13.49 381610,000 20.99 1616
PLR-ANN 43.23 104,549.51 21.36 1271010,000 47.03 1010
AverageIPSO-FW-WSVM 50.44 4607.18 7.26 28.30 12.90 10,000 4.22 13.00 12.90
PLR-ANN 45.50 36,799.57 10.94 95.20 7.60 10,000 29.50 7.90 7.60
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Chen, Y.; Zhu, Z. An IPSO-FW-WSVM Method for Stock Trading Signal Forecasting. Entropy 2023, 25, 279. https://doi.org/10.3390/e25020279

AMA Style

Chen Y, Zhu Z. An IPSO-FW-WSVM Method for Stock Trading Signal Forecasting. Entropy. 2023; 25(2):279. https://doi.org/10.3390/e25020279

Chicago/Turabian Style

Chen, Yingjun, and Zhigang Zhu. 2023. "An IPSO-FW-WSVM Method for Stock Trading Signal Forecasting" Entropy 25, no. 2: 279. https://doi.org/10.3390/e25020279

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop