# Beat Wash-Sale Tax with Multigraph Convolutional Neural Networks Based Trading Strategy

Authors: Qinan Wang; Weiwei Jiang
Journal: Security and Communication Networks
 (2022)

---

## Abstract

Stock forecasting is a method that uses historical data and mathematical models to predict the future movement of stocks. It gives an indication of how much profit or loss an investment can make. The use of machine learning for stock forecasting has been widely. But many studies do not take into account correlations between stocks and likelihood that frequent trading could trigger the wash-sale tax rule. Higher taxes cost could offset positive profits. In this study, we proposed a framework based on graph convolutional network, extracting the interdependencies of stocks to increase the prediction accuracy to 62%. Also, we included tax in the calculation of overall net income in simulated trading and tried different constraints on trades to see whether our new model can generate profits high enough to cover the required taxes. The results with 795.5% net return for two years validated the effectiveness of our model and trading strategy.


---

## Body

## 1. Introduction

In order to help investors to make better investment decisions, stock forecasting has become a popular tool. Stock forecasting is a method of predicting the future movement direction of a stock. The prediction is made by using historical data and applying mathematical models. It will give a hint about how much profit or loss can be obtained from the investments.Besides prediction, tax is also an important problem in stock trading. A tax rule called wash-sale rule is an IRS regulation that prevents high-frequency trades from creating artificial loss to deduct tax. It occurs when an investor sells or trades a security at a loss and buys the same one within a month. When this rule is triggered, it makes the initial loss uncountable for tax reduction. Although our intention of trading is not to deduct tax but to make profits, trading at a high frequency might trigger this rule and lead to unnecessary heavy taxes. With the wash-sale rule, investors may pay tax much more than profit when making incorrect trades.Traditional forecasting methods can be divided into three categories: fundamental, technical, and their combination. Fundamental analysis is concerned with analysing a company’s financial statements to forecast its future performance. Technical analysis focuses on analysing stock price past movement patterns. The combination method involves both fundamental and technical analyses.Newly developed machine learning stock forecasting is a technique that uses artificial intelligence (AI) to predict the future price of stocks. Machine learning stock forecasting can be used for both short-term and long-term forecasts, but it is most commonly used for making short-term predictions. There are two main types of machine learning stock forecasting, namely, regression analysis and neural networks. Neural networks are more accurate than regression analysis, but they are also slower at making predictions because there are many parameters involved in predicting a stock’s price movement. Over the last few years, neural networks have become more popular due to their reduced training data. This means that we do not need as much historical data when using them compared with regression analysis or other techniques like technical indicators, which makes them very useful for traders who want to use only a small amount of historical data when making their predictions on any given day.However, most of the stock forecasting literatures are only based on the historical data of the stock itself, market data, and news. The absence of stocks’ correlation factor may bring uncertainty to the result. Therefore, we applied a new machine learning model, graph convolutional neural network (GCN), on stock forecasting to extract the interdependencies between stocks. To take advantage of it, we proposed a multigraph construction method and a GCN-based forecasting framework with multiple graphs as inputs. At last, we proposed a trading simulation system with stock movement predictions as trading signals. The experimental results with a 62% win rate validate the effectiveness of our proposed stock forecasting and trading methods.Moreover, many existing literatures proposed trades within one month but do not include wash-sale rule. In this paper, we evaluated tax-excluded net income and profit. The comparison of them shows that the wash-sale tax can be a huge cost and offset the profit. But our model is still profitable with a 795.5% return for two years after tax.The rest of this paper is organized as follows. Section2 discusses related studies. Section 3 introduces forecasting and trading frameworks. Sections 4 and 5 present trading evaluation and discussion. Section 6 concludes this paper.


## 2. Related Work

### 2.1. Machine Learning Methods for Stock Prediction

A number of researchers have explored usefulness of machine learning model on stock prediction. A study was conducted to predict the future values of the stock index using two-stage fusion. The first stage uses Support Vector Regression (SVR), and the second stage uses Artificial Neural Network (ANN) and Random Forest (RF) to create fusion models. Then, the results are compared with those of single-stage models with SVR, ANN, and RF. The first stage predicts statistical parameters in the future that will be input in the second stage. The results showed that the two-stage model was more accurate than the single-stage models [1]. Another study proposed an algorithm that can exploit the temporal correlation of global stock market and financial products and uses SVM model and other regression models to predict the stock trend of next day [2]. Another study used Logistic Regression, Gaussian Discriminant Analysis, Quadratic Discriminant Analysis, and SVM to predict the next day and long-term trend of stock movement and found that although it is hard to predict the next day trend with high accuracy, long-term trend prediction was able to have high accuracies [3]. Another study also showed that predicting stock movement of long term has higher accuracies than predicting the movement of next day. The study tried to predict the direction and strength of stock movement of next day and a week later using Multinomial Logistic Regression, Linear Discriminant Analysis, K-Nearest Neighbours Algorithm, and Multiclass Support Vector Machine [4]. A study tried to predict the stock movement using recurrent reinforcement learning. The result showed that trading with neural network’s aid still has high variance during volatile periods [5].


### 2.2. The Development of GCN and Applications in the Financial Domain

GCN is a state-of-the-art model attracting considerable critical attention [6]. It is a type of deep learning algorithm that uses graph to learn how to recognize objects in images. The main idea behind the GCN is that we can use the structure of an image as a representation for our data and then apply this representation to predict the object present in it [7]. Recently, GCN and subsequent variants have been applied in various areas, including social networks, chemistry, natural language processing, and computer vision [8–14]. However, it is has yet not commonly used in financial field.A study conducted early in 2005 used a graphic neural network for computing customized web page rank values and was able to show strong learning capacity [15]. Some recent studies have been conducted to use GCN in other areas. A study conducted in 2020 used a multimodel graphic neural network for microvideo recommendations [16]. The result significantly outperformed other popular recommendation methods. Another study was conducted in 2021 to use graphic neural network in traffic prediction [17]. It aimed to transform transportation information into optimized graphs to be input into the network so it can learn the relationships between road segments and predict transportation conditions.


### 2.3. The Automated Trading Systems

Up to now, several studies have attempted to evaluate the feasibility of automated trading systems using various methods, including classical time series prediction and machine learning [18]. Here, we gave some of the latest literature review about this topic.A study constructed trading system based on ANN and triple Exponential Moving Average (EMA) [19]. It turned to use ANN by demonstrating the ARIMA predictions of stock price completely out of measure. The network with input of 5-day data predicted the next day opening highest, lowest, and closing (OHLC) stock price, respectively, by adopting adaptive moment (Adam) optimization algorithm and Mean Absolute Error (MAE) loss function. For the part of the trading strategy, it combined triple EMA and ANN to define the entry/exit rules: when predicted lowest or highest stock price is lower than triple EMA lowest or highest, and predicted closing or opening is lower than the triple EMA closing or opening, the system will buy in; when predicted lowest or highest is higher than triple EMA lowest or highest, and predicted closing or opening is higher than the triple EMA closing or opening, the system will exit current position.Another study proposed a pattern-based stock trading system and also was predicted by ANN [20]. It applied three algorithms to form the clusters of data with high fluctuation patterns, with which input features including distance between MA and current price, rate of change (RC), candlestick body, upper shadow (US), lower shadow (LS), opening/highest/lowest price, slope of the volume moving average line, difference between the volume moving averages, and the total volume, are calculated. All features are normalized to 0∼1. Finally, the neural network will output a binary result marked by 1 if the price rises by more than 10% within 5 days and otherwise it is 0. The experimental result showed achieved accuracy of 96.23%. The trading policy of this system was 20% in profit realization rate and −12% in stop loss rate, with holding period of 19 days. A fund simulation showed a profit rate of 65% within 8 months.Some derived machine learning method is also popular in trading system. A long-short term memory based on leading indicators (LSTMLI) was used to classify the change of stock prices [21]. +0.01 and −0.01 are cutoff points of price rise and fall, between −0.01 and −0.01 is classified as unchanged. Then, a genetic algorithm is used to find the threshold of trading signals. It initialized the chromosome by producing two values for buy signal and sell signal. One of the two signals will be output if the predicted value is higher than corresponding chromosome value. After signal appears, Kelly criterion is used to optimize proportion of money invested in stock. The experimental results showed that Kelly criterion helps obtain much higher profit.The above literature discussed various evaluation metrics for models, profit, and risk. Mean Square Error (MSE), Root Mean Square Error (RMSE), MAE, Mean Absolute Percentage Error (MAPE), and Explained Variance Score (EVS) were applied to evaluate continuous prediction models’ performance. Accuracy, precision, recall, andF1 score are used to evaluate binary prediction performance. Maximum drawdown (MDD), Sharpe ratio (SR), Sortino ratio (SoR), and Calmar ratio (CR) were used for estimating the potential loss in value of the stock. The goodness of each trade was calculated by simple returns.As one of the new efficient machine learning methods, reinforcement learning plays an important role in the trading system as well [22–24]. It involves using a reward function that specifies how the system should behave. The algorithm then learns how to maximize the reward function by performing actions that lead to a higher reward and learns from its own past experiences how to improve future rewards. This paper did not include reinforcement learning but we consider it as a future research direction.


## 2.1. Machine Learning Methods for Stock Prediction

