SSTP: Stock Sector Trend Prediction with Temporal-Spatial Network

In financial big data field, most existing work of stock prediction has focused on the prediction of a single stock trend. However, it is challenging to predict a stock price series due to its drastic volatility. While the stock sector is a group of stocks belonging to the same sector, and the stock sector index is the weighted sum of the prices of all the stocks in the sector. Therefore the trend of stock sector is more stable and more feasible to predict than that of a single stock. In this paper, we propose a new method named Stock Sector Trend Prediction (SSTP) to solve the problem of predicting stock sector trend. In SSTP method, we adopt the Relative Price Strength (RPS) to describe the trend of the stock sector, which is the relative rank of stock sector trend. In order to learn the intrinsic probability distribution of the stock sector index series, we construct the multi-scale RPS time series and build multiple independent fully-connected stock sector relation graphs based on the real relationship among stock sectors. Then, we propose a Temporal-spatial Network (TSN) to extract the temporal features from the multi-scale RPS series and the spatial features from the stock sector relation graphs. Finally, the TSN predicts and ranks the trends of the stock sector trend with the temporal-spatial features. The experimental results on the real-world dataset validate the effectiveness of the proposed SSTP method for the stock sector trend prediction.


Introduction
In fintech, the stock market has developed rapidly and stock trading has become one of the most important financial instruments, and stock prediction is an important manner for investors to participate in stock trading [24]. Stock prediction aims to predict the future trends of a stock in order to help investors make good investment decisions. If stock predictions are accurate, investors can more accurately determine when to buy and sell stocks to maximize profits. Additionally, the accuracy of stock predictions can also help businesses make better business decisions to better meet shareholder needs and increase enterprise value. The purpose of stock forecasting is to predict the future trend of stocks and help investors make correct investment decisions. Traditional stock trend forecasting methods are based on time series analysis, most of them use machine learning algorithms such as the Hidden Markov Model (HMM), support vector machine (SVM), and Kalman Filters [4,10,15]. These methods use the technical indicators and financial new articles of the stock as input and the price of the stock as label to train the model, then predict the trend of the stock price [22]. However, the machine learning model can not extract the features from the original stock time series, which limits the performance of its stock trend prediction. With the success of deep learning in modeling sequence data in recent years, it has become a promising option for stock forecasting [6]. Nelson et al. [16] employed LSTM networks on stock time series data to uncover dependencies between features for stock trend prediction. The results demonstrate improved prediction performance compared to traditional machine learning methods. Feng et al. [7] provide a new deep learning solution called Relational Stock Ranking (RSR) for stock forecasting, achieving a return of 0.68 and 0.56 on NASDAQ and NYSE, respectively, over 237 trading days. Ying et al. [25] improved on the basis of RSR and proposed a graph-based stock recommendation model, which improved the stock return and finally achieved a return rate of 0.92 and 1.38 on NASDAQ and NYSE, respectively. However, the stock price time series has sharp volatility, which hinders the generalization of modeling on stock trend prediction using deep learning. The stock sector is a combination of stocks in the same industry, and the trend of the stock sector index is the weighted price sum of all the stocks in the sector. As shown in Figure 1(a), the Daily volatility (dv) of a stock trend is stronger than the stock sector trend, and the definition of Daily volatility (dv) is shown as Definition 1 in Section 3. Compared with the stock trend, the deep learning model can obtain better generalization of the stock sector trend and improve the prediction performance of the model. The RPS time series measures the relative trend among stock sectors, and the strict definition of the RPS is shown as Definition 2 in Section 3. From Figure 1(b), the horizontal axis represents the date, and the vertical axis represents different stock sectors. The deeper color means the 0.56 on NASDAQ and NYSE, respectively, over 237 trading days. Ying et al. [25] improved on the basis of RSR and proposed a graph-based stock recommendation model, which improved the stock return and finally achieved a return rate of 0.92 and 1.38 on NASDAQ and NYSE, respectively. However, the stock price time series has sharp volatility, which hinders the generalization of modeling on stock trend prediction using deep learning. The stock sector is a combination of stocks in the same industry, and the trend of the stock sector index is the weighted price sum of all the stocks in the sector. As shown in Figure 1(a), the Daily volatility (dv) of a stock trend is stronger than the stock sector trend, and the definition of Daily volatility (dv) is shown as Definition 1 in Section 3. Compared with the stock trend, the deep learning model can obtain better generalization of the stock sector trend and improve the prediction performance of the model. The RPS time series measures the relative trend among stock sectors, and the strict definition of the RPS is shown as Definition 2 in Section 3. From Figure 1(b), the horizontal axis represents the date, and the vertical axis represents different stock sectors. The deeper color means the higher RPS rank of the stock sector. We can clearly find that the RPS time series of different stock sectors have stable and continuous trend, which is beneficial to deep learning to fit its distribution. To reduce investment risk in the stock market and improve the prediction performance of spatial extractor. Finally, TSN merges the temporal and spatial features to predict the stock sector trend. The main contributions of this paper are summarized as follows:  The performance of stock trend-based prediction methods is limited due to the highly volatile characteristic of stock trends. We find that the stock sector trend has the characteristics of stability and continuity, which is beneficial for deep learning to fit its data distribution to improve the returns on stock prediction.  We propose a Temporal-spatial Network (TSN) to extract the temporal features based on multi-scale RPS time series of stock sectors and mine the spatial features using stock sector relation graphs to predict the stock sector trend.  The experimental results show that this method can predict the trend of stock market effectively.

Figure 1
Stock trend and stock sector trend.
(a) Daily volatility: Stock Sector VS Stock forecasting, achieving a return of 0.68 and 0.56 on NASDAQ and NYSE, respectively, over 237 trading days. Ying et al. [25] improved on the basis of RSR and proposed a graph-based stock recommendation model, which improved the stock return and finally achieved a return rate of 0.92 and 1.38 on NASDAQ and NYSE, respectively. However, the stock price time series has sharp volatility, which hinders the generalization of modeling on stock trend prediction using deep learning. The stock sector is a combination of stocks in the same industry, and the trend of the stock sector index is the weighted price sum of all the stocks in the sector. As shown in Figure 1(a), the Daily volatility (dv) of a stock trend is stronger than the stock sector trend, and the definition of Daily volatility (dv) is shown as Definition 1 in Section 3. Compared with the stock trend, the deep learning model can obtain better generalization of the stock sector trend and improve the prediction performance of the model. The RPS time series measures the relative trend among stock sectors, and the strict definition of the RPS is shown as Definition 2 in Section 3. From Figure 1(b), the horizontal axis represents the date, and the vertical axis represents different stock sectors. The deeper color means the higher RPS rank of the stock sector. We can clearly find that the RPS time series of different stock sectors have stable and continuous trend, which is beneficial to deep learning to fit its distribution. To reduce investment risk in the stock market and improve the prediction performance of the model, we use the stock sectors instead of stocks as the trend prediction object. We propose a novel Temporal Spatial Network (TSN) based on RPS time series to predict the stock sector trend. To better mine the RPS time series for stock sector trend prediction, we construct multi-scale RPS time series and the stock sector relation graphs using the spatial extractor. Finally, TSN merges the temporal and spatial features to predict the stock sector trend. The main contributions of this paper are summarized as follows:  The performance of stock trend-based prediction methods is limited due to the highly volatile characteristic of stock trends. We find that the stock sector trend has the characteristics of stability and continuity, which is beneficial for deep learning to fit its data distribution to improve the returns on stock prediction.  We propose a Temporal-spatial Network (TSN) to extract the temporal features based on multi-scale RPS time series of stock sectors and mine the spatial features using stock sector relation graphs to predict the stock sector trend.  The experimental results show that this method can predict the trend of stock market effectively.

