Writing in the front

The following passage is based on A novel graph Feature Based convolutional Neural Network, published in Information Science in 2020 For Stock Trend Prediction. This paper proposes a novel method of stock trend prediction based on graph convolution feature of convolutional neural network. This method can take stock market information and individual stock information into account and realize effective trend prediction. Experiments verify that the proposed model has good predictive effect and revenue performance. The original paper is obtained at the end of the paper. * * * *

1

Abstract

Stock trend prediction is one of the most widely studied and challenging problems for investors and researchers. Since the introduction of convolutional neural networks (CNN) to analyze financial data, many researchers have worked to predict stock movements by converting stock market data into images. However, most of the existing researches only focus on individual stock information and ignore the stock market information, such as the correlation between stocks. In fact, the price fluctuation of one stock may be affected by the price fluctuation of other stocks. Therefore, incorporating stock market information into stock trend prediction can further improve the forecasting performance.

In this paper, an improved graph convolutional network (IGCN) and bidirectional CNN are designed to construct a GC-CNN model, which can capture both stock market characteristics and individual stock characteristics. Specifically, inspired by the complex financial network, the author constructs the stock market network based on the correlation between stocks and stock characteristics, and constructs the characteristic matrix representing the stock market information. At the same time, according to the transaction data and technical indicators to analyze the target stock, to obtain individual stock information. Then, stock market information and individual stock information are transformed into images. In addition, an improved graph convolution network (IGCN) and double CNN are designed to construct a GC-CNN stock trend prediction model, which can capture both stock market characteristics and individual stock characteristics. In the experimental part, 6 Chinese stocks are randomly selected to prove the superior performance of the proposed method based on GC-CNN. Experimental analysis shows that the method based on GC-CNN is superior to several stock trend prediction methods and stock trading strategies.

Therefore, the main contributions of this paper can be summarized as follows:

  • In stock trend prediction, the author considers both stock market information and individual stock information. In particular, the stock market network and corresponding characteristic matrix are constructed to represent the stock market information.
  • This paper presents an improved stock market feature capture algorithm based on stock market topological data. In addition, a dual-CNN based on individual stock information is designed to capture individual stock characteristics.
  • In this paper, a graph convolution feature based convolutional neural network (GC-CNN) model is proposed, which combines IGCN and dual-CNN to combine stock market features and individual stock features into joint features for stock trend prediction.
  • In order to verify the performance of the proposed method based on GC-CNN, the experimental results are evaluated from two aspects of computational performance and financial performance. In terms of computational performance evaluation, the proposed method based on GC-CNN is compared with several trend prediction methods. In the financial evaluation, this paper simulates stock trading according to different forecasts and several common stock trading strategies.

2

Model is introduced

This paper proposes a new method of stock trend prediction based on graph convolution feature of convolutional neural network (GC-CNN), which considers both stock market information and individual stock information. The method based on GC-CNN proposed in this paper is shown in the figure below, which is mainly divided into three steps: relevant stock discovery, image creation and trend prediction.

1. Relevant stock discovery

It should be noted that when only individual stock information is used to predict the stock trend, the influence of stock market changes on the target stock cannot be considered. Therefore, it is necessary to consider stock market information to better represent the impact of complex markets on target stocks. However, due to the huge size of the stock market, it is unrealistic to represent the stock market with all stocks. Therefore, in this paper, only a few related stocks are selected to represent the entire market. Considering that the price fluctuation of one stock may be affected by the price fluctuation of other stocks, the relationship between the target stock and other stocks is used to select related stocks. Specifically, a Spearman order related method is used to measure the relationship between stocks.

The correlation coefficient between the logarithmic returns of stocks I and J is calculated as follows: \

In addition, all stocks are grouped by industry attributes. Then, according to the relationship between the target stock and other stocks, rank each group of stocks from large to small, and select the top M stocks related to the target stock to represent the whole market.