A number of researchers have explored usefulness of machine learning model on stock prediction. A study was conducted to predict the future values of the stock index using two-stage fusion. The first stage uses Support Vector Regression (SVR), and the second stage uses Artificial Neural Network (ANN) and Random Forest (RF) to create fusion models. Then, the results are compared with those of single-stage models with SVR, ANN, and RF. The first stage predicts statistical parameters in the future that will be input in the second stage. The results showed that the two-stage model was more accurate than the single-stage models [1]. Another study proposed an algorithm that can exploit the temporal correlation of global stock market and financial products and uses SVM model and other regression models to predict the stock trend of next day [2]. Another study used Logistic Regression, Gaussian Discriminant Analysis, Quadratic Discriminant Analysis, and SVM to predict the next day and long-term trend of stock movement and found that although it is hard to predict the next day trend with high accuracy, long-term trend prediction was able to have high accuracies [3]. Another study also showed that predicting stock movement of long term has higher accuracies than predicting the movement of next day. The study tried to predict the direction and strength of stock movement of next day and a week later using Multinomial Logistic Regression, Linear Discriminant Analysis, K-Nearest Neighbours Algorithm, and Multiclass Support Vector Machine [4]. A study tried to predict the stock movement using recurrent reinforcement learning. The result showed that trading with neural network’s aid still has high variance during volatile periods [5].


## 2.2. The Development of GCN and Applications in the Financial Domain

GCN is a state-of-the-art model attracting considerable critical attention [6]. It is a type of deep learning algorithm that uses graph to learn how to recognize objects in images. The main idea behind the GCN is that we can use the structure of an image as a representation for our data and then apply this representation to predict the object present in it [7]. Recently, GCN and subsequent variants have been applied in various areas, including social networks, chemistry, natural language processing, and computer vision [8–14]. However, it is has yet not commonly used in financial field.A study conducted early in 2005 used a graphic neural network for computing customized web page rank values and was able to show strong learning capacity [15]. Some recent studies have been conducted to use GCN in other areas. A study conducted in 2020 used a multimodel graphic neural network for microvideo recommendations [16]. The result significantly outperformed other popular recommendation methods. Another study was conducted in 2021 to use graphic neural network in traffic prediction [17]. It aimed to transform transportation information into optimized graphs to be input into the network so it can learn the relationships between road segments and predict transportation conditions.


## 2.3. The Automated Trading Systems

Up to now, several studies have attempted to evaluate the feasibility of automated trading systems using various methods, including classical time series prediction and machine learning [18]. Here, we gave some of the latest literature review about this topic.A study constructed trading system based on ANN and triple Exponential Moving Average (EMA) [19]. It turned to use ANN by demonstrating the ARIMA predictions of stock price completely out of measure. The network with input of 5-day data predicted the next day opening highest, lowest, and closing (OHLC) stock price, respectively, by adopting adaptive moment (Adam) optimization algorithm and Mean Absolute Error (MAE) loss function. For the part of the trading strategy, it combined triple EMA and ANN to define the entry/exit rules: when predicted lowest or highest stock price is lower than triple EMA lowest or highest, and predicted closing or opening is lower than the triple EMA closing or opening, the system will buy in; when predicted lowest or highest is higher than triple EMA lowest or highest, and predicted closing or opening is higher than the triple EMA closing or opening, the system will exit current position.Another study proposed a pattern-based stock trading system and also was predicted by ANN [20]. It applied three algorithms to form the clusters of data with high fluctuation patterns, with which input features including distance between MA and current price, rate of change (RC), candlestick body, upper shadow (US), lower shadow (LS), opening/highest/lowest price, slope of the volume moving average line, difference between the volume moving averages, and the total volume, are calculated. All features are normalized to 0∼1. Finally, the neural network will output a binary result marked by 1 if the price rises by more than 10% within 5 days and otherwise it is 0. The experimental result showed achieved accuracy of 96.23%. The trading policy of this system was 20% in profit realization rate and −12% in stop loss rate, with holding period of 19 days. A fund simulation showed a profit rate of 65% within 8 months.Some derived machine learning method is also popular in trading system. A long-short term memory based on leading indicators (LSTMLI) was used to classify the change of stock prices [21]. +0.01 and −0.01 are cutoff points of price rise and fall, between −0.01 and −0.01 is classified as unchanged. Then, a genetic algorithm is used to find the threshold of trading signals. It initialized the chromosome by producing two values for buy signal and sell signal. One of the two signals will be output if the predicted value is higher than corresponding chromosome value. After signal appears, Kelly criterion is used to optimize proportion of money invested in stock. The experimental results showed that Kelly criterion helps obtain much higher profit.The above literature discussed various evaluation metrics for models, profit, and risk. Mean Square Error (MSE), Root Mean Square Error (RMSE), MAE, Mean Absolute Percentage Error (MAPE), and Explained Variance Score (EVS) were applied to evaluate continuous prediction models’ performance. Accuracy, precision, recall, andF1 score are used to evaluate binary prediction performance. Maximum drawdown (MDD), Sharpe ratio (SR), Sortino ratio (SoR), and Calmar ratio (CR) were used for estimating the potential loss in value of the stock. The goodness of each trade was calculated by simple returns.As one of the new efficient machine learning methods, reinforcement learning plays an important role in the trading system as well [22–24]. It involves using a reward function that specifies how the system should behave. The algorithm then learns how to maximize the reward function by performing actions that lead to a higher reward and learns from its own past experiences how to improve future rewards. This paper did not include reinforcement learning but we consider it as a future research direction.


## 3. Framework

The whole framework proposed in this study is shown in Figure1. The historical prices and trading volume are used as input features. Multiple graphs are built first, with N stocks as the nodes. The historical prices and trading volume in the past L days are used as node features, in which the node feature for a single day is Xi∈RN×5, where the open, high, low, and close prices and trading volume add up to a total of 5 numerical values for graph i. Then, GCN modules are leveraged to capture the interdependencies among different stocks and the output is Yi∈RN×5. Then, the shortcut connection is added to combine the original features with GCN module outputs into Z∈RL∗M, where L is the lookback window and M=N×5×1+K; N is the stock number and K is the graph number used. Then, RNN module is further used to extract the temporal dependency and MLP module is to create binary movement prediction. Finally, the proposed trading system is used to conduct the trading simulation and financial evaluation.Figure 1
GCN-based forecasting framework with multiple graphs as inputs.


### 3.1. Graph Construction Method

In this study, the financial graphs are built as correlation graphs, to model the mutual influence among stocks. Choose two historical input time seriesti,tj from two different stocks i,j, e.g., the open, high, low, and close prices or trading volume; the element ai,j of the adjacency matrix A∈RN×N is calculated as the correlation between ti and tj; e.g., ai,j=corrti,tj. A truncated adjacency matrix can be further proposed and used, in which the absolute value of an individual element below a threshold is reset to zero, i.e., no relationship between the corresponding two stocks.


### 3.2. Forecasting Model

#### 3.2.1. GCN Module

In this study, GCN [6] is proposed to extract the interdependencies among different stocks, which is a truncated expansion in terms of Chebyshev polynomials up to 1st order from Chebyshev’s spectral CNN. Given the adjacency matrix A for a single graph and the node features X in a day, the output from the GCN module is as follows:(1)Y=WIN+D−1/2AD−1/2X,where W is the learnable parameter, IN is the identity matrix, and D is the degree matrix in which each element is the number of neighbor nodes.


#### 3.2.2. RNN Module

The recurrent neural network (RNN) module is used to capture the temporal dependency, in which the GCN output and the shortcut input are concatenated as the input variable. Two types of RNN are used in this study, namely, long-short term memory (LSTM) and gated recurrent unit (GRU), in which GRU is a simplified variant of LSTM.


#### 3.2.3. MLP Module

To generate a binary movement direction prediction, a multilayer perceptron (MLP) module is further used as the feedforward part, which takes the RNN module output as a vector input and the binary stock movement prediction forN stocks as the output vector.


### 3.3. Trading System Design

The trading system is designed as shown in Figure2. It sets available cash for each stock according to the portfolio optimization result and takes probability of signals to produce “Buy” or “Sell.” The signal is calculated through two sets of thresholds. If we do not limit the trading counts, “Buy” will be output if probability is bigger than 0.5; otherwise “Sell” will be output. Then, we place orders matching with the signal on the second day. With the limitation on trading counts, we only allow “Buy” when probability is over 0.7, while allowing “Sell” when it is lower than 0.3. If there is no further constraint on volatility, we trade on the second day. However, if volatility constraint is considered, the trading will occur only when the second day price change does not exceed 0.5% at the same direction of signal. All positions will be closed on the third day.Figure 2
Trading system design.


## 3.1. Graph Construction Method

In this study, the financial graphs are built as correlation graphs, to model the mutual influence among stocks. Choose two historical input time seriesti,tj from two different stocks i,j, e.g., the open, high, low, and close prices or trading volume; the element ai,j of the adjacency matrix A∈RN×N is calculated as the correlation between ti and tj; e.g., ai,j=corrti,tj. A truncated adjacency matrix can be further proposed and used, in which the absolute value of an individual element below a threshold is reset to zero, i.e., no relationship between the corresponding two stocks.


## 3.2. Forecasting Model

### 3.2.1. GCN Module

In this study, GCN [6] is proposed to extract the interdependencies among different stocks, which is a truncated expansion in terms of Chebyshev polynomials up to 1st order from Chebyshev’s spectral CNN. Given the adjacency matrix A for a single graph and the node features X in a day, the output from the GCN module is as follows:(1)Y=WIN+D−1/2AD−1/2X,where W is the learnable parameter, IN is the identity matrix, and D is the degree matrix in which each element is the number of neighbor nodes.


### 3.2.2. RNN Module

The recurrent neural network (RNN) module is used to capture the temporal dependency, in which the GCN output and the shortcut input are concatenated as the input variable. Two types of RNN are used in this study, namely, long-short term memory (LSTM) and gated recurrent unit (GRU), in which GRU is a simplified variant of LSTM.


### 3.2.3. MLP Module

To generate a binary movement direction prediction, a multilayer perceptron (MLP) module is further used as the feedforward part, which takes the RNN module output as a vector input and the binary stock movement prediction forN stocks as the output vector.


## 3.2.1. GCN Module