Figure 1
Stock trend and stock sector trend.
(a) Daily volatility: Stock Sector VS Stock (b) RPS time series of stock sectors Note: (a) Stock sector is more stable than that of a single stock. In this example, Stock sector 801120.SI is a group of stocks belonging to the Note: (a) Stock sector is more stable than that of a single stock. In this example, Stock sector 801120.SI is a group of stocks belonging to the same sector, including Stock 000568.SZ. (The detail definition of Daily-1 volatility (dv) is shown as Definition 1 in Section 3). (b) The trend of different stock sector indices from April 13, 2022 to May 9, 2022. We describe RPS time series in shades of color (from 0 to 100). The deeper color means the higher RPS rank of the stock sector. We can clearly find that the RPS time series of different stock sectors have stable and continuous trend, which is beneficial to deep learning to fit its distribution (the detailed definition of RPS is shown as Definition 2 in Section 3.)

655
Information Technology and Control 2023/3/52 higher RPS rank of the stock sector. We can clearly find that the RPS time series of different stock sectors have stable and continuous trend, which is beneficial to deep learning to fit its distribution.
To reduce investment risk in the stock market and improve the prediction performance of the model, we use the stock sectors instead of stocks as the trend prediction object. We propose a novel Temporal Spatial Network (TSN) based on RPS time series to predict the stock sector trend. To better mine the RPS time series for stock sector trend prediction, we construct multi-scale RPS time series and design the temporal extractor to mine the temporal features. According to the efficient market hypothesis, there is a correlation between stock sector trends. We build multiple independent fully-connected graphs called the stock sector relation graphs based on different stock sectors to construct correlations between stock sector trends. Then, TSN extracts the spatial features from the stock sector relation graphs using the spatial extractor. Finally, TSN merges the temporal and spatial features to predict the stock sector trend. The main contributions of this paper are summarized as follows: _ The performance of stock trend-based prediction methods is limited due to the highly volatile characteristic of stock trends. We find that the stock sector trend has the characteristics of stability and continuity, which is beneficial for deep learning to fit its data distribution to improve the returns on stock prediction. _ We propose a Temporal-spatial Network (TSN) to extract the temporal features based on multiscale RPS time series of stock sectors and mine the spatial features using stock sector relation graphs to predict the stock sector trend. _ The experimental results show that this method can predict the trend of stock market effectively.

Stock Prediction based on Machine Learning.
Traditional financial models focus on technical analysis, extracting price-quantity indicators from historical transaction data and using machine learning algorithms. Kavitha et al. [10] give the idea of using Hidden Markov Model (HMM) to analyze stock mar-ket behavior trend. The trend once followed over a particular period will sure repeat in future. The support vector machine (SVM) and K-nearest neighbor (KNN) algorithm were used to study the stock price forecasting problem, select the transaction data reflecting the stock trend and its technical indicators, forecast the ups and downs and the closing price of the Shanghai Composite Index [15]. In order to reduce the risk of stock investment, Khaidem et al. [11] propose a new method to predict stock returns by using a powerful machine learning algorithm called ensemble learning.
Stock Prediction based on Deep Learning. Establishing effective technical characteristics usually requires considerable expertise, and the assumed stochastic process may not be the best way to simulate highly non-linear and non-stationary fluctuations in the stock market. In recent years, deep learning models have played an important role in prediction tasks [2,13], especially recurrent neural networks (RNNs) [18,23,26]. Chen et al. [1] study LSTM-based method for stock return prediction. In addition to adding historical price series to improve forecasting accuracy, stock forecasting also needs to consider external information, such as news, media and various other information. For example, Deng et al. [5] propose a novel Knowledge-Driven Temporal Convolutional Network to predict the trend of stock. Some recent scientific advances attempt to model how stocks affect each other by learning the characteristics of the relationship between stocks. Given a set of pre-defined stock relationship graphs, extract graph-based stock interaction features using temporal graph convolutional networks [3,12,14]. However, a stock (company) is widely related to some other stocks through various relationships, so how to express the relationship between stocks is still a challenging problem. Hsu et al. [9] designed the FinGAT model, which is a multitask graph neural network-based model that can learn the hierarchical influence between stocks and generate the most profitable stocks. Recently, some studies have begun to consider how to predict the most promising stocks in the financial market [7,25]. This approach is easier than attempting to predict the stock price of each individual stock, as ranking only requires comparing the relative performance among companies, without the need to accurately forecast the future value of each company.
However, most of the current financial forecasting methods are based on stock forecasting. Stock trends are highly volatile and are easily affected by irrational factors in the financial market, such as market sentiment, investor sentiment and behavior. These factors are not easy to predict through data analysis, and will affect the accuracy of stock forecasting.

Definition
We define the Daily volatility (dv) and RPS m t as follows:

DEFINITION 1: Daily volatility (dv).
The dv is a measure of the daily volatility range of a stock or stock sector and is used to measure risk in this paper. We define the highest index, lowest index, and closing index of the stock sector on day t as , the final representation of dv: performance among companies, without the need to accurately forecast the future value of each company. However, most of the current financial forecasting methods are based on stock forecasting. Stock trends are highly volatile and are easily affected by irrational factors in the financial market, such as market sentiment, investor sentiment and behavior. These factors are not easy to predict through data analysis, and will affect the accuracy of stock forecasting.

Definition
We define the Daily volatility (dv) and as follows: The dv is a measure of the daily volatility range of a stock or stock sector and is used to measure risk in this paper. We define the highest index, lowest index, and closing index of the stock sector on day t as , the final representation of dv: . (1) where . Then we sort the in descending order by the ranking algorithm rank, and we get the ranking value of stock sector i in m days: , , and n is the number of stock sectors; Finally, of stock sector i in m days is defined as follows: ,

Methodology
To better understand the proces sector trend prediction, we in method in detail in this section. Figure 2, there are three main our method, namely feature stock sector trend prediction temporal-spatial network, and tr

Feature Construction
denote the set of n stock sectors; is the index value of stock sector i at day t. We calculate the change of the stock sector index i in m days as follows: RPS m t is defined as the ranking of the relative change value of each stock sector index in all stock sectors within a period of m. Let S denote the set of n stock sectors; is the index value of stock sector i at day t. We calculate the change of the stock sector index i in m days as follows: , where . Then we sort the in descending order by the ranking algorithm rank, and we get the ranking value of stock sector i in m days: , , and n is the number of stock sectors; Finally, of stock sector i in m days is defined as follows: , where , , and is the prediction value of stock sector i at day t+1. Finally, we recommend that investors buy funds corresponding to the predicted Top5 stock sectors on each trading day.