2. Image creation

In the stage of image creation, stock market information and individual stock information are converted into images respectively. \

2.1 Stock market information image generation \

Stock market information consists of two parts. One is the topology of the stock market, and the other is the characteristics of each stock in the market. Based on the selection of related stocks, the stock network is constructed to capture the topological structure of the stock market, and the corresponding characteristic matrix is designed to represent the characteristics of each stock in the market. Details about the generated image are shown below.

We first sorted the selected stocks by industry attributes. Then, we construct the stock network by taking stocks as nodes and the relationship between stocks as edges. Specifically, the relationship between stocks is measured by the aforementioned degree of relevance. Since time delay is considered, the stock network adjacency matrix that predicts the trend of the target stock at time T can be expressed as:

Further, by setting a threshold, the above matrices are divided into two matrices according to positive correlation and negative correlation, which can be expressed as and:

In this way, two grayscale images for the positive correlation matrix and the negative correlation matrix can be obtained. The generation process of this image is shown in the figure below:

The characteristic matrix is constructed according to the characteristics of the selected stocks. Specifically, we select four characteristics to establish the corresponding characteristic matrix, including the relationship between the target stock and the selected stocks, the ROC of the last 1 day, the average of the 1-day ROC of the last N days, and the standard deviation of the 1-day ROC of the last N days. The ROC calculation method is as follows:

Then, for each positive and negative correlation matrix and, we construct a response characteristic matrix, in which the four features of each stock are taken as a row. After normalization of the Angle matrix, corresponding feature images can be obtained at each moment. This process is shown below:

2.2 Information image generation of individual stocks

Stock information also consists of two parts. The first part is made up of trading data and the second part is made up of technical indicators. The main steps for generating an image are as follows.

First of all, the sequence data needs to be divided into Windows, and then the four price sequences in the window are normalized in the following way:

Then each data point is converted into coordinates. Finally, according to the coordinates of each point, four price sequences can be converted into a four-channel image, in which each sub-sequence corresponds to a channel. An example is shown below.

In order to enhance the prediction ability, the sequence of ten technical indicators can also be converted into an image in the same way as above, but here it is a single channel image obtained by stitching in the vertical direction. An example of converting a technical indicator into an image is shown below: \

3. Trend forecast \

In the trend prediction stage, as shown in the figure below, a convolutional neural network (GC-CNN) model based on graph convolution feature is used to predict the future trend of the target stock. The GC-CNN model consists of two parts: improved GCN (IGCN) and dual-CNN (DUAL-CNN), in which stock market information is processed by IGCN and individual stock information is processed by dual-CNN. Details of IGCN and Dual-CNN are as follows.

3.1 IGCN

In the proposed IGCN, as shown in the figure below, stock market features are obtained in two steps according to positive correlation images, negative correlation images and corresponding feature images.

The first step is to integrate stock market information according to positive and negative relation images and corresponding feature images. First, two Laplacian matrices are obtained based on the positive and negative relation images, namely: \

They are then input into the convolution layer, where the convolution operation is of the following form: \

The obtained results are then combined with the corresponding eigenmatrix to carry out graph convolution operation as follows: \

The resulting new matrix is then subjected to a series of convolution, pooling and dropout operations, and finally output through the full connection layer. The final output is expressed as follows: \

So that gives you the characteristics of the stock market, which is theta.

3.2 Dual – CNN \

In the dual-CNN designed, as shown in the figure below, the transaction data images and technical index images are processed in parallel to obtain the individual stock features. Specifically, the individual stock features are composed of the combination of transaction data features and technical index features.

The input layer, two convolution layers, two maximum pooling layers, two dropout layers, as well as the full connection layer and the output layer are used for feature extraction in both transaction data images and technical indicator images. Finally, the stock characteristics are composed of transaction data characteristics and technical indicators.

Finally, the results from IGCN and DUAL-CNN are merged and output via a Softmax:

And compared with each category by probability: \

3

Experimental verification

In order to evaluate the model, experiments are carried out from two perspectives. One is through the evaluation indicators of prediction. Since trend prediction is a binary task, common evaluation indicators are used:

The second is through financial evaluation, that is, the model is used for historical backtesting, using the evaluation indicators are: \

Dual-CNN, CNN-TA, CNN-LSTM, GAF-CNN, SVM, MLP and DT were used as comparison methods to evaluate the prediction effect. Here are some of the results: \

Several common trading strategies are used in financial evaluation, namely RSI, SMA, SMA long-term and MACD strategies. The experimental results are as follows:

And yield curves on individual stocks: \

It can be seen that although the accuracy of the proposed method is not very high, it has a better performance in judging the buy and sell points. \

4

conclusion

In this study, a stock trend prediction method based on GC-CNN is proposed, which considers both stock market information and individual stock information. In this method, the stock market information, namely the constructed stock network and the corresponding characteristic matrix, and the individual stock information, namely the trading data and technical indicators of the target stock, are transformed into images. Then, the proposed GC-CNN model is used to predict the future trend of the target stock, in which the stock market features are captured by the proposed IGCN and the individual stock features are captured by the designed Dual-CNN. In addition, six randomly selected stocks from Chinese stock market demonstrate the superior performance of the proposed method from two aspects of computational performance evaluation and financial evaluation. In terms of computational performance evaluation, Dual-CNN, CNN-TA, SVM, MLP and DT methods are compared with the proposed method. In financial evaluation, stock trading is simulated based on different forecasts and other common stock trading strategies such as RSI signal, SMA short term signal, SMA long term signal and MACD signal. The comparison results show that :(1) the proposed method based on gc-cnn requires longer training time; (2) Comprehensively considering the stock market information, the prediction results can improve the effect; (3) The proposed GC-CNN method is not always superior to other methods in computing performance evaluation; (4) The computational performance based on GC-CNN method is more stable than other comparison methods; (5) The method based on GC-CNN proposed in this paper can obtain more stable, higher and consistent returns; (6) The method with better computational performance may not produce better trading signals. The gC-CNN method proposed in this paper can obtain better trading signals than other methods. These results show that the proposed method based on GC-CNN is superior to other stock trend prediction methods and common stock trading strategies, although it requires longer training time.

There are some possible directions for improving the method of forecasting future trends. Firstly, the structural parameters of GC-CNN were optimized by metaheuristic algorithms such as particle swarm optimization (PSO), Firefly algorithm (FA) and differential evolution algorithm (DE). Second, many other types of images can be generated during the image creation phase. Third, the approach may work better when investor sentiment is taken into account. Fourthly, the method proposed in this paper can be used for long-term stock trend prediction by taking into account more characteristics such as enterprise associated network information, industry background, shareholder structure, ownership structure and so on.

References:

Chen, W. ,  Jiang, M. ,  Zhang, W. G. , &  Chen, Z. . (2020). A novel graph convolutional feature based convolutional neural network for stock trend prediction. Information Sciences , 556.

Follow “ARTIFICIAL Intelligence Quantization Laboratory” public account, send background 088 can obtain the original paper.

The selection activities

Quantitative Investing in Python: Techniques, Models, and Strategies is an introduction to the application of Python in quantitative investing, based on a large number of real-world application cases and scenarios. In combination with his own experience in quantitative investment projects, the author uses easy-to-understand language and vivid cases, focusing on the concepts, ideas, methods and applications of quantitative investment, to help readers deeply understand that “Python’s glue language ability makes it competent in almost every link of quantitative investment production line”.

As of Next Monday, the winner of the most shared list will be given a free copy of “Python Quantitative Investing: Techniques, Models and Strategies”. The results will be announced in the next tweet.

Learn more about artificial intelligence and quantitative finance

<- Please scan for attention

Let me know you’re watching