In this study, GCN [6] is proposed to extract the interdependencies among different stocks, which is a truncated expansion in terms of Chebyshev polynomials up to 1st order from Chebyshev’s spectral CNN. Given the adjacency matrix A for a single graph and the node features X in a day, the output from the GCN module is as follows:(1)Y=WIN+D−1/2AD−1/2X,where W is the learnable parameter, IN is the identity matrix, and D is the degree matrix in which each element is the number of neighbor nodes.


## 3.2.2. RNN Module

The recurrent neural network (RNN) module is used to capture the temporal dependency, in which the GCN output and the shortcut input are concatenated as the input variable. Two types of RNN are used in this study, namely, long-short term memory (LSTM) and gated recurrent unit (GRU), in which GRU is a simplified variant of LSTM.


## 3.2.3. MLP Module

To generate a binary movement direction prediction, a multilayer perceptron (MLP) module is further used as the feedforward part, which takes the RNN module output as a vector input and the binary stock movement prediction forN stocks as the output vector.


## 3.3. Trading System Design

The trading system is designed as shown in Figure2. It sets available cash for each stock according to the portfolio optimization result and takes probability of signals to produce “Buy” or “Sell.” The signal is calculated through two sets of thresholds. If we do not limit the trading counts, “Buy” will be output if probability is bigger than 0.5; otherwise “Sell” will be output. Then, we place orders matching with the signal on the second day. With the limitation on trading counts, we only allow “Buy” when probability is over 0.7, while allowing “Sell” when it is lower than 0.3. If there is no further constraint on volatility, we trade on the second day. However, if volatility constraint is considered, the trading will occur only when the second day price change does not exceed 0.5% at the same direction of signal. All positions will be closed on the third day.Figure 2
Trading system design.


## 4. Trading Evaluation

### 4.1. Settings

#### 4.1.1. Input

In this study, we choose ten stocks traded in the US stock market, with the largest market capitalization and an IPO date before January 1, 2012. Our selection is based on the market capitalization on March 3, 2022, and the selected stocks are listed in Table1.Table 1
Ten stocks used in this study.
SymbolCompanyMarket capitalization (in dollars)AAPLApple2.668TMSFTMicrosoft2.204TGOOGAlphabet (Google)1.751TAMZNAmazon1.482TTSLATesla908.28BBRK-ABerkshire Hathaway711.45BNVDANVIDIA571.56BUNHUnitedHealth469.17BVVisa436.35BJPMJPMorgan Chase399.69BThe whole time period considered in this study ranges from January 1, 2012, to December 31, 2021, and is split into training, validation, and test subsets as follows:(i)
Training: 2012-01-03 to 2017-12-31(ii)
Validation: 2018-01-01 to 2019-12-31(iii)
Testing: 2020-01-01 to 2021-12-30We use the historical price and trading volume time series in the training time period to calculate the correlation graphs. The adjacency matrices for price graphs are shown in Figures3–6. Since the price graphs are similar with each other, only the close price graph is used later in our experiments. The adjacency matrix for trading volume graph is shown in Figure 7.Figure 3
The adjacency matrix for open price graph.Figure 4
The adjacency matrix for high price graph.Figure 5
The adjacency matrix for low price graph.Figure 6
The adjacency matrix for close price graph.Figure 7
The adjacency matrix for trading volume graph.


#### 4.1.2. Model Settings

The historical prices and trading volume in the past ten days as the lookback window are used as input features in our forecasting framework, along with the close price and trading volume graphs.Two GCN layers are used in the GCN module, using the same input and output feature size. Two RNN layers are used in the RNN module, using 100 neurons in each layer, for both LSTM and GRU. Two fully connected layers with 100 neurons are used in the MLP module as the hidden layers and the output layer has 10 neurons and the sigmoid activation function. The predicted movement direction is up (i.e., 1) if the output value is greater than 0.5 and down (i.e., 0) otherwise. For deep learning modules, ReLU is used as the activation function, binary cross entropy loss is used as the loss function, Adam is used as the optimizer, and the training epoch is set to 1000 with a batch size of 32.LSTM and GRU models are both used as baselines. In other words, only the shortcut connection is used, without the graphs and GCN modules. Two machine learning models are further used as our baselines, namely, XGBoost and Random Forest models, with the hyperparameters searched with grid search in the validation set.


### 4.2. Evaluation Metrics

#### 4.2.1. Movement Prediction Evaluation

The evaluation metrics used for binary movement prediction evaluation include accuracy, recall, precision, andF1 score. The evaluation results in the test set are shown in Table 2. Two variants of our proposed methodology, namely, Multi-GCN-LSTM and Multi-GCN-GRU achieve the best accuracy and F1 score with a close performance.Table 2
Movement prediction evaluation result.
ModelAccuracyRecallPrecisionF1 scoreRandom Forest0.5090.6330.5420.584XGBoost0.5110.6360.5430.589GRU0.5130.7220.5390.617LSTM0.5110.6360.5430.586Multi-GCN-LSTM0.6210.7110.6350.671Multi-GCN-GRU0.6220.7640.6250.687


#### 4.2.2. Financial Evaluation