Methodology
To better understand the process of the stock sector trend prediction, we introduce our method in detail in this section. As shown in Figure 2, there are three main processes in our method, namely feature construction, stock sector trend prediction (SSTP) with temporal-spatial network, and trend ranking.

Feature Construction
, (2) where . Then we sort the in descending order by the ranking algorithm rank, and we get the ranking value of stock sector i in m days: defined as the ranking of the relative value of each stock sector index in all ectors within a period of m. Let S denote the set of n ectors; is the index value of stock at day t. We calculate the change of k sector index i in m days as follows: , (2) . Then we sort the in ding order by the ranking algorithm nd we get the ranking value of stock i in m days: , and n is the number of stock sectors; , of stock sector i in m days is as follows: , and . For e, in a financial market with a total of ck sectors. On day t, the 3-day return ock sector i is C 3 t , which ranks 10th all 100 stock sectors ). Then the value stock sector is 90 at day t, where .
stock sector relation graphs relying on real stock sector internal information. The topological graph is represented as , where V is a set of stock sectors; E is a set of sector adjacency relations, indicating the correlated intensity between � and � . Then, we get the ranking list for all stock sectors S by regressing task f, the represented as follows: , where , , and is the prediction value of stock sector i at day t+1. Finally, we recommend that investors buy funds corresponding to the predicted Top5 stock sectors on each trading day.

Methodology
To better understand the process of the stock sector trend prediction, we introduce our method in detail in this section. As shown in Figure 2, there are three main processes in our method, namely feature construction, stock sector trend prediction (SSTP) with temporal-spatial network, and trend ranking.
where . Then we sort the in descending order by the ranking algorithm rank, and we get the ranking value of stock sector i in m days: , , and n is the number of stock sectors; Finally, of stock sector i in m days is defined as follows: , where , , and is the prediction value of stock sector i at day t+1. Finally, we recommend that investors buy funds corresponding to the predicted Top5 stock sectors on each trading day.

Methodology
To better understand the process of the stock sector trend prediction, we introduce our method in detail in this section. As shown in Figure 2, there are three main processes in our method, namely feature construction, stock sector trend prediction (SSTP) with temporal-spatial network, and trend ranking.
, and n is the number of stock sectors; Finally, of stock sector i in m days is defined as follows: RPS m t is defined as the ranking of the relative change value of each stock sector index in all stock sectors within a period of m. Let S denote the set of n stock sectors; is the index value of stock sector i at day t. We calculate the change of the stock sector index i in m days as follows: , where . Then we sort the in descending order by the ranking algorithm rank, and we get the ranking value of stock sector i in m days: , , and n is the number of stock sectors; Finally, of stock sector i in m days is defined as follows: , where and . For example, in a financial market with a total of 100 stock sectors. On day t, the 3-day return of a stock sector i is C 3 t , which ranks 10th among all 100 stock sectors ( ). Then the value of the stock sector is 90 at day t, where .
stock sector relation graphs relying on real stock sector internal information. The topological graph is represented as , where V is a set of stock sectors; E is a set of sector adjacency relations, indicating the correlated intensity between � and � . Then, we get the ranking list for all stock sectors S by regressing task f, the represented as follows: , where , , and is the prediction value of stock sector i at day t+1. Finally, we recommend that investors buy funds corresponding to the predicted Top5 stock sectors on each trading day.