These evaluations are based on simulated trading with Random Forest, XGBoost, GRU, LSTM, GCN-GRU, and GCN-LSTM signals. The portfolio’s initial capital is $2 million. A baseline buying stocks with all cash on the first day and holding till the last day of backtesting is recorded for comparison. In the simulated trading with signals, we open position first with all cash when the price has been rising for last consecutive three days at close, and the signal generated yesterday is not “Sell.” Then, on the second day after that, the system will sell the previously bought positions and then buy or sell with all cash based on the newest signal and the specific strategy. All positions will be liquidated on the following day.The three trading strategies can buy long or sell short each day, depending on the model’s prediction. They all have a general constraint with selling short that the margin is 1.5 times of market value. The first trading strategy has no special limits on trades. When our model anticipates the price to go up on the day after tomorrow (the probability of the price rising is higher than 0.5), the system will generate a “Buy” signal for the next day. Or when our model anticipates the price to go down on the day after tomorrow (the probability of the price rising is lower than 0.5), the system will generate a “Sell” signal for the next day.The second trading strategy has a limit on the number of trades by adjusting the probability threshold. Previously, when the model predicts a probability higher than 0.5 for price going up, our system will generate a “Buy” signal. And if the probability is less than 0.5, the system will generate a “Sell” signal. Now, the threshold is set to 0.3 and 0.7, so, only when the probability is higher than 0.7, the system will generate a “Buy” signal, and only when the probability is less than 0.3, the system will generate a “Sell” signal. In this way, we will only trade when we are very certain that the price will rise or fall and not trade when we are not very sure. This limit is set to reduce the number of trades to avoid triggering the wash-sale rule.The third trading strategy has another limit on trades based on the next day’s volatility adding to the second strategy’s limit. Even if our model anticipates the price to go up with a probability higher than 70% on the day after tomorrow, if the price goes up more than 0.5% on the next day, the system will not generate any “Buy” or “Sell” signal. Even though the price of the day after tomorrow is predicted to be higher than the price of today, if the price goes up too much tomorrow, the price we actually buy in tomorrow will probably be higher than the day after tomorrow, so we should not continue with the “Buy” signal. In opposite, when the price goes down too much the next day, the system will not generate a “Sell” signal. This limit will prevent some trades from happening when the volatility of the market is high. Also, the system is now possible not to make any trades on a day, instead of generating either a “Buy” or a “Sell” signal. This limit is also set to reduce the number of trades to avoid triggering the wash-sale rule.The performances will be analyzed by their max drawdown, return, number of trades, Sharpe ratio, win rates (the number of trades that made profits/the number of trades), realized loss, final profits, and net income under four different weight distributions. The return is calculated based on profits not deducting taxes. The net income of the system is calculated by our final assets subtracted from the required tax to pay. The tax is calculated following the 2021 short-term and long-term capital gains tax rates for “single” status as shown in Tables3 and 4. For the trades triggering wash sale, the regarding taxable asset would be the sum of profit and loss. The baseline asset that will be held for two years will follow the long-term rates, and any profits that we make from trades with signals will follow the short-term rates.Table 3
2021 short-term capital gains tax rates.
Tax rate10%12%22%24%32%35%37%Taxable incomeUp to $9,950$9,950 to $40,525$40,525 to $86,375$86,375 to $164,925$164,925 to $209,425$209,425 to $523,600Over $523,600Table 4
2021 long-term capital gains tax rates.
Tax rate0%15%20%Taxable income$0 to $40,400$40,400 to $445,850Over $445,850(1) Unlimited Trading. Figure 8 shows asset change from 1/1/2020 to 12/31/2021 against different weights distribution for trading without limitation. Figure 9 shows trading counts from 1/1/2020 to 12/31/2021 against different weights distribution for trading without limitation.Figure 8
Asset change from 1/1/2020 to 12/31/2021 against different weights distribution for trading without limitation. (a) Portfolio with evenly distributed weights. (b)–(d) Portfolios with optimized weights against 20%, 30%, and 40% expected return in Markowitz portfolio optimization, respectively.
(a)(b)(c)(d)Figure 9
Trading counts from 1/1/2020 to 12/31/2021 against different weights distribution for trading without limitation. (a) Portfolio with evenly distributed weights. (b)–(d) Portfolios with optimized weights against 20%, 30%, and 40% expected return in Markowitz portfolio optimization, respectively.
(a)(b)(c)(d)Tables5 to 8 show the max drawdown, return, number of trades, Sharpe ratio, win rates (the number of trades that made profits/the number of trades), realized loss, final profits, and net income under four different weight distributions using the first strategy. This strategy has no special constraints on trades other than the 1.5 margin limit. The net income is the final result after deducting required taxes.Table 5
Summary for evenly distributed weight portfolio trading without limitation.
Evenly distributed weightModelMDDReturn (%)CountsSRWin rate (%)Loss (106)Profit (106)Net volume (106)Baseline0.3281.1312.141.621.33Random Forest0.1624.7648931.400.522.330.50−0.52XGBoost0.2138.1649091.420.503.560.76−0.80GRU0.2368.1349052.400.514.951.36−0.94LSTM0.28121.5649002.740.528.262.43−1.49Multi-GCN-GRU0.121097.0849039.210.5615.5221.948.12Multi-GCN-LSTM0.08569.0648949.790.5610.1911.383.43Table 6
Summary for 20% expected return weight portfolio trading without limitation.
20% Expected return weightModelMDDReturn (%)CountsSRWin rate (%)Loss (106)Profit (106)Net volume (106)Baseline0.3545.0611.310.900.75Random Forest0.22−3.814893−0.260.522.09−0.08−0.79XGBoost0.14−7.884909−0.640.501.17−0.16−0.70GRU0.1036.3849052.060.511.940.73−0.22LSTM0.268.6549000.490.522.950.17−0.95Multi-GCN-GRU0.05411.8249039.570.565.468.243.21Multi-GCN-LSTM0.08334.8248948.980.564.076.702.75Table 7
Summary for 30% expected return weight portfolio trading without limitation.
30% Expected return weightModelMDDReturn (%)CountsSRWin rate (%)Loss (106)Profit (106)Net volume (106)Baseline0.33103.9612.362.081.69Random Forest0.212.9448930.110.522.790.06−0.96XGBoost0.2520.7349090.640.504.120.42−1.23GRU0.2745.7549051.290.515.830.91−1.55LSTM0.36131.4349002.430.529.682.63−1.89Multi-GCN-GRU0.151335.7549038.570.5619.8026.729.54Multi-GCN-LSTM0.14877.4248948.690.5613.7417.556.01Table 8
Summary for 40% expected return weight portfolio trading without limitation.
40% Expected return weightModelMDDReturn (%)CountsSRWin rate (%)Loss (106)Profit (106)Net volume (106)Baseline0.37163.9112.463.282.65Random Forest0.3433.9948930.640.523.160.68−0.71XGBoost0.51−27.034909−0.700.502.01−0.54−1.05GRU0.54−30.534905−0.760.513.00−0.61−1.46LSTM0.4376.9249001.200.526.781.54−1.5Multi-GCN-GRU0.27634.0649034.520.565.0612.686.15Multi-GCN-LSTM0.211849.7848946.820.5614.6837.0017.91(2) Adjust Probability Threshold. Figure 10 shows asset change from 1/1/2020 to 12/31/2021 against different weights distribution for trading with adjusted probability threshold. Figure 11 shows trading counts from 1/1/2020 to 12/31/2021 against different weights distribution for trading with adjusted probability threshold.Figure 10
Asset change from 1/1/2020 to 12/31/2021 against different weights distribution for trading with adjusted probability threshold. (a) Portfolio with evenly distributed weights. (b)–(d) Portfolios with optimized weights against 20%, 30%, and 40% expected return in Markowitz portfolio, respectively.
(a)(b)(c)(d)Figure 11
Trading counts from 1/1/2020 to 12/31/2021 against different weights distribution for trading with adjusted probability threshold. (a) Portfolio with evenly distributed weights. (b)–(d) Portfolios with optimized weights against 20%, 30%, and 40% expected return in Markowitz portfolio optimization, respectively.
(a)(b)(c)(d)Tables9 to 12 show the max drawdown, return, number of trades, Sharpe ratio, win rates (the number of trades that made profits/the number of trades), realized loss, final profits, and net income under four different weight distributions using the second strategy. This strategy has a special constraint on trades that trades will only take place when the system is very certain about its prediction. The net income is the final result after deducting required taxes.Table 9
Summary for trading with adjusted probability threshold.
Evenly distributed weightModelMDDReturn (%)CountsSRWin rate (%)Loss (106)Profit (106)Net volume (106)Baseline0.3281.1312.141.621.33Random Forest0.1120.5322971.530.531.850.41−4.09XGBoost0.1325.9422901.660.512.110.52−0.42GRU0.1619.3119271.370.512.540.39−0.66LSTM0.12105.5211554.750.512.722.110.36Multi-GCN-GRU0.04293.21171811.390.591.755.863.08Multi-GCN-LSTM0.06209.66160110.990.622.234.191.85Table 10
Summary for 20% expected return weight portfolio trading without limitation.
20% Expected return weightModelMDDReturn (%)CountsSRWin rate (%)Loss (106)Profit (106)Net volume (106)Baseline0.3545.0611.310.900.75Random Forest0.14−3.792297−0.420.531.37−0.08−0.52XGBoost0.16−11.722290−1.340.511.21−0.23−0.56GRU0.091.0519270.080.511.160.02−0.38LSTM0.0716.6711552.230.510.650.330.00Multi-GCN-GRU0.03129.9717189.670.590.422.601.52Multi-GCN-LSTM0.03117.89160111.670.621.012.361.15Table 11
Summary for 30% expected return weight portfolio trading without limitation.
30% Expected return weightModelMDDReturn (%)CountsSRWin rate (%)Loss (106)Profit (106)Net volume (106)Baseline0.33103.9612.362.081.69Random Forest0.1417.8322970.870.532.240.36−0.57XGBoost0.1710.4822900.530.512.460.21−0.74GRU0.21−2.681927−0.170.513.21−0.05−1.19LSTM0.13121.9611554.480.513.162.440.40Multi-GCN-GRU0.05327.1417188.890.592.336.543.30Multi-GCN-LSTM0.06282.8816019.330.622.945.662.51Table 12
Summary for 40% expected return weight portfolio trading without limitation.
40% Expected return weightModelMDDReturn (%)CountsSRWin rate (%)Loss (106)Profit (106)Net volume (106)Baseline0.37163.9112.463.282.65Random Forest0.3461.9022971.330.532.561.24−0.13XGBoost0.1938.8422900.970.512.180.78−0.28GRU0.41−30.521927−1.240.512.26−0.28−1.19LSTM0.30−13.781155−0.700.512.34−0.28−1Multi-GCN-GRU0.12237.2217184.800.591.124.472.61Multi-GCN-LSTM0.09458.1316016.850.622.799.164.78(3) Constrain Volatility and Adjust Probability Threshold. Figure 12 shows asset change from 1/1/2020 to 12/31/2021 against different weights distribution for trading with adjusted probability threshold and constrained volatility. Figure 13 shows trading counts from 1/1/2020 to 12/31/2021 against different weights distribution for trading with adjusted probability threshold and constrained volatility.Figure 12
Asset change from 1/1/2020 to 12/31/2021 against different weights distribution for trading with adjusted probability threshold and constrained volatility. (a) Portfolio with evenly distributed weights. (b)–(d) Portfolios with optimized weights against 20%, 30%, and 40% expected return in Markowitz portfolio, respectively.
(a)(b)(c)(d)Figure 13
Trading counts from 1/1/2020 to 12/31/2021 against different weights distribution for trading with adjusted probability threshold and constrained volatility. (a) Portfolio with evenly distributed weights. (b)–(d) Portfolios with optimized weights against 20%, 30%, and 40% expected return in Markowitz portfolio, respectively.
(a)(b)(c)(d)Tables13 to 16 show the max drawdown, return, number of trades, Sharpe ratio, win rates (the number of trades that made profits/the number of trades), realized loss, final profits, and net income under four different weight distributions using the third strategy. This strategy has a special constraint on trades based on the next day’s movement. The net income is the final result after deducting required taxes.Table 13
Summary for trading with adjusted probability threshold and constrained volatility.
Evenly distributed weightModelMDDReturn (%)CountsSRWin rate (%)Loss (106)Profit (106)Net volume (106)Baseline0.3281.1312.141.621.33Random Forest0.0829.3713982.490.331.090.590.00XGBoost0.0737.9314223.100.331.120.760.10GRU0.0827.4811872.550.331.380.55−0.13LSTM0.0427.346803.650.291.010.550.01Multi-GCN-GRU0.02104.69109712.130.430.612.091.13Multi-GCN-LSTM0.05107.2996010.610.450.832.151.08Table 14
Summary for 20% expected return weight portfolio trading without limitation.
20% Expected return weightModelMDDReturn (%)CountsSRWin rate (%)Loss (106)Profit (106)Net volume (106)Baseline0.3545.0611.310.900.75Random Forest0.077.0513980.750.330.840.14−0.18XGBoost0.072.3214220.24790.330.770.05−0.22GRU0.065.0211870.580.330.710.10−0.16LSTM0.061.006800.140.290.290.02−0.06Multi-GCN-GRU0.0366.2310977.500.430.071.320.84Multi-GCN-LSTM0.0365.959609.090.450.491.320.69Table 15
Summary for 30% expected return weight portfolio trading without limitation.
30% Expected return weightModelMDDReturn (%)CountsSRWin rate (%)Loss (106)Profit (106)Net volume (106)Baseline0.33103.9612.362.081.69Random Forest0.1136.1113982.230.331.500.72−0.06XGBoost0.1139.4814222.420.331.470.79−0.01GRU0.1515.5411871.080.331.780.31−0.43LSTM0.0628.506802.870.291.180.57−0.04Multi-GCN-GRU0.03104.2410979.020.430.812.081.05Multi-GCN-LSTM0.06142.039608.910.451.052.841.44Table 16
Summary for 40% expected return weight portfolio trading without limitation.
40% Expected return weightModelMDDReturn (%)CountsSRWin rate (%)Loss (106)Profit (106)Net volume (106)Baseline0.37163.9112.463.282.65Random Forest0.1891.5613982.400.332.391.830.31XGBoost0.17124.1514223.080.331.832.480.92GRU0.2417.6911870.690.331.570.35−0.32LSTM0.1225.556801.380.291.340.51−0.14Multi-GCN-GRU0.06142.5210975.490.430.282.851.73Multi-GCN-LSTM0.06252.949606.700.450.665.062.98


## 4.1. Settings

### 4.1.1. Input

In this study, we choose ten stocks traded in the US stock market, with the largest market capitalization and an IPO date before January 1, 2012. Our selection is based on the market capitalization on March 3, 2022, and the selected stocks are listed in Table1.Table 1
Ten stocks used in this study.
SymbolCompanyMarket capitalization (in dollars)AAPLApple2.668TMSFTMicrosoft2.204TGOOGAlphabet (Google)1.751TAMZNAmazon1.482TTSLATesla908.28BBRK-ABerkshire Hathaway711.45BNVDANVIDIA571.56BUNHUnitedHealth469.17BVVisa436.35BJPMJPMorgan Chase399.69BThe whole time period considered in this study ranges from January 1, 2012, to December 31, 2021, and is split into training, validation, and test subsets as follows:(i)
Training: 2012-01-03 to 2017-12-31(ii)
Validation: 2018-01-01 to 2019-12-31(iii)
Testing: 2020-01-01 to 2021-12-30We use the historical price and trading volume time series in the training time period to calculate the correlation graphs. The adjacency matrices for price graphs are shown in Figures3–6. Since the price graphs are similar with each other, only the close price graph is used later in our experiments. The adjacency matrix for trading volume graph is shown in Figure 7.Figure 3
The adjacency matrix for open price graph.Figure 4
The adjacency matrix for high price graph.Figure 5
The adjacency matrix for low price graph.Figure 6
The adjacency matrix for close price graph.Figure 7
The adjacency matrix for trading volume graph.


### 4.1.2. Model Settings

The historical prices and trading volume in the past ten days as the lookback window are used as input features in our forecasting framework, along with the close price and trading volume graphs.Two GCN layers are used in the GCN module, using the same input and output feature size. Two RNN layers are used in the RNN module, using 100 neurons in each layer, for both LSTM and GRU. Two fully connected layers with 100 neurons are used in the MLP module as the hidden layers and the output layer has 10 neurons and the sigmoid activation function. The predicted movement direction is up (i.e., 1) if the output value is greater than 0.5 and down (i.e., 0) otherwise. For deep learning modules, ReLU is used as the activation function, binary cross entropy loss is used as the loss function, Adam is used as the optimizer, and the training epoch is set to 1000 with a batch size of 32.LSTM and GRU models are both used as baselines. In other words, only the shortcut connection is used, without the graphs and GCN modules. Two machine learning models are further used as our baselines, namely, XGBoost and Random Forest models, with the hyperparameters searched with grid search in the validation set.


## 4.1.1. Input

In this study, we choose ten stocks traded in the US stock market, with the largest market capitalization and an IPO date before January 1, 2012. Our selection is based on the market capitalization on March 3, 2022, and the selected stocks are listed in Table1.Table 1
Ten stocks used in this study.
SymbolCompanyMarket capitalization (in dollars)AAPLApple2.668TMSFTMicrosoft2.204TGOOGAlphabet (Google)1.751TAMZNAmazon1.482TTSLATesla908.28BBRK-ABerkshire Hathaway711.45BNVDANVIDIA571.56BUNHUnitedHealth469.17BVVisa436.35BJPMJPMorgan Chase399.69BThe whole time period considered in this study ranges from January 1, 2012, to December 31, 2021, and is split into training, validation, and test subsets as follows:(i)
Training: 2012-01-03 to 2017-12-31(ii)
Validation: 2018-01-01 to 2019-12-31(iii)
Testing: 2020-01-01 to 2021-12-30We use the historical price and trading volume time series in the training time period to calculate the correlation graphs. The adjacency matrices for price graphs are shown in Figures3–6. Since the price graphs are similar with each other, only the close price graph is used later in our experiments. The adjacency matrix for trading volume graph is shown in Figure 7.Figure 3
The adjacency matrix for open price graph.Figure 4
The adjacency matrix for high price graph.Figure 5
The adjacency matrix for low price graph.Figure 6
The adjacency matrix for close price graph.Figure 7
The adjacency matrix for trading volume graph.


## 4.1.2. Model Settings

The historical prices and trading volume in the past ten days as the lookback window are used as input features in our forecasting framework, along with the close price and trading volume graphs.Two GCN layers are used in the GCN module, using the same input and output feature size. Two RNN layers are used in the RNN module, using 100 neurons in each layer, for both LSTM and GRU. Two fully connected layers with 100 neurons are used in the MLP module as the hidden layers and the output layer has 10 neurons and the sigmoid activation function. The predicted movement direction is up (i.e., 1) if the output value is greater than 0.5 and down (i.e., 0) otherwise. For deep learning modules, ReLU is used as the activation function, binary cross entropy loss is used as the loss function, Adam is used as the optimizer, and the training epoch is set to 1000 with a batch size of 32.LSTM and GRU models are both used as baselines. In other words, only the shortcut connection is used, without the graphs and GCN modules. Two machine learning models are further used as our baselines, namely, XGBoost and Random Forest models, with the hyperparameters searched with grid search in the validation set.


## 4.2. Evaluation Metrics

### 4.2.1. Movement Prediction Evaluation

The evaluation metrics used for binary movement prediction evaluation include accuracy, recall, precision, andF1 score. The evaluation results in the test set are shown in Table 2. Two variants of our proposed methodology, namely, Multi-GCN-LSTM and Multi-GCN-GRU achieve the best accuracy and F1 score with a close performance.Table 2
Movement prediction evaluation result.
ModelAccuracyRecallPrecisionF1 scoreRandom Forest0.5090.6330.5420.584XGBoost0.5110.6360.5430.589GRU0.5130.7220.5390.617LSTM0.5110.6360.5430.586Multi-GCN-LSTM0.6210.7110.6350.671Multi-GCN-GRU0.6220.7640.6250.687


### 4.2.2. Financial Evaluation