Methodology
To better understand the process of the stock sector trend prediction, we introduce our method in detail in this section. As shown in Figure 2, there are three main processes in our method, namely feature construction, stock sector trend prediction (SSTP) with temporal-spatial network, and trend ranking.
, (3) where RPS m t is defined as the ranking of the relative change value of each stock sector index in all stock sectors within a period of m. Let S denote the set of n stock sectors; is the index value of stock sector i at day t. We calculate the change of the stock sector index i in m days as follows: , ( where . Then we sort the in descending order by the ranking algorithm rank, and we get the ranking value of stock sector i in m days: , , and n is the number of stock sectors; Finally, of stock sector i in m days is defined as follows: , where and . For example, in a financial market with a total of 100 stock sectors. On day t, the 3-day return of a stock sector i is C 3 t , which ranks 10th among all 100 stock sectors ( ). Then the value of the stock sector is 90 at day t, where .
stock sector relation graphs relying on real stock sector internal information. The topological graph is represented as , where V is a set of stock sectors; E is a set of sector adjacency relations, indicating the correlated intensity between � and � . Then, we get the ranking list for all stock sectors S by regressing task f, the represented as follows: , where , , and is the prediction value of stock sector i at day t+1. Finally, we recommend that investors buy funds corresponding to the predicted Top5 stock sectors on each trading day.

Methodology
To better understand the process of the stock sector trend prediction, we introduce our method in detail in this section. As shown in Figure 2, there are three main processes in our method, namely feature construction, stock sector trend prediction (SSTP) with temporal-spatial network, and trend ranking. and RPS m t is defined as the ranking of the relative change value of each stock sector index in all stock sectors within a period of m. Let S denote the set of n stock sectors; is the index value of stock sector i at day t. We calculate the change of the stock sector index i in m days as follows: , ( where . Then we sort the in descending order by the ranking algorithm rank, and we get the ranking value of stock sector i in m days: , , and n is the number of stock sectors; Finally, of stock sector i in m days is defined as follows: , where and . For example, in a financial market with a total of 100 stock sectors. On day t, the 3-day return of a stock sector i is C 3 t , which ranks 10th among all 100 stock sectors ( ). Then the value of the stock sector is 90 at day t, where .
stock sector relation graphs relying on real stock sector internal information. The topological graph is represented as , where V is a set of stock sectors; E is a set of sector adjacency relations, indicating the correlated intensity between � and � . Then, we get the ranking list for all stock sectors S by regressing task f, the represented as follows: , where , , and is the prediction value of stock sector i at day t+1. Finally, we recommend that investors buy funds corresponding to the predicted Top5 stock sectors on each trading day.

Methodology
To better understand the process of the stock sector trend prediction, we introduce our method in detail in this section. As shown in Figure 2, there are three main processes in our method, namely feature construction, stock sector trend prediction (SSTP) with temporal-spatial network, and trend ranking.
. For example, in a financial market with a total of 100 stock sectors. On day t, the 3-day return of a stock sector i is RPS m t is defined as the ranking of the relative change value of each stock sector index in all stock sectors within a period of m. Let S denote the set of n stock sectors; is the index value of stock sector i at day t. We calculate the change of the stock sector index i in m days as follows: , ( where . Then we sort the in descending order by the ranking algorithm rank, and we get the ranking value of stock sector i in m days: , , and n is the number of stock sectors; Finally, of stock sector i in m days is defined as follows: , where and . For example, in a financial market with a total of 100 stock sectors. On day t, the 3-day return of a stock sector i is C 3 t , which ranks 10th among all 100 stock sectors ( ). Then the value of the stock sector is 90 at day t, where .
stock sector relation graphs relying on real stock sector internal information. The topological graph is represented as , where V is a set of stock sectors; E is a set of sector adjacency relations, indicating the correlated intensity between � and � . Then, we get the ranking list for all stock sectors S by regressing task f, the represented as follows: , where , , and is the prediction value of stock sector i at day t+1. Finally, we recommend that investors buy funds corresponding to the predicted Top5 stock sectors on each trading day.

Methodology
To better understand the process of the stock sector trend prediction, we introduce our method in detail in this section. As shown in Figure 2, there are three main processes in our method, namely feature construction, stock sector trend prediction (SSTP) with temporal-spatial network, and trend ranking.
, which ranks 10th among all 100 stock sectors ( , where and example, in a financial market with a 100 stock sectors. On day t, the 3-da of a stock sector i is C 3 t , which ran among all 100 stock ( ). Then the of the stock sector is 90 at day t .

Problem Formulation
We formulate stock sector trend pred a ranking task f, to learn the probability distribution of the stoc index time series. Let S denote the set of n stock sectors, define the set of stock sector RPS tim at day t is the length of RPS time series, and dimension of features, among which include , , ， , . To better predict the future tr build multiple independent fully-co

Figure 2
The architecture of stock sector trend time series and stock sector relation g where and . For example, in a financial market with a total of 100 stock sectors. On day t, the 3-day return of a stock sector i is C 3 t , which ranks 10th among all 100 stock sectors ( ). Then the value of the stock sector is 90 at day t, where .

Problem Formulation
We formulate stock sector trend prediction as a ranking task f, to learn the intrinsic probability distribution of the stock sector index time series. Let S denote the set of n stock sectors, and we define the set of stock sector RPS time series at day t ,where t is the length of RPS time series, and U is the dimension of features, among which features include , , ， , , and . To better predict the future trend, we build multiple independent fully-connected

Figure 2
The architecture of stock sector trend prediction with tempo time series and stock sector relation graphs.

Problem Formulation
We formulate stock sector trend prediction as a ranking task f, to learn the intrinsic probability distribution of the stock sector index time series. Let S RPS m t is defined as the ranking of the relative change value of each stock sector index in all stock sectors within a period of m. Let S denote the set of n stock sectors; is the index value of stock sector i at day t. We calculate the change of the stock sector index i in m days as follows: , ( where . Then we sort the in descending order by the ranking algorithm rank, and we get the ranking value of stock sector i in m days: , , and n is the number of stock sectors; Finally, of stock sector i in m days is defined as follows: , where and . For example, in a financial market with a total of 100 stock sectors. On day t, the 3-day return of a stock sector i is C 3 t , which ranks 10th among all 100 stock sectors ( ). Then the value of the stock sector is 90 at day t, where .

Problem Formulation
We formulate stock sector trend prediction as a ranking task f, to learn the intrinsic probability distribution of the stock sector index time series.

Figure 2
The architecture of stock sector trend prediction with temporal-s time series and stock sector relation graphs.
denote the set of n stock sectors, and we define the set of stock sector RPS time series at day t where and . For example, in a financial market with a total of 100 stock sectors. On day t, the 3-day return of a stock sector i is C 3 t , which ranks 10th among all 100 stock sectors ( ). Then the value of the stock sector is 90 at day t, where .

Problem Formulation
We formulate stock sector trend prediction as a ranking task f, to learn the intrinsic probability distribution of the stock sector index time series. Let S denote the set of n stock sectors, and we define the set of stock sector RPS time series at day t ,where t is the length of RPS time series, and U is the dimension of features, among which features include , , ， , , and . To better predict the future trend, we build multiple independent fully-connected

Figure 2
The architecture of stock sector trend prediction with temporal-s time series and stock sector relation graphs.
,where t is the length of RPS time series, and U is the dimension of features, among which features include example, in a financial market with 100 stock sectors. On day t, the 3-da of a stock sector i is C 3 t , which ra among all 100 stock ( ). Then the of the stock sector is 90 at day .

Problem Formulation
We formulate stock sector trend pred a ranking task f, to learn the probability distribution of the stoc index time series. Let S denote the set of n stock sectors, define the set of stock sector RPS tim at day t is the length of RPS time series, and dimension of features, among which include , , ， , . To better predict the future t build multiple independent fully-c

Figure 2
The architecture of stock sector trend time series and stock sector relation g , , example, in a financial market with a total of 100 stock sectors. On day t, the 3-day return of a stock sector i is C 3 t , which ranks 10th among all 100 stock sectors ( ). Then the value of the stock sector is 90 at day t, where .

Problem Formulation
We formulate stock sector trend prediction as a ranking task f, to learn the intrinsic probability distribution of the stock sector index time series. Let S denote the set of n stock sectors, and we define the set of stock sector RPS time series at day t ,where t is the length of RPS time series, and U is the dimension of features, among which features include , , ， , , and . To better predict the future trend, we build multiple independent fully-connected To better understand the proc sector trend prediction, we method in detail in this sectio Figure 2, there are three ma our method, namely featur stock sector trend predictio temporal-spatial network, and

Feature Construction
Multi-scale RPS m t Time Ser describe the stock sector inde series, we construct the multiseries. The multi-scale trend characteristics of sto different time scales, it c additional useful informa improve the performance of models.

Figure 2
The architecture of stock sector trend prediction with temporal-spatial network based on m time series and stock sector relation graphs.
, , , and . To better predict the future trend, we build multiple independent fully-connected stock sector relation graphs relying on real stock sector internal information. The topological graph is represented as m t is defined as the ranking of the relative nge value of each stock sector index in all ck sectors within a period of m. Let S denote the set of n ck sectors; is the index value of stock tor i at day t. We calculate the change of stock sector index i in m days as follows: , ere . Then we sort the in cending order by the ranking algorithm k, and we get the ranking value of stock tor i in m days: , , and n is the number of stock sectors; ally, of stock sector i in m days is ined as follows: , where , , and is the prediction value of stock sector i at day t+1. Finally, we recommend that investors buy funds corresponding to the predicted Top5 stock sectors on each trading day.

Methodology
To better understand the process of the stock sector trend prediction, we introduce our method in detail in this section. As shown in Figure 2, there are three main processes in our method, namely feature construction, stock sector trend prediction (SSTP) with temporal-spatial network, and trend ranking. , where V is a set of stock sectors; E is a set of sector adjacency relations, indicating the correlated intensity between and . Then, we get the ranking list for all stock sectors S by regressing task f, the represented as follows:

Feature Construction
is defined as the ranking of the relative e value of each stock sector index in all sectors within a period of m. Let S denote the set of n sectors; is the index value of stock i at day t. We calculate the change of ock sector index i in m days as follows: , . Then we sort the in nding order by the ranking algorithm and we get the ranking value of stock i in m days: , , and n is the number of stock sectors; y, of stock sector i in m days is d as follows: , and . For ple, in a financial market with a total of ock sectors. On day t, the 3-day return stock sector i is C 3 t , which ranks 10th g all 100 stock sectors where , , and is the prediction value of stock sector i at day t+1. Finally, we recommend that investors buy funds corresponding to the predicted Top5 stock sectors on each trading day.

Methodology
To better understand the process of the stock sector trend prediction, we introduce our method in detail in this section. As shown in Figure 2, there are three main processes in our method, namely feature construction, stock sector trend prediction (SSTP) with temporal-spatial network, and trend ranking.

Feature Construction
Multi-scale RPS m t Time Series. To better describe the stock sector index by RPS time series, we construct the multi-scale time series. The multi-scale contains the trend characteristics of stock sectors at different time scales, it can add more additional useful information to help improve the performance of deep learning models.
, (4) where RPS m t is defined as the ranking of the relative change value of each stock sector index in all stock sectors within a period of m. Let S denote the set of n stock sectors; is the index value of stock sector i at day t. We calculate the change of the stock sector index i in m days as follows: , where . Then we sort the in descending order by the ranking algorithm rank, and we get the ranking value of stock sector i in m days: , , and n is the number of stock sectors; Finally, of stock sector i in m days is defined as follows: , where and . For example, in a financial market with a total of 100 stock sectors. On day t, the 3-day return of a stock sector i is C 3 t , which ranks 10th among all 100 stock sectors ( ). Then the value of the stock sector is 90 at day t, where .

Problem Formulation
We formulate stock sector trend prediction as a ranking task f, to learn the intrinsic probability distribution of the stock sector index time series.
where , , and is the prediction value of stock sector i at day t+1. Finally, we recommend that investors buy funds corresponding to the predicted Top5 stock sectors on each trading day.

Methodology
To better understand the process of the stock sector trend prediction, we introduce our method in detail in this section. As shown in Figure 2, there are three main processes in our method, namely feature construction, stock sector trend prediction (SSTP) with temporal-spatial network, and trend ranking.

Feature Construction
where . Then we sort the in descending order by the ranking algorithm rank, and we get the ranking value of stock sector i in m days: , , and n is the number of stock sectors; Finally, of stock sector i in m days is defined as follows: , where and . For example, in a financial market with a total of 100 stock sectors. On day t, the 3-day return of a stock sector i is C 3 t , which ranks 10th among all 100 stock sectors ( ). Then the value of the stock sector is 90 at day t, where .

Problem Formulation
We formulate stock sector trend prediction as a ranking task f, to learn the intrinsic probability distribution of the stock sector index time series.
where , , and is the prediction value of stock sector i at day t+1. Finally, we recommend that investors buy funds corresponding to the predicted Top5 stock sectors on each trading day.

Methodology
To better understand the process of the stock sector trend prediction, we introduce our method in detail in this section. As shown in Figure 2, there are three main processes in our method, namely feature construction, stock sector trend prediction (SSTP) with temporal-spatial network, and trend ranking.

Feature Construction
where . Then we sort the in descending order by the ranking algorithm rank, and we get the ranking value of stock sector i in m days: , , and n is the number of stock sectors; Finally, of stock sector i in m days is defined as follows: , where and . For example, in a financial market with a total of 100 stock sectors. On day t, the 3-day return of a stock sector i is C 3 t , which ranks 10th among all 100 stock sectors ( ). Then the value of the stock sector is 90 at day t, where .

Problem Formulation
We formulate stock sector trend prediction as a ranking task f, to learn the intrinsic probability distribution of the stock sector index time series. Let S denote the set of n stock sectors, and we define the set of stock sector RPS time series at day t ,where t is the length of RPS time series, and U is the dimension of features, among which features include , , ， , , and . To better predict the future trend, we stock sector relation graphs relying on real stock sector internal information. The topological graph is represented as , where V is a set of stock sectors; E is a set of sector adjacency relations, indicating the correlated intensity between � and � . Then, we get the ranking list for all stock sectors S by regressing task f, the represented as follows: , where , , and is the prediction value of stock sector i at day t+1. Finally, we recommend that investors buy funds corresponding to the predicted Top5 stock sectors on each trading day.

Methodology
To better understand the process of the stock sector trend prediction, we introduce our method in detail in this section. As shown in Figure 2, there are three main processes in our method, namely feature construction, stock sector trend prediction (SSTP) with temporal-spatial network, and trend ranking.

Feature Construction
where . Then we sort the in descending order by the ranking algorithm rank, and we get the ranking value of stock sector i in m days: , , and n is the number of stock sectors; Finally, of stock sector i in m days is defined as follows: , where and . For example, in a financial market with a total of 100 stock sectors. On day t, the 3-day return of a stock sector i is C 3 t , which ranks 10th among all 100 stock sectors ( ). Then the value of the stock sector is 90 at day t, where .

Problem Formulation
We formulate stock sector trend prediction as a ranking task f, to learn the intrinsic probability distribution of the stock sector index time series. Let S denote the set of n stock sectors, and we define the set of stock sector RPS time series at day t ,where t is the length of RPS time series, and U is the dimension of features, among which features include , , ， , , and . To better predict the future trend, we build multiple independent fully-connected stock sector relation graphs r stock sector internal info topological graph is represente where V is a set of stock secto sector adjacency relations, correlated intensity between we get the ra sectors S by regressing task f, t as follows: , where , and is the prediction v sector i at day t+1. Finally, w that investors buy funds corres predicted Top5 stock sectors o day.

Methodology
To better understand the proce sector trend prediction, we method in detail in this section Figure 2, there are three mai our method, namely feature stock sector trend prediction temporal-spatial network, and

Feature Construction
Multi-scale RPS m t Time Seri describe the stock sector inde series, we construct the multi-s series. The multi-scale trend characteristics of sto different time scales, it ca additional useful informat improve the performance of models.

Figure 2
The architecture of stock sector trend prediction with temporal-spatial network based on m time series and stock sector relation graphs.
is the prediction value of stock sector i at day t+1. Finally, we recommend that investors buy funds corresponding to the predicted Top5 stock sectors on each trading day.

Methodology
To better understand the process of the stock sector trend prediction, we introduce our method in detail in this section. As shown in Figure 2, there are three main processes in our method, namely feature construction, stock sector trend prediction (SSTP) with temporal-spatial network, and trend ranking.

Feature Construction
Multi-scale Time Series. To better describe the stock sector index by RPS time series, we construct the multi-scale time series. The multi-scale contains the trend characteristics of stock sectors at different time scales, it can add more additional useful information to help improve the performance of deep learning models. Stock Sector Relation Graph. In order to build the correlation between stock sectors within the same industry, we construct multiple independent fully-connected graphs based on stock sectors called the stock sector relation graphs. Such as, Wind Power Sector, Power Grid Sector, and Photovoltaic all belong to the Power Industry. In our stock sector relation graph, the stock sectors are nodes, and there is an undirected edge between any two nodes. The TSN extracts the spatial features from the stock sector relation graph for the fusion of features.

SSTP with Temporal-spatial Network
Temporal Feature Extraction. To better obtain the temporal features from the multi-scale , the TSN uses the Bi-LSTM as the temporal extractor. Bi-LSTM can perform bidirectional encoding of time series, which can better capture the local features of time series. Given the time series of stock sector i, Note: There are three main processes in our method, namely feature construction, stock sector trend prediction (SSTP) with temporal-spatial network, and trend ranking. (a) Feature construction module builds the input data set of the model, including Multi-scale RPS time series and Stock Sector Relation Graph. (b) Stock sector trend prediction (SSTP) with temporal-spatial network module extracts temporal and spatial features, and fuses the temporal feature and spatial feature to get a new vector, which is then used as the input of the full connection layer to get the predicted value. (c) Trend ranking module calculates the ranking list for all stock sectors.
Stock Sector Relation Graph. In order to build the correlation between stock sectors within the same industry, we construct multiple independent fully-connected graphs based on stock sectors called the stock sector relation graphs. Such as, Wind Power Sector, Power Grid Sector, and Photovoltaic all belong to the Power Industry. In our stock sector relation graph, the stock sectors are nodes, and there is an undirected edge between any two nodes. The TSN extracts the spatial features from the stock sector relation graph for the fusion of features.  (5) where and denotes the output of LSTM unit of forward layer and backward layer.

SSTP with Temporal-spatial Network
is the concatenated The are weight matrices for the input part. Spatial Feature Extraction. To extract spatial features from stock sector relation graphs, the TSN constructs the graph attention network (GAT) as the extractor of spatial features. GAT can calculate the correlation coefficient according to the different contributions of the neighbor node features to the central node. Then it can aggregate the features of the neighbor nodes based on the attention coefficient, which can effectively improve the representation ability of the central node. Firstly, GAT performs a self-attention Att operation on the nodes to compute attention coefficients: , (6) where indicates the importance of sector node j's features to sector node i at day t and . Then, we normalize them across all choices of j using the softmax function: , (7) where and is some neighborhood of stock node i in the graph. For stock sector i, we aggregate the characteristics of all adjacent stock nodes to get the relational feature representation . It's formulated as , and the time series as the input of the Bi-LSTM to get the temporal features. It's formulated as follows:

Figure 2
The architecture of stock sector trend prediction with temporal-spatial network based on multi-scale RPS time series and stock sector relation graphs Stock Sector Relation Graph. In order to build the correlation between stock sectors within the same industry, we construct multiple independent fully-connected graphs based on stock sectors called the stock sector relation graphs. Such as, Wind Power Sector, Power Grid Sector, and Photovoltaic all belong to the Power Industry. In our stock sector relation graph, the stock sectors are nodes, and there is an undirected edge between any two nodes. The TSN extracts the spatial features from the stock sector relation graph for the fusion of features. where indicates the importance of sector node j's features to sector node i at day t and . Then, we normalize them across all choices of j using the softmax function:

SSTP with Temporal-spatial Network
Note: There are three main processes in our method, namely feature construction, stock sector trend prediction (SSTP) with temporal-spatial network, and trend ranking. (a) Feature construction module builds the input data set of the model, including Multi-scale time series and Stock Sector Relation Graph. (b) Stock sector trend prediction (SSTP) with temporal-spatial network module extracts temporal and spatial features, and fuses the temporal feature and spatial feature to get a new vector, which is then used as the input of the full connection layer to get the predicted value. (c) Trend ranking module calculates the ranking list for all stock sectors.
Note: There are three main processes in our method, namely feature construction, stock sector trend prediction (SSTP) with temporal-spatial network, and trend ranking. (a) Feature construction module builds the input data set of the model, including Multi-scale RPS time series and Stock Sector Relation Graph. (b) Stock sector trend prediction (SSTP) with temporal-spatial network module extracts temporal and spatial features, and fuses the temporal feature and spatial feature to get a new vector, which is then used as the input of the full connection layer to get the predicted value. (c) Trend ranking module calculates the ranking list for all stock sectors.
Stock Sector Relation Graph. In order to build the correlation between stock sectors within the same industry, we construct multiple independent fully-connected graphs based on stock sectors called the stock sector relation graphs. Such as, Wind Power Sector, Power Grid Sector, and Photovoltaic all belong to the Power Industry. In our stock sector relation graph, the stock sectors are nodes, and there is an undirected edge between any two nodes. The TSN extracts the spatial features from the stock sector relation graph for the fusion of features.

SSTP with Temporal-spatial Network
Temporal Feature Extraction. To better obtain the temporal features from the multi-scale , the TSN uses the Bi-LSTM as the temporal extractor. Bi-LSTM can perform bidirectional encoding of time series, which can better capture the local features of time series. Given the time series of stock sector i, , and the time series as the input of the Bi-LSTM to get the temporal features. It's formulated as follows: (5) where and denotes the output of LSTM unit of forward layer and backward layer.
is the concatenated vector of the outputs of forwarding and backward processes by CONCAT operation and U is the dimension of the hidden layer.
The are weight matrices for the input part. Spatial Feature Extraction. To extract spatial features from stock sector relation graphs, the TSN constructs the graph attention network (GAT) as the extractor of spatial features. GAT can calculate the correlation coefficient according to the different contributions of the neighbor node features to the central node. Then it can aggregate the features of the neighbor nodes based on the attention coefficient, which can effectively improve the representation ability of the central node. Firstly, GAT performs a self-attention Att operation on the nodes to compute attention coefficients: , (6) where indicates the importance of sector node j's features to sector node i at day t and . Then, we normalize them across all choices of j using the softmax function: , (7) where and is some neighborhood of stock node i in the graph. For stock sector i, we aggregate the characteristics of all adjacent stock nodes to get the relational feature representation . It's formulated as follows: , (8) where is an activation function.
, (5) where Note: There are three main processes in our method, namely feature construction, temporal-spatial network, and trend ranking. (a) Feature construction module builds t Multi-scale RPS time series and Stock Sector Relation Graph. (b) Stock sector trend network module extracts temporal and spatial features, and fuses the temporal feature an is then used as the input of the full connection layer to get the predicted value. (c) Trend for all stock sectors.
Stock Sector Relation Graph. In order to build the correlation between stock sectors within the same industry, we construct multiple independent fully-connected graphs based on stock sectors called the stock sector relation graphs. Such as, Wind Power Sector, Power Grid Sector, and Photovoltaic all belong to the Power Industry. In our stock sector relation graph, the stock sectors are nodes, and there is an undirected edge between any two nodes. The TSN extracts the spatial features from the stock sector relation graph for the fusion of features.

SSTP with Temporal-spatial Network
Temporal Feature Extraction. To better obtain the temporal features from the multi-scale , the TSN uses the Bi-LSTM as the temporal extractor. Bi-LSTM can perform bidirectional encoding of time series, which can better capture the local features of time series. Given the time series of stock sector i, , and the time series as the input of the Bi-LSTM to get the temporal features. It's formulated as follows: (5) where and denotes the output of LSTM unit of forward layer and backward layer.
is the concatenated vector of the outputs of forwarding and backward processes by CONCAT operation and U is the dimension of the hidden layer. where i and Note: There are three main processes in our method, namely feature construction, s temporal-spatial network, and trend ranking. (a) Feature construction module builds t Multi-scale RPS time series and Stock Sector Relation Graph. (b) Stock sector trend network module extracts temporal and spatial features, and fuses the temporal feature an is then used as the input of the full connection layer to get the predicted value. (c) Trend for all stock sectors.
Stock Sector Relation Graph. In order to build the correlation between stock sectors within the same industry, we construct multiple independent fully-connected graphs based on stock sectors called the stock sector relation graphs. Such as, Wind Power Sector, Power Grid Sector, and Photovoltaic all belong to the Power Industry. In our stock sector relation graph, the stock sectors are nodes, and there is an undirected edge between any two nodes. The TSN extracts the spatial features from the stock sector relation graph for the fusion of features.

SSTP with Temporal-spatial Network
Temporal Feature Extraction. To better obtain the temporal features from the multi-scale , the TSN uses the Bi-LSTM as the temporal extractor. Bi-LSTM can perform bidirectional encoding of time series, which can better capture the local features of time series. Given the time series of stock sector i, , and the time series as the input of the Bi-LSTM to get the temporal features. It's formulated as follows: (5) where and denotes the output of LSTM unit of forward layer and backward layer.
is the concatenated vector of the outputs of forwarding and backward processes by CONCAT operation and U is the dimension of the hidden layer. where i denotes the output of LSTM unit of forward layer and backward layer.
is the concatenated vector of the outputs of forwarding and backward processes by CONCAT operation and U is the dimension of the hidden layer. The are weight matrices for the input part.

Spatial Feature Extraction.
To extract spatial features from stock sector relation graphs, the TSN constructs the graph attention network (GAT) as the extractor of spatial features. GAT can calculate the correlation coefficient according to the different contributions of the neighbor node features to the central node. Then it can aggregate the features of the neighbor nodes based on the attention coefficient, which can effectively improve the representation ability of the central node. Firstly, GAT performs a self-attention Att operation on the nodes to compute attention coefficients: Then it can aggregate the features of the neighbor nodes based on the attention coefficient, which can effectively improve the representation ability of the central node. Firstly, GAT performs a self-attention Att operation on the nodes to compute attention coefficients: , (6) where indicates the importance of sector node j's features to sector node i at day t and . Then, we normalize them across all choices of j using the softmax function: , (7) where and is some neighborhood of stock node i in the graph. For stock sector i, we aggregate the characteristics of all adjacent stock nodes to get the relational feature representation . It's formulated as follows: , (8) where is an activation function.
, (6) where indicates the importance of sector node j's features to sector node i at day t and nodes. The TSN extracts the rom the stock sector relation ion of features. mporal-spatial Network ure Extraction. To better poral features from the , the TSN uses the Bi-LSTM l extractor. Bi-LSTM can ional encoding of time series, capture the local features of en the time series of , and the as the input of the Bi-LSTM ral features. It's formulated (5) and denotes the unit of forward layer and .
is the concatenated utputs of forwarding and sses by CONCAT operation ension of the hidden layer.
neighbor nodes based on the attention coefficient, which can effectively improve the representation ability of the central node. Firstly, GAT performs a self-attention Att operation on the nodes to compute attention coefficients: , (6) where indicates the importance of sector node j's features to sector node i at day t and . Then, we normalize them across all choices of j using the softmax function: , (7) where and is some neighborhood of stock node i in the graph. For stock sector i, we aggregate the characteristics of all adjacent stock nodes to get the relational feature representation . It's formulated as follows: , (8) where is an activation function.
. Then, we normalize them across all choices of j using the softmax function: , (7) where and is some neighborhood of stock node i in the graph. For stock sector i, we aggregate the characteristics of all adjacent stock nodes to get the relational feature representation . It's formulated as follows: neighbor node features to the central node. Then it can aggregate the features of the neighbor nodes based on the attention coefficient, which can effectively improve the representation ability of the central node. Firstly, GAT performs a self-attention Att operation on the nodes to compute attention coefficients: , (6) where indicates the importance of sector node j's features to sector node i at day t and . Then, we normalize them across all choices of j using the softmax function: , (7) where and is some neighborhood of stock node i in the graph. For stock sector i, we aggregate the characteristics of all adjacent stock nodes to get the relational feature representation . It's formulated as follows: , (8) where is an activation function.
Temporal-Spatial Feature Matrix. In order to get more effective representation, TSN uses the CON-CAT operation to fuse the temporal features produced by Bi-LSTM and spatial features built by the GAT.
The represents the representation of the spatial features. TSN concatenates with the temporal feature as the final feature representation of stock sector i, and Temporal-Spatial Feature Matrix. In order to get more effective representation, TSN uses the CONCAT operation to fuse the temporal features produced by Bi-LSTM and spatial features built by the GAT. The represents the representation of the spatial features. TSN concatenates with the temporal feature as the final feature representation of stock sector i, and , where . Trend Prediction. When we get the final feature representation � � , it is used as input of the full connection layer to calculate the , and , where and U is the dimension of the hidden layer. In order to achieve the best model fitting effect, we use MAE as a loss function: . (9)

Trend Ranking
Then, TSN ranks the values in descending order, and by this means, we get the ranking list for all stock sectors S .
Finally, we recommend investors buy fund corresponding to the predicted Top5 stock sectors on each trading day.

Datasets
Stock Sector Indices. We get the stock secto indices in the Chinese A-share market from Tushare [21] which has time series between 11/02/2021 and 08/12/2022, including 124 stock sectors. Table 1 shows the detailed statistics. RPS Time Series. RPS time series i transformed through Stock Sector Indices a the model's initial input. In detailed, the entire dataset is divided into the training set validation set and testing set, and thei lengths are shown in Table 1.

Datasets
Stock Sector Indices. We get the stock sector indices in the Chinese A-share market from Tushare [21] which has time series between 11/02/2021 and 08/12/2022, including 124 stock sectors. Table 1 shows the detailed statistics. RPS Time Series. RPS time series is transformed through Stock Sector Indices as the model's initial input. In detailed, the entire dataset is divided into the training set, validation set and testing set, and their lengths are shown in Table 1. , where and U is the dimension of the hidden layer. In order to achieve the best model fitting effect, we use MAE as a loss function: Temporal-Spatial Feature Matrix. In order to get more effective representation, TSN uses the CONCAT operation to fuse the temporal features produced by Bi-LSTM and spatial features built by the GAT. The represents the representation of the spatial features. TSN concatenates with the temporal feature as the final feature representation of stock sector i, and , where . Trend Prediction. When we get the final feature representation � � , it is used as input of the full connection layer to calculate the , and , where and U is the dimension of the hidden layer. In order to achieve the best model fitting effect, we use MAE as a loss function: .

Datasets
Stock Sector Indices. We get the stock sector indices in the Chinese A-share market from Tushare [21] which has time series between 11/02/2021 and 08/12/2022, including 124 stock sectors. Table 1 shows the detailed statistics. RPS Time Series. RPS time series is transformed through Stock Sector Indices as the model's initial input. In detailed, the entire dataset is divided into the training set, validation set and testing set, and their lengths are shown in Table 1.

Datasets
Stock Sector Indices. We get the stock sector indices in the Chinese A-share market from . Finally, we recommend investors buy funds corresponding to the predicted Top5 stock sectors on each trading day.

Datasets
Stock Sector Indices. We get the stock sector indices in the Chinese A-share market from Tushare [21] which has time series between 11/02/2021 and 08/12/2022, including 124 stock sectors. Table 1 shows the detailed statistics.

RPS Time Series. RPS time series is transformed through Stock
Sector Indices as the model's initial input. In detailed, the entire dataset is divided into the training set, validation set and testing set, and their lengths are shown in Table 1. Stock Sector Relation Graph. We have obtained 31 types of stock sector relations, which were then utilized to construct the stock sector relationship graph. In this graph, each "Node" represents a distinct stock sector. The "Relations" category indicates the number of independent fully-connected graphs within the stock sectors, with each graph representing a specific industry. The "Edges" represent the connections between nodes, signifying the relationship between two stock sectors belonging to the same industry. Table 1 shows the summary statistics for stock relation graph.

Experimental Setup
Learning from the method, we employ a market simulation strategy to assess performance by calculating cumulative returns over the testing period [7,25]. First, we assume that the financial market operates normally, and each sector has its corresponding funds. Thus the market can meet all the trading needs of investors. The following assumption is that investors will buy the funds corresponding to the predicted Top5 stock sectors on each trading day, and the money amount for purchasing each fund is the same and fixed. The funds will be bought on trade day t and sold on trade day t+1. , (11) where is the rank of the predicted Top1 stock sector on the ith testing day.  Investment Return Ratio (IRR) [25]: IRR is the cumulative rate of return. IRR is defined as: , (12) where is the average rate of return of the predicted Top5 stock sectors on the ith testing day. The better the performance, the smaller the MAE value (≥0), the larger the MRR value (0,1] and the larger the IRR value ( ). To avoid the influence of accidental factors and hyperparameters, we repeated all experiments 10 times.
where is the rank of the predicted Top1 stock sector on the ith testing day.  Investment Return Ratio (IRR) [25]: IRR is the cumulative rate of return. IRR is defined as: , (12) where is the average rate of return of the predicted Top5 stock sectors on the ith testing day. , (11) where is the rank of the predicted Top1 stock sector on the ith testing day. _ Investment Return Ratio (IRR) [25]: IRR is the cumulative rate of return. IRR is defined as: corresponding funds. Thus the market can meet all the trading needs of investors. The following assumption is that investors will buy the funds corresponding to the predicted Top5 stock sectors on each trading day, and the money amount for purchasing each fund is the same and fixed. The funds will be bought on trade day t and sold on trade day t+1. Evaluation Metrics. We use three indicators to evaluate the predictive performance of the model: Mean Absolute Error (MAE), Mean Reciprocal Rank (MRR), and Investment Return Ratio (IRR).
where is the rank of the predicted Top1 stock sector on the ith testing day.  Investment Return Ratio (IRR) [25]: IRR is the cumulative rate of return. IRR is defined as: , (12) where is the average rate of return of the predicted Top5 stock sectors on the ith testing day. The better the performance, the smaller the MAE value (≥0), the larger the MRR value (0,1] and the larger the IRR value ( ). To avoid the influence of accidental factors and hyperparameters, we repeated all experiments 10 times.   , (12) where is the average rate of return of the predicted Top5 stock sectors on the ith testing day.
The better the performance, the smaller the MAE value (≥0), the larger the MRR value (0,1] and the larger the IRR value ( ). To avoid the influence of accidental factors and hyperparameters, we repeated all experiments 10 times.      Table 5 Performance of TSN as compared to six market indices (SSE, SZ, DJI, IXIC, N225 and HSI) and two ideal portfolios (Market and Selected) from June 6, 2022 to August 12. We assume that each index or stock sector has a corresponding fund that can be purchased.
Note: For example, in the Top5 market simulation strategy, we evenly allocate funds to trade the Top5 stock sectors and calculate the IRR value by cumulating the mean return ratio of the 5 selected stock sectors.

Experimental Results
_ Rank_LSTM [7]: In this work, a new deep learning solution called Rank_LSTM is contributed to the financial rank prediction problem. _ RSR_E [7]: RSR_E is a model for predicting stock rankings that utilizes stock relations. It incorporates a relational embedding layer into Rank_LSTM, which explicitly models the relationships between stocks. _ RSR_I [7]: RSR_I and RSR_E are related, but differ in the way they model relations. Specifically, RSR_I uses implicit modeling instead of explicit modeling in the relational embedding layer. traction. Study Simulation Strategies: In order to reduce investment risk, most investors will always choose a variety of different stocks as investment options. Therefore, we study the performance of our proposed TSN under different market simulation strategies (Top1, Top5, and Top10), buying stock sectors with Top1, Top5, and Top10 highest expected return ratio, respectively. For example, in the Top10 market simulation strategy, we allocate the budget equally, trade the Top10 stock sectors, and calculate the IRR value by accumulating the average returns of the selected 10 stock sectors on each test day. Comparison of market simulation strategies (Top1, Top5, Top10) on the IRR metric is shown in Figure 3. From the figure, the following phenomena can be observed: _ PHENOMENON 1. In general, the highest return ratios should be obtained by selecting the most top stock sectors. Therefore, Top1 strategy has achieved the highest return ratio within the nearly two-month range, but strategy Top1 is more volatile than strat-Information Technology and Control 2023/3/52 662 egy Top5 and strategy Top10. There are reasons to think that picking only the Top1 of more than 100 stock sectors is a risky strategy. From another perspective, Top10 strategy reduces the return rate because the portfolio is too diversified. Comprehensive consideration, the Top5 strategy is the recommended investment strategy for most investors. _ PHENOMENON 2. In most cases, the IRR performance of our prediction model in most test days follows the ranking of Top1>Top5>Top10. The reason may be that TSN can accurately predict the relative ranking of future returns. Once the predicted stock sector ranking is accurate, we can purchase the funds corresponding to the top n sectors with higher expected returns under the previously defined market simulation strategy to achieve a higher cumulative return rate.
Taking into account the strategy's performance across the market, we further compared our approach to six market indices, SSE Composite Index (SSE 000001. SH) , Shenzhen Component Index (SZ 399001.SZ), Dow Jones Industrial Average (DJI), NASDAQ Composite Index (IXIC), Nikkei 225 Index (N225), Hang Seng Index (HSI), Figure 4 shows the comparison of TSN with SSE , SZ, DJI, IXIC, N225 and HSI. Furthermore, in order to better judge the performance achieved, we compared two more desirable investment strategies: a) Market: We pick the funds with the highest return ratios (Top1, Top5 and Top10) from Eastmoney [20]; b) Selected: During the testing period, we buy the funds associated with highest return ratios (Top1, Top5 and Top10) from the dataset of our model. From Table 5, we have the following observations: _ OBSERVATION 1. There is a gap between the performance of the proposed method and the ideal investment strategy when trading the same number of stock sectors (Top1, Top5 and Top10). Since it is difficult to pinpoint the stock sector with the highest return ratio in a nearly two-month range, this result is acceptable. At the same time, it can also reflect that the stock recommendation task still has great potential for improvement. _ OBSERVATION 2. Our method, trading the Top1 ranked stock sector on each trading day, achieves best result than the Top5 and Top10 of the investment strategy Selected. These results demonstrate the competitiveness of our model and further demonstrate the effectiveness of TSN on the task of stock prediction.

Conclusions
In this work, we propose a Temporal-spatial Network (TSN) based method for Stock Sector Trend Prediction (SSTP), which can extract the temporal features based on multi-scale RPS time series of stock sectors and the spatial features with stock sector relation graphs to predict the stock sector trend. The experimental results on real data sets verify the effectiveness of this method for stock market trend prediction. In the future, in order to balance the benefits and risks, we plan to add a market scoring unit study inspired by human investment behavior. It takes the market sentiment indicator as the input, the dynamic adjustment of capital allocation.

Data Sharing Agreement
The datasets used and/or analyzed during the current study are available from the corresponding author on reasonable request.

Declaration of Conflicting Interests
The author(s) declared no potential conflicts of interest with respect to the research, author-ship, and/or publication of this article.