These evaluations are based on simulated trading with Random Forest, XGBoost, GRU, LSTM, GCN-GRU, and GCN-LSTM signals. The portfolio’s initial capital is $2 million. A baseline buying stocks with all cash on the first day and holding till the last day of backtesting is recorded for comparison. In the simulated trading with signals, we open position first with all cash when the price has been rising for last consecutive three days at close, and the signal generated yesterday is not “Sell.” Then, on the second day after that, the system will sell the previously bought positions and then buy or sell with all cash based on the newest signal and the specific strategy. All positions will be liquidated on the following day.The three trading strategies can buy long or sell short each day, depending on the model’s prediction. They all have a general constraint with selling short that the margin is 1.5 times of market value. The first trading strategy has no special limits on trades. When our model anticipates the price to go up on the day after tomorrow (the probability of the price rising is higher than 0.5), the system will generate a “Buy” signal for the next day. Or when our model anticipates the price to go down on the day after tomorrow (the probability of the price rising is lower than 0.5), the system will generate a “Sell” signal for the next day.The second trading strategy has a limit on the number of trades by adjusting the probability threshold. Previously, when the model predicts a probability higher than 0.5 for price going up, our system will generate a “Buy” signal. And if the probability is less than 0.5, the system will generate a “Sell” signal. Now, the threshold is set to 0.3 and 0.7, so, only when the probability is higher than 0.7, the system will generate a “Buy” signal, and only when the probability is less than 0.3, the system will generate a “Sell” signal. In this way, we will only trade when we are very certain that the price will rise or fall and not trade when we are not very sure. This limit is set to reduce the number of trades to avoid triggering the wash-sale rule.The third trading strategy has another limit on trades based on the next day’s volatility adding to the second strategy’s limit. Even if our model anticipates the price to go up with a probability higher than 70% on the day after tomorrow, if the price goes up more than 0.5% on the next day, the system will not generate any “Buy” or “Sell” signal. Even though the price of the day after tomorrow is predicted to be higher than the price of today, if the price goes up too much tomorrow, the price we actually buy in tomorrow will probably be higher than the day after tomorrow, so we should not continue with the “Buy” signal. In opposite, when the price goes down too much the next day, the system will not generate a “Sell” signal. This limit will prevent some trades from happening when the volatility of the market is high. Also, the system is now possible not to make any trades on a day, instead of generating either a “Buy” or a “Sell” signal. This limit is also set to reduce the number of trades to avoid triggering the wash-sale rule.The performances will be analyzed by their max drawdown, return, number of trades, Sharpe ratio, win rates (the number of trades that made profits/the number of trades), realized loss, final profits, and net income under four different weight distributions. The return is calculated based on profits not deducting taxes. The net income of the system is calculated by our final assets subtracted from the required tax to pay. The tax is calculated following the 2021 short-term and long-term capital gains tax rates for “single” status as shown in Tables3 and 4. For the trades triggering wash sale, the regarding taxable asset would be the sum of profit and loss. The baseline asset that will be held for two years will follow the long-term rates, and any profits that we make from trades with signals will follow the short-term rates.Table 3
2021 short-term capital gains tax rates.
Tax rate10%12%22%24%32%35%37%Taxable incomeUp to $9,950$9,950 to $40,525$40,525 to $86,375$86,375 to $164,925$164,925 to $209,425$209,425 to $523,600Over $523,600Table 4
2021 long-term capital gains tax rates.
Tax rate0%15%20%Taxable income$0 to $40,400$40,400 to $445,850Over $445,850(1) Unlimited Trading. Figure 8 shows asset change from 1/1/2020 to 12/31/2021 against different weights distribution for trading without limitation. Figure 9 shows trading counts from 1/1/2020 to 12/31/2021 against different weights distribution for trading without limitation.Figure 8
Asset change from 1/1/2020 to 12/31/2021 against different weights distribution for trading without limitation. (a) Portfolio with evenly distributed weights. (b)–(d) Portfolios with optimized weights against 20%, 30%, and 40% expected return in Markowitz portfolio optimization, respectively.
(a)(b)(c)(d)Figure 9
Trading counts from 1/1/2020 to 12/31/2021 against different weights distribution for trading without limitation. (a) Portfolio with evenly distributed weights. (b)–(d) Portfolios with optimized weights against 20%, 30%, and 40% expected return in Markowitz portfolio optimization, respectively.
(a)(b)(c)(d)Tables5 to 8 show the max drawdown, return, number of trades, Sharpe ratio, win rates (the number of trades that made profits/the number of trades), realized loss, final profits, and net income under four different weight distributions using the first strategy. This strategy has no special constraints on trades other than the 1.5 margin limit. The net income is the final result after deducting required taxes.Table 5
Summary for evenly distributed weight portfolio trading without limitation.
Evenly distributed weightModelMDDReturn (%)CountsSRWin rate (%)Loss (106)Profit (106)Net volume (106)Baseline0.3281.1312.141.621.33Random Forest0.1624.7648931.400.522.330.50−0.52XGBoost0.2138.1649091.420.503.560.76−0.80GRU0.2368.1349052.400.514.951.36−0.94LSTM0.28121.5649002.740.528.262.43−1.49Multi-GCN-GRU0.121097.0849039.210.5615.5221.948.12Multi-GCN-LSTM0.08569.0648949.790.5610.1911.383.43Table 6
Summary for 20% expected return weight portfolio trading without limitation.
20% Expected return weightModelMDDReturn (%)CountsSRWin rate (%)Loss (106)Profit (106)Net volume (106)Baseline0.3545.0611.310.900.75Random Forest0.22−3.814893−0.260.522.09−0.08−0.79XGBoost0.14−7.884909−0.640.501.17−0.16−0.70GRU0.1036.3849052.060.511.940.73−0.22LSTM0.268.6549000.490.522.950.17−0.95Multi-GCN-GRU0.05411.8249039.570.565.468.243.21Multi-GCN-LSTM0.08334.8248948.980.564.076.702.75Table 7
Summary for 30% expected return weight portfolio trading without limitation.
30% Expected return weightModelMDDReturn (%)CountsSRWin rate (%)Loss (106)Profit (106)Net volume (106)Baseline0.33103.9612.362.081.69Random Forest0.212.9448930.110.522.790.06−0.96XGBoost0.2520.7349090.640.504.120.42−1.23GRU0.2745.7549051.290.515.830.91−1.55LSTM0.36131.4349002.430.529.682.63−1.89Multi-GCN-GRU0.151335.7549038.570.5619.8026.729.54Multi-GCN-LSTM0.14877.4248948.690.5613.7417.556.01Table 8
Summary for 40% expected return weight portfolio trading without limitation.
40% Expected return weightModelMDDReturn (%)CountsSRWin rate (%)Loss (106)Profit (106)Net volume (106)Baseline0.37163.9112.463.282.65Random Forest0.3433.9948930.640.523.160.68−0.71XGBoost0.51−27.034909−0.700.502.01−0.54−1.05GRU0.54−30.534905−0.760.513.00−0.61−1.46LSTM0.4376.9249001.200.526.781.54−1.5Multi-GCN-GRU0.27634.0649034.520.565.0612.686.15Multi-GCN-LSTM0.211849.7848946.820.5614.6837.0017.91(2) Adjust Probability Threshold. Figure 10 shows asset change from 1/1/2020 to 12/31/2021 against different weights distribution for trading with adjusted probability threshold. Figure 11 shows trading counts from 1/1/2020 to 12/31/2021 against different weights distribution for trading with adjusted probability threshold.Figure 10
Asset change from 1/1/2020 to 12/31/2021 against different weights distribution for trading with adjusted probability threshold. (a) Portfolio with evenly distributed weights. (b)–(d) Portfolios with optimized weights against 20%, 30%, and 40% expected return in Markowitz portfolio, respectively.
(a)(b)(c)(d)Figure 11
Trading counts from 1/1/2020 to 12/31/2021 against different weights distribution for trading with adjusted probability threshold. (a) Portfolio with evenly distributed weights. (b)–(d) Portfolios with optimized weights against 20%, 30%, and 40% expected return in Markowitz portfolio optimization, respectively.
(a)(b)(c)(d)Tables9 to 12 show the max drawdown, return, number of trades, Sharpe ratio, win rates (the number of trades that made profits/the number of trades), realized loss, final profits, and net income under four different weight distributions using the second strategy. This strategy has a special constraint on trades that trades will only take place when the system is very certain about its prediction. The net income is the final result after deducting required taxes.Table 9
Summary for trading with adjusted probability threshold.
Evenly distributed weightModelMDDReturn (%)CountsSRWin rate (%)Loss (106)Profit (106)Net volume (106)Baseline0.3281.1312.141.621.33Random Forest0.1120.5322971.530.531.850.41−4.09XGBoost0.1325.9422901.660.512.110.52−0.42GRU0.1619.3119271.370.512.540.39−0.66LSTM0.12105.5211554.750.512.722.110.36Multi-GCN-GRU0.04293.21171811.390.591.755.863.08Multi-GCN-LSTM0.06209.66160110.990.622.234.191.85Table 10
Summary for 20% expected return weight portfolio trading without limitation.
20% Expected return weightModelMDDReturn (%)CountsSRWin rate (%)Loss (106)Profit (106)Net volume (106)Baseline0.3545.0611.310.900.75Random Forest0.14−3.792297−0.420.531.37−0.08−0.52XGBoost0.16−11.722290−1.340.511.21−0.23−0.56GRU0.091.0519270.080.511.160.02−0.38LSTM0.0716.6711552.230.510.650.330.00Multi-GCN-GRU0.03129.9717189.670.590.422.601.52Multi-GCN-LSTM0.03117.89160111.670.621.012.361.15Table 11
Summary for 30% expected return weight portfolio trading without limitation.
30% Expected return weightModelMDDReturn (%)CountsSRWin rate (%)Loss (106)Profit (106)Net volume (106)Baseline0.33103.9612.362.081.69Random Forest0.1417.8322970.870.532.240.36−0.57XGBoost0.1710.4822900.530.512.460.21−0.74GRU0.21−2.681927−0.170.513.21−0.05−1.19LSTM0.13121.9611554.480.513.162.440.40Multi-GCN-GRU0.05327.1417188.890.592.336.543.30Multi-GCN-LSTM0.06282.8816019.330.622.945.662.51Table 12
Summary for 40% expected return weight portfolio trading without limitation.
40% Expected return weightModelMDDReturn (%)CountsSRWin rate (%)Loss (106)Profit (106)Net volume (106)Baseline0.37163.9112.463.282.65Random Forest0.3461.9022971.330.532.561.24−0.13XGBoost0.1938.8422900.970.512.180.78−0.28GRU0.41−30.521927−1.240.512.26−0.28−1.19LSTM0.30−13.781155−0.700.512.34−0.28−1Multi-GCN-GRU0.12237.2217184.800.591.124.472.61Multi-GCN-LSTM0.09458.1316016.850.622.799.164.78(3) Constrain Volatility and Adjust Probability Threshold. Figure 12 shows asset change from 1/1/2020 to 12/31/2021 against different weights distribution for trading with adjusted probability threshold and constrained volatility. Figure 13 shows trading counts from 1/1/2020 to 12/31/2021 against different weights distribution for trading with adjusted probability threshold and constrained volatility.Figure 12
Asset change from 1/1/2020 to 12/31/2021 against different weights distribution for trading with adjusted probability threshold and constrained volatility. (a) Portfolio with evenly distributed weights. (b)–(d) Portfolios with optimized weights against 20%, 30%, and 40% expected return in Markowitz portfolio, respectively.
(a)(b)(c)(d)Figure 13
Trading counts from 1/1/2020 to 12/31/2021 against different weights distribution for trading with adjusted probability threshold and constrained volatility. (a) Portfolio with evenly distributed weights. (b)–(d) Portfolios with optimized weights against 20%, 30%, and 40% expected return in Markowitz portfolio, respectively.
(a)(b)(c)(d)Tables13 to 16 show the max drawdown, return, number of trades, Sharpe ratio, win rates (the number of trades that made profits/the number of trades), realized loss, final profits, and net income under four different weight distributions using the third strategy. This strategy has a special constraint on trades based on the next day’s movement. The net income is the final result after deducting required taxes.Table 13
Summary for trading with adjusted probability threshold and constrained volatility.
Evenly distributed weightModelMDDReturn (%)CountsSRWin rate (%)Loss (106)Profit (106)Net volume (106)Baseline0.3281.1312.141.621.33Random Forest0.0829.3713982.490.331.090.590.00XGBoost0.0737.9314223.100.331.120.760.10GRU0.0827.4811872.550.331.380.55−0.13LSTM0.0427.346803.650.291.010.550.01Multi-GCN-GRU0.02104.69109712.130.430.612.091.13Multi-GCN-LSTM0.05107.2996010.610.450.832.151.08Table 14
Summary for 20% expected return weight portfolio trading without limitation.
20% Expected return weightModelMDDReturn (%)CountsSRWin rate (%)Loss (106)Profit (106)Net volume (106)Baseline0.3545.0611.310.900.75Random Forest0.077.0513980.750.330.840.14−0.18XGBoost0.072.3214220.24790.330.770.05−0.22GRU0.065.0211870.580.330.710.10−0.16LSTM0.061.006800.140.290.290.02−0.06Multi-GCN-GRU0.0366.2310977.500.430.071.320.84Multi-GCN-LSTM0.0365.959609.090.450.491.320.69Table 15
Summary for 30% expected return weight portfolio trading without limitation.
30% Expected return weightModelMDDReturn (%)CountsSRWin rate (%)Loss (106)Profit (106)Net volume (106)Baseline0.33103.9612.362.081.69Random Forest0.1136.1113982.230.331.500.72−0.06XGBoost0.1139.4814222.420.331.470.79−0.01GRU0.1515.5411871.080.331.780.31−0.43LSTM0.0628.506802.870.291.180.57−0.04Multi-GCN-GRU0.03104.2410979.020.430.812.081.05Multi-GCN-LSTM0.06142.039608.910.451.052.841.44Table 16
Summary for 40% expected return weight portfolio trading without limitation.
40% Expected return weightModelMDDReturn (%)CountsSRWin rate (%)Loss (106)Profit (106)Net volume (106)Baseline0.37163.9112.463.282.65Random Forest0.1891.5613982.400.332.391.830.31XGBoost0.17124.1514223.080.331.832.480.92GRU0.2417.6911870.690.331.570.35−0.32LSTM0.1225.556801.380.291.340.51−0.14Multi-GCN-GRU0.06142.5210975.490.430.282.851.73Multi-GCN-LSTM0.06252.949606.700.450.665.062.98


## 4.2.1. Movement Prediction Evaluation

The evaluation metrics used for binary movement prediction evaluation include accuracy, recall, precision, andF1 score. The evaluation results in the test set are shown in Table 2. Two variants of our proposed methodology, namely, Multi-GCN-LSTM and Multi-GCN-GRU achieve the best accuracy and F1 score with a close performance.Table 2
Movement prediction evaluation result.
ModelAccuracyRecallPrecisionF1 scoreRandom Forest0.5090.6330.5420.584XGBoost0.5110.6360.5430.589GRU0.5130.7220.5390.617LSTM0.5110.6360.5430.586Multi-GCN-LSTM0.6210.7110.6350.671Multi-GCN-GRU0.6220.7640.6250.687


## 4.2.2. Financial Evaluation

These evaluations are based on simulated trading with Random Forest, XGBoost, GRU, LSTM, GCN-GRU, and GCN-LSTM signals. The portfolio’s initial capital is $2 million. A baseline buying stocks with all cash on the first day and holding till the last day of backtesting is recorded for comparison. In the simulated trading with signals, we open position first with all cash when the price has been rising for last consecutive three days at close, and the signal generated yesterday is not “Sell.” Then, on the second day after that, the system will sell the previously bought positions and then buy or sell with all cash based on the newest signal and the specific strategy. All positions will be liquidated on the following day.The three trading strategies can buy long or sell short each day, depending on the model’s prediction. They all have a general constraint with selling short that the margin is 1.5 times of market value. The first trading strategy has no special limits on trades. When our model anticipates the price to go up on the day after tomorrow (the probability of the price rising is higher than 0.5), the system will generate a “Buy” signal for the next day. Or when our model anticipates the price to go down on the day after tomorrow (the probability of the price rising is lower than 0.5), the system will generate a “Sell” signal for the next day.The second trading strategy has a limit on the number of trades by adjusting the probability threshold. Previously, when the model predicts a probability higher than 0.5 for price going up, our system will generate a “Buy” signal. And if the probability is less than 0.5, the system will generate a “Sell” signal. Now, the threshold is set to 0.3 and 0.7, so, only when the probability is higher than 0.7, the system will generate a “Buy” signal, and only when the probability is less than 0.3, the system will generate a “Sell” signal. In this way, we will only trade when we are very certain that the price will rise or fall and not trade when we are not very sure. This limit is set to reduce the number of trades to avoid triggering the wash-sale rule.The third trading strategy has another limit on trades based on the next day’s volatility adding to the second strategy’s limit. Even if our model anticipates the price to go up with a probability higher than 70% on the day after tomorrow, if the price goes up more than 0.5% on the next day, the system will not generate any “Buy” or “Sell” signal. Even though the price of the day after tomorrow is predicted to be higher than the price of today, if the price goes up too much tomorrow, the price we actually buy in tomorrow will probably be higher than the day after tomorrow, so we should not continue with the “Buy” signal. In opposite, when the price goes down too much the next day, the system will not generate a “Sell” signal. This limit will prevent some trades from happening when the volatility of the market is high. Also, the system is now possible not to make any trades on a day, instead of generating either a “Buy” or a “Sell” signal. This limit is also set to reduce the number of trades to avoid triggering the wash-sale rule.The performances will be analyzed by their max drawdown, return, number of trades, Sharpe ratio, win rates (the number of trades that made profits/the number of trades), realized loss, final profits, and net income under four different weight distributions. The return is calculated based on profits not deducting taxes. The net income of the system is calculated by our final assets subtracted from the required tax to pay. The tax is calculated following the 2021 short-term and long-term capital gains tax rates for “single” status as shown in Tables3 and 4. For the trades triggering wash sale, the regarding taxable asset would be the sum of profit and loss. The baseline asset that will be held for two years will follow the long-term rates, and any profits that we make from trades with signals will follow the short-term rates.Table 3
2021 short-term capital gains tax rates.
Tax rate10%12%22%24%32%35%37%Taxable incomeUp to $9,950$9,950 to $40,525$40,525 to $86,375$86,375 to $164,925$164,925 to $209,425$209,425 to $523,600Over $523,600Table 4
2021 long-term capital gains tax rates.
Tax rate0%15%20%Taxable income$0 to $40,400$40,400 to $445,850Over $445,850(1) Unlimited Trading. Figure 8 shows asset change from 1/1/2020 to 12/31/2021 against different weights distribution for trading without limitation. Figure 9 shows trading counts from 1/1/2020 to 12/31/2021 against different weights distribution for trading without limitation.Figure 8
Asset change from 1/1/2020 to 12/31/2021 against different weights distribution for trading without limitation. (a) Portfolio with evenly distributed weights. (b)–(d) Portfolios with optimized weights against 20%, 30%, and 40% expected return in Markowitz portfolio optimization, respectively.
(a)(b)(c)(d)Figure 9
Trading counts from 1/1/2020 to 12/31/2021 against different weights distribution for trading without limitation. (a) Portfolio with evenly distributed weights. (b)–(d) Portfolios with optimized weights against 20%, 30%, and 40% expected return in Markowitz portfolio optimization, respectively.
(a)(b)(c)(d)Tables5 to 8 show the max drawdown, return, number of trades, Sharpe ratio, win rates (the number of trades that made profits/the number of trades), realized loss, final profits, and net income under four different weight distributions using the first strategy. This strategy has no special constraints on trades other than the 1.5 margin limit. The net income is the final result after deducting required taxes.Table 5
Summary for evenly distributed weight portfolio trading without limitation.
Evenly distributed weightModelMDDReturn (%)CountsSRWin rate (%)Loss (106)Profit (106)Net volume (106)Baseline0.3281.1312.141.621.33Random Forest0.1624.7648931.400.522.330.50−0.52XGBoost0.2138.1649091.420.503.560.76−0.80GRU0.2368.1349052.400.514.951.36−0.94LSTM0.28121.5649002.740.528.262.43−1.49Multi-GCN-GRU0.121097.0849039.210.5615.5221.948.12Multi-GCN-LSTM0.08569.0648949.790.5610.1911.383.43Table 6
Summary for 20% expected return weight portfolio trading without limitation.
20% Expected return weightModelMDDReturn (%)CountsSRWin rate (%)Loss (106)Profit (106)Net volume (106)Baseline0.3545.0611.310.900.75Random Forest0.22−3.814893−0.260.522.09−0.08−0.79XGBoost0.14−7.884909−0.640.501.17−0.16−0.70GRU0.1036.3849052.060.511.940.73−0.22LSTM0.268.6549000.490.522.950.17−0.95Multi-GCN-GRU0.05411.8249039.570.565.468.243.21Multi-GCN-LSTM0.08334.8248948.980.564.076.702.75Table 7
Summary for 30% expected return weight portfolio trading without limitation.
30% Expected return weightModelMDDReturn (%)CountsSRWin rate (%)Loss (106)Profit (106)Net volume (106)Baseline0.33103.9612.362.081.69Random Forest0.212.9448930.110.522.790.06−0.96XGBoost0.2520.7349090.640.504.120.42−1.23GRU0.2745.7549051.290.515.830.91−1.55LSTM0.36131.4349002.430.529.682.63−1.89Multi-GCN-GRU0.151335.7549038.570.5619.8026.729.54Multi-GCN-LSTM0.14877.4248948.690.5613.7417.556.01Table 8
Summary for 40% expected return weight portfolio trading without limitation.
40% Expected return weightModelMDDReturn (%)CountsSRWin rate (%)Loss (106)Profit (106)Net volume (106)Baseline0.37163.9112.463.282.65Random Forest0.3433.9948930.640.523.160.68−0.71XGBoost0.51−27.034909−0.700.502.01−0.54−1.05GRU0.54−30.534905−0.760.513.00−0.61−1.46LSTM0.4376.9249001.200.526.781.54−1.5Multi-GCN-GRU0.27634.0649034.520.565.0612.686.15Multi-GCN-LSTM0.211849.7848946.820.5614.6837.0017.91(2) Adjust Probability Threshold. Figure 10 shows asset change from 1/1/2020 to 12/31/2021 against different weights distribution for trading with adjusted probability threshold. Figure 11 shows trading counts from 1/1/2020 to 12/31/2021 against different weights distribution for trading with adjusted probability threshold.Figure 10
Asset change from 1/1/2020 to 12/31/2021 against different weights distribution for trading with adjusted probability threshold. (a) Portfolio with evenly distributed weights. (b)–(d) Portfolios with optimized weights against 20%, 30%, and 40% expected return in Markowitz portfolio, respectively.
(a)(b)(c)(d)Figure 11
Trading counts from 1/1/2020 to 12/31/2021 against different weights distribution for trading with adjusted probability threshold. (a) Portfolio with evenly distributed weights. (b)–(d) Portfolios with optimized weights against 20%, 30%, and 40% expected return in Markowitz portfolio optimization, respectively.
(a)(b)(c)(d)Tables9 to 12 show the max drawdown, return, number of trades, Sharpe ratio, win rates (the number of trades that made profits/the number of trades), realized loss, final profits, and net income under four different weight distributions using the second strategy. This strategy has a special constraint on trades that trades will only take place when the system is very certain about its prediction. The net income is the final result after deducting required taxes.Table 9
Summary for trading with adjusted probability threshold.
Evenly distributed weightModelMDDReturn (%)CountsSRWin rate (%)Loss (106)Profit (106)Net volume (106)Baseline0.3281.1312.141.621.33Random Forest0.1120.5322971.530.531.850.41−4.09XGBoost0.1325.9422901.660.512.110.52−0.42GRU0.1619.3119271.370.512.540.39−0.66LSTM0.12105.5211554.750.512.722.110.36Multi-GCN-GRU0.04293.21171811.390.591.755.863.08Multi-GCN-LSTM0.06209.66160110.990.622.234.191.85Table 10
Summary for 20% expected return weight portfolio trading without limitation.
20% Expected return weightModelMDDReturn (%)CountsSRWin rate (%)Loss (106)Profit (106)Net volume (106)Baseline0.3545.0611.310.900.75Random Forest0.14−3.792297−0.420.531.37−0.08−0.52XGBoost0.16−11.722290−1.340.511.21−0.23−0.56GRU0.091.0519270.080.511.160.02−0.38LSTM0.0716.6711552.230.510.650.330.00Multi-GCN-GRU0.03129.9717189.670.590.422.601.52Multi-GCN-LSTM0.03117.89160111.670.621.012.361.15Table 11
Summary for 30% expected return weight portfolio trading without limitation.
30% Expected return weightModelMDDReturn (%)CountsSRWin rate (%)Loss (106)Profit (106)Net volume (106)Baseline0.33103.9612.362.081.69Random Forest0.1417.8322970.870.532.240.36−0.57XGBoost0.1710.4822900.530.512.460.21−0.74GRU0.21−2.681927−0.170.513.21−0.05−1.19LSTM0.13121.9611554.480.513.162.440.40Multi-GCN-GRU0.05327.1417188.890.592.336.543.30Multi-GCN-LSTM0.06282.8816019.330.622.945.662.51Table 12
Summary for 40% expected return weight portfolio trading without limitation.
40% Expected return weightModelMDDReturn (%)CountsSRWin rate (%)Loss (106)Profit (106)Net volume (106)Baseline0.37163.9112.463.282.65Random Forest0.3461.9022971.330.532.561.24−0.13XGBoost0.1938.8422900.970.512.180.78−0.28GRU0.41−30.521927−1.240.512.26−0.28−1.19LSTM0.30−13.781155−0.700.512.34−0.28−1Multi-GCN-GRU0.12237.2217184.800.591.124.472.61Multi-GCN-LSTM0.09458.1316016.850.622.799.164.78(3) Constrain Volatility and Adjust Probability Threshold. Figure 12 shows asset change from 1/1/2020 to 12/31/2021 against different weights distribution for trading with adjusted probability threshold and constrained volatility. Figure 13 shows trading counts from 1/1/2020 to 12/31/2021 against different weights distribution for trading with adjusted probability threshold and constrained volatility.Figure 12
Asset change from 1/1/2020 to 12/31/2021 against different weights distribution for trading with adjusted probability threshold and constrained volatility. (a) Portfolio with evenly distributed weights. (b)–(d) Portfolios with optimized weights against 20%, 30%, and 40% expected return in Markowitz portfolio, respectively.
(a)(b)(c)(d)Figure 13
Trading counts from 1/1/2020 to 12/31/2021 against different weights distribution for trading with adjusted probability threshold and constrained volatility. (a) Portfolio with evenly distributed weights. (b)–(d) Portfolios with optimized weights against 20%, 30%, and 40% expected return in Markowitz portfolio, respectively.
(a)(b)(c)(d)Tables13 to 16 show the max drawdown, return, number of trades, Sharpe ratio, win rates (the number of trades that made profits/the number of trades), realized loss, final profits, and net income under four different weight distributions using the third strategy. This strategy has a special constraint on trades based on the next day’s movement. The net income is the final result after deducting required taxes.Table 13
Summary for trading with adjusted probability threshold and constrained volatility.
Evenly distributed weightModelMDDReturn (%)CountsSRWin rate (%)Loss (106)Profit (106)Net volume (106)Baseline0.3281.1312.141.621.33Random Forest0.0829.3713982.490.331.090.590.00XGBoost0.0737.9314223.100.331.120.760.10GRU0.0827.4811872.550.331.380.55−0.13LSTM0.0427.346803.650.291.010.550.01Multi-GCN-GRU0.02104.69109712.130.430.612.091.13Multi-GCN-LSTM0.05107.2996010.610.450.832.151.08Table 14
Summary for 20% expected return weight portfolio trading without limitation.
20% Expected return weightModelMDDReturn (%)CountsSRWin rate (%)Loss (106)Profit (106)Net volume (106)Baseline0.3545.0611.310.900.75Random Forest0.077.0513980.750.330.840.14−0.18XGBoost0.072.3214220.24790.330.770.05−0.22GRU0.065.0211870.580.330.710.10−0.16LSTM0.061.006800.140.290.290.02−0.06Multi-GCN-GRU0.0366.2310977.500.430.071.320.84Multi-GCN-LSTM0.0365.959609.090.450.491.320.69Table 15
Summary for 30% expected return weight portfolio trading without limitation.
30% Expected return weightModelMDDReturn (%)CountsSRWin rate (%)Loss (106)Profit (106)Net volume (106)Baseline0.33103.9612.362.081.69Random Forest0.1136.1113982.230.331.500.72−0.06XGBoost0.1139.4814222.420.331.470.79−0.01GRU0.1515.5411871.080.331.780.31−0.43LSTM0.0628.506802.870.291.180.57−0.04Multi-GCN-GRU0.03104.2410979.020.430.812.081.05Multi-GCN-LSTM0.06142.039608.910.451.052.841.44Table 16
Summary for 40% expected return weight portfolio trading without limitation.
40% Expected return weightModelMDDReturn (%)CountsSRWin rate (%)Loss (106)Profit (106)Net volume (106)Baseline0.37163.9112.463.282.65Random Forest0.1891.5613982.400.332.391.830.31XGBoost0.17124.1514223.080.331.832.480.92GRU0.2417.6911870.690.331.570.35−0.32LSTM0.1225.556801.380.291.340.51−0.14Multi-GCN-GRU0.06142.5210975.490.430.282.851.73Multi-GCN-LSTM0.06252.949606.700.450.665.062.98


## 5. Discussion

Tables5 to 16 show the results for different models using different weights across three different strategies. Comparing the resulting net income of different models, the Multi-GCN-GRU and Multi-GCN-LSTM have all positive net income and are much higher than all the other models in nearly all the cases, with the best performance under 40% expected return weights in the first strategy, where Multi-GCN-LSTM resulted in net income of $17.91 million. The net income of most of the other models in most of the cases is lower than the baseline, and many of them are negative. This is not because the model itself is losing money; the profit column is mostly positive. But the net income became negative because the taxes that they need to pay exceeded the profit amount and brought the net income to negative. This shows that the effect of taxes is unneglectable and can easily offset the profits gained by trades under many popular models. The Multi-GCN-GRU and Multi-GCN-LSTM models also have relatively very small max drawdowns compared to other models across different weights and different strategies, which show their advantage of consistency. Even, in the case where net income was the highest ($17.91million), the max drawdown was only 0.21, whereas other models had max drawdowns higher than 0.3 under the same weighting method and strategy.Another interesting trend shown in the tables is that the Multi-GCN-GRU and Multi-GCN-LSTM used in the first strategy generated higher net income than the second and the third strategies, while also having higher max drawdowns. And the highest net income also occurred in the first strategy when the expected return was 40%. Although the first strategy has no constraints on trades and therefore would need to pay more taxes and suffer higher potential drawdowns, the more trades that it made generated even more profits that not only covered the loss but also added more to the net income. This can be proven by comparing the trade counts column. The first strategy has much higher trade counts for all models, taking usually more than 4000 trades, while the second and the third strategy have much fewer trade counts because they are under different constraints, taking only about half of the trades compared to the first strategy. This result shows that although adding more constraints can reduce loss from taxes, it is still better to make more trades under a good performing model because the profit will be able to cover the taxes.A factor that was not taken into account in this trading system results calculation is the transaction costs. This factor was not considered because the asset amount being traded is large enough that the transaction cost would not have any notable impact. Therefore, having more trade counts has no penalty in this aspect. However, if the asset amount is small, the calculations would need to include this factor to be more realistic. In that case, the first strategy might be performing as strongly as it is now because it has the most trade counts, while the second and the third strategies might not be impacted as much since they have much lower trade counts.


## 6. Conclusion

In this paper, we proposed a GCN-based framework on stock forecasting. We compared its performance with other popular models, which include Random Forest, XGBoost, GRU, and LSTM. This framework also considered the impact of taxes to be more realistic. The test was done under three different strategies with different constraints on trades, and each strategy has different weighting methods decided by the expected return levels. The results validated the usefulness of the framework that we proposed, as it generated the highest net income in all scenarios and are much higher than the other models’ and benchmark’s net income. Other popular models could also generate positive profits from trades, but their profits are very close to 0, so, after deducting from the required taxes, the overall net income is either very small or negative. GCN was able to generate large enough profits that, even after deducting from taxes, still have very high net income results.Some future directions can be done following this research. One is adding more stocks to test the model’s effectiveness. The second is to try this model in different markets to test its consistency, and the third is to add more features as inputs such as technical indicators and macroeconomics features to see if the model will be improved.



---

*Source: 3598285-2022-07-30.xml*