Dynamic Portfolio Strategy Using Clustering Approach

The problem of portfolio optimization is one of the most important issues in asset management. We here propose a new dynamic portfolio strategy based on the time-varying structures of MST networks in Chinese stock markets, where the market condition is further considered when using the optimal portfolios for investment. A portfolio strategy comprises two stages: First, select the portfolios by choosing central and peripheral stocks in the selection horizon using five topological parameters, namely degree, betweenness centrality, distance on degree criterion, distance on correlation criterion and distance on distance criterion. Second, use the portfolios for investment in the investment horizon. The optimal portfolio is chosen by comparing central and peripheral portfolios under different combinations of market conditions in the selection and investment horizons. Market conditions in our paper are identified by the ratios of the number of trading days with rising index to the total number of trading days, or the sum of the amplitudes of the trading days with rising index to the sum of the amplitudes of the total trading days. We find that central portfolios outperform peripheral portfolios when the market is under a drawup condition, or when the market is stable or drawup in the selection horizon and is under a stable condition in the investment horizon. We also find that peripheral portfolios gain more than central portfolios when the market is stable in the selection horizon and is drawdown in the investment horizon. Empirical tests are carried out based on the optimal portfolio strategy. Among all possible optimal portfolio strategies based on different parameters to select portfolios and different criteria to identify market conditions, 65% of our optimal portfolio strategies outperform the random strategy for the Shanghai A-Share market while the proportion is 70% for the Shenzhen A-Share market.

The problem of portfolio optimization is one of the most important issues in asset management. This paper proposes a new dynamic portfolio strategy based on the time-varying structures of MST networks in Chinese stock markets, where the market condition is further considered when using the optimal portfolios for investment. A portfolio strategy comprises two stages: selecting the portfolios by choosing central and peripheral stocks in the selection horizon using five topological parameters, i.e., degree, betweenness centrality, distance on degree criterion, distance on correlation criterion and distance on distance criterion, then using the portfolios for investment in the investment horizon. The optimal portfolio is chosen by comparing central and peripheral portfolios under different combinations of market conditions in the selection and investment horizons. Market conditions in our paper are identified by the ratios of the number of trading days with rising index or the sum of the amplitudes of the trading days with rising index to the total number of trading days. We find that central portfolios outperform peripheral portfolios when the market is under a drawup condition, or when the market is stable or drawup in the selection horizon and is under a stable condition in the investment horizon. We also find that the peripheral portfolios gain more than central portfolios when the market is stable in the selection horizon and is drawdown in the investment horizon. Empirical

Introduction
Portfolios is one of the hottest issues in the financial areas. It primarily concerns with the best combination of securities for specific profits that investors need. The fundamental theory about portfolio optimization can be chased back to Markowitz framework (Markowitz 1952), which select the allocation of investors' investment based on a mean-variance analysis.
Much effort has been put to solve and expand the Markowitz model. In the original Markowitz model, the risk is measured by the standard deviation or variance. Several other risk measures have been later considered, creating a family of mean-risk models, e.g., meanabsolute deviation (Konno and Yamazaki 1991, Feinstein 1993, Simaan 1997, semi-variance (Markowitz 1959, Choobineh andBranting 1986), Gini's mean difference (Yitzhaki 1982), CVaR (Konno and Yuuki 2002) and worst-case CVaR (Zhu 2009). To deal with the noise and error caused by historic sample data in estimation of the mean, variance and also the covariance among returns, many improved estimation methods has been used, such as Bayesian estimators (Frost andSavarino 1986, Jorion 1986), shrinkage estimators (Ledoit 2003, Ledoit andWolf 2004), and fuzzy set method (Tanaka andGuo 1999, Arenas Parra et al. 2001). Although the Markowitz model seems ideal in theory, many constraints involved indeed influence the portfolios in practical investments. Black and Litterman (1992) have found that short-sale constraints often cause no investment in many stocks, and Jagannathan (2003) have found that constraining portfolio weights to be nonnegative can reduce the risk in estimated optimal portfolios even when the constraints are wrong. To solve this problem, DeMiguel et al. (2009a) proposed a generalized approach to optimize portfolios under general norm-constrained portfolio.
Many studies have concentrated on the out-of-sample performance of minimum variance portfolios of Markowitz model. Comparison among different weight distributions have found that minimum variance portfolios are at least the same good as the others even when taking returns into consideration (Jorion 1986(Jorion , 1991, and equal weight portfolio(1/N rule) usually turns out to be better than those more complicated one (DeMiguel et al. 2009b). By comparing the efficiency of the equal weight portfolio and the minimum variance portfolios, Duchin (2009) have found that 1/N rule outperforms the mean-variance rule for individual small portfolios out of sample, but not for large portfolios. In addition, multi-objective portfolios (Zopounidis 2013, Lee 1980 and multiperiod investment (Hakansson 1971, Li andNg 2000) have also been proposed and carefully studied.
A great deal of works have subsequently contributed to the study of portfolios by using a variety of alternative methods, e.g., neural networks (Fernandez and Gomez 2007, Ko and Lin 2008, Nazemi et al. 2015, genetic algorithms (Chen et al. 2010, Chen andHirasawa 2011), simulated annealing (Crama and Schyns 2003), Random Matrix Theory (RMT) filtering (Daly et al. 2008, Dai et al. 2016, and hierarchical clustering (Onnela et al. 2003, Pozzi et al. 2013, Nanda et al. 2010, Liao and Chou 2013. Among these methods, hierarchical clustering is one of the most efficient methods for the selection of a basket of stocks for optimal portfolios. In fact, the selection of a set of stocks is pre-requisite for the Markowitz theory Michel 2009, Nanda andPanda 2014), since it is dedicated to the investment proportion of a limited number of selected stocks.
By using the hierarchical clustering method, the correlations between shares are revealed by the topological structure of the constructed stock network (Mantegna 1999, Onnela et al. 2004, Tumminello et al. 2005, Brida and Risso 2007, Garas and Argyrakis 2009, Aste et al. 2010, Kwapień and Drożdż 2012, Yang et al. 2014, and can be further applied to portfolio optimization. A minimum spanning tree (MST) (West 1996) description of the correlations between stocks has shown that the stocks included in the minimum risk portfolio (the optimal Markowitz portfolio) tend to lie on the outskirts of the asset network (Onnela et al. 2003(Onnela et al. , 2002. By extracting the dependency structure of financial equities using both MST and planar maximally filtered graphs (PMFG) methods, it has been found that portfolios set up from a selection of peripheral stocks have lower risk and better returns than portfolios set up from a selection of central stocks, in which the centrality/peripherality is measured by indices like degree, betweenness centrality, eccentricity, closeness and eigenvector centrality (Pozzi et al. 2013). A K-means clustering algorithm and its extension C-means clustering algorithm are applied to the classification of stocks, and the stocks selected from these classified groups are used for building portfolios, which perform better than the benchmark index (Nanda et al. 2010). Similar works have been done in India, Taiwan and China stock markets using the same K-means cluster analysis (Liao andChou 2013, Pai andMichel 2009). Furthermore, clusters or communities detected based on network graphics can also provide useful information for correlations among stocks (Tumminello et al. 2007, Aste et al. 2010, Song et al. 2011, Jiang et al. 2014, which has also been applied in the stock selection of portfolios (Boginski et al. 2014, Choudhury et al. 2014, Ross 2014). This type of method is analogous to the clustering algorithm for their similar way in stock selection from clusters or communities partitioned by specific approaches.
In recent studies, more and more evidences show that the topological structures of stock networks are evolving over time and changes markedly during financial crises (Aste et al. 2010, Song et al. 2011, Fenn et al. 2011, Drożdż et al. 2000, Podobnik et al. 2010, Kenett et al. 2010, Ren and Zhou 2014, Jiang et al. 2014. Therefore, a fixed set of stocks is not a wise choice for the portfolio selection under different market conditions. One possible way of solving this problem is to identify the stock clusters based on the network graphics in different time periods (moving windows) and then do the portfolio selection from the identified clusters in each period (Pozzi et al. 2013). An alternative way is to use the dynamic conditional correlations (DCC) method to estimate time-varying correlations among stock returns based on the Markowitz framework (Case et al. 2012, Kotkatvuori-Örnberg et al. 2013, Miralles-Marcelo et al. 2015. A new estimator called detrended cross-correlation coefficients (DCCA) is also used to describe the correlations between nonlinear dynamic series (Sun and Liu 2016, Podobnik and Stanley 2008, Zhou 2008, Jiang and Zhou 2011. Other works refer to evolutionary algorithms include Michel 2009, Suganya andPai 2012).
The main motivation of this paper is to propose a new dynamic portfolio strategy based on the time-varying structures of the financial filtered networks in Chinese stock markets. A moving window with size δt is used to study the variance of stock networks over time t. We choose the MST method to filter out the network graph in each window for its validity and simplicity, which is generated by connecting the nodes with most important correlations. The portfolio selection is determined by the network structure in the previous window (selection horizon), which is picked from a selection of peripheral stocks, most diverse corresponding to the Markowitz portfolio with minimum variance (Pozzi et al. 2013), and central stocks, highly correlated and synchronous in price movements. The selected portfolios are subsequently used for investment in the following investment horizon.
The underlying market conditions are further considered in our dynamic portfolio strategy, which composes the investment strategy together with the portfolio selection. A recent study has verified that accurate price and volatility predictions can be used as a basis for the particular trading strategy adopted for portfolio (Choudhury et al. 2014). In our work, we suppose that the optimal portfolio can change under different market conditions, and portfolio investments are implemented based on both historical price change and price prediction in future. For simplicity, three market conditions: drawup and drawdown trends of the daily price and a relatively stable status in between are identified respectively in the selection and investment horizons. A variety of selected portfolios are compared under different combinations of market conditions in the two horizons, and the optimal portfolio with the largest profit is found out in each market condition.
To further testify the efficiency of our dynamic portfolio strategy, we perform a training using the first half of sample data, and use the optimal portfolio obtained from training to do investments using the remaining half data. Our results show that the optimal portfolio outperform the benchmark stock index on average. The paper is organized as follows. In Section 2, we introduce our database and their summary statistics. Sections 3 provides the methods used in our study, including network construction, portfolio selection, and determination of investment horizon and market condition. The results of the optimal portfolios and their relevant performances are presented in Section 4. Section 5 summarizes our findings.

Data
Our daily data include 181 × 2 stocks listed on Shanghai and Shenzhen A-Share markets, which have the largest volumes in two major stock exchanges in mainland China, over the period of 15 years from January 1, 2000 to December 31, 2014. To ensure the continuity and integrity of the data, the stocks selected in our study are most actively traded stocks throughout the sample period. For this purpose, we filter out those stocks which were once suspended from the market for more than 46 trading days, about 1% of a total of 3,627 trading days. This filtering yields the sample data including 181 A-Share stocks for each market.
The return series of a certain stock i is computed as r i (t) = ln P i (t) − ln P i (t − 1), where P i (t) is the closing price for stock i on the t-th day. The price returns for 181 × 2 stocks are calculated, and the effects of corporate actions are eliminated, for instance the cash dividend, the bonus share, and the rights issue. The summary statistics of the sample stocks and their price returns are listed in Table 1, including the number of stocks, the number of records, the mean, standard deviation, maximum, minimum, skewness and kurtosis of the returns in the two markets. The number of daily records of sample stocks for Shanghai and Shenzhen A-Share markets are 643,404 and 639,607 respectively. The values of the mean, standard deviation, maximum and minimum of the daily returns are very similar for the two markets. Returns in both markets show negative skewness and leptokurtosis, which have been widely observed in stock markets (Mandelbrot 1963, Cont 2001).

Methods
For a certain daily point t, a correlation matrix is calculated by the Pearson correlation coefficient estimator using the returns series in the window {t − δt + 1, . . . , t}, and based on which a stock network is constructed by the MST method, see details in network construction in Methods. Ten categories of portfolios are selected respectively from a set of 10% most peripheral and central stocks in the MST graph, in which the centrality/peripherality is measured by five parameters capturing network topology: degree, betweenness centrality, distance on degree criterion, distance on correlation criterion and distance on distance criterion. For more details, see portfolio selection in Methods. The selected portfolios are used for investment in the following horizon {t+1, . . . , t+ ∆t}, with a equal weight for each selected stock, following (DeMiguel et al. 2009b) in which 1/N portfolio strategy is proven to be more efficient than the mean-variance model. The investment returns of chosen portfolios are calculated under nine combinations of market conditions in the selection and investment horizons. The market condition includes drawup (U), drawdown (D) and stable (S) status identified by trading day criterion, amplitude criterion, "OR" criterion, and "AND" criterion. Please refer to the descriptions about identification of market conditions in Methods. Since the results obtained from three criterions are quantitatively similar, we mainly introduce our research results based on the trading day criterion. The data point then skips to t + ϕ, and the same portfolio strategy is adopted by selecting the portfolio in the window (horizon) {t + ϕ − δt + 1, . . . , t + ϕ}, and using the selected portfolio for investment in the horizon {t + ϕ + 1, . . . , t + ϕ + ∆t}. The investment returns of 10 categories of selected portfolios are calculated under nine combinations of market conditions in the two horizons, and the optimal portfolio is found out evaluated by their average performances over different moving windows.
A suitable choice of δt and ϕ will indeed make the network captures the information of original data as much as possible. The larger δt is and the smaller ϕ is, the more stable the network structure is, and the more the market information is filtered out. On the contrary, the network structure is more volatile and unauthentic (Strogatz 2001, Krings et al. 2012, though the temporary fluctuations can be easily noticed. Many studies have revealed that in order to ensure stocks have enough number of trading days to be statistically significant, δt should be larger than the number of sample stocks N = 181 Wolf 2004, Mardia et al. 1979). By careful observation and precise calculation, we choose δt = 10 months (≈ 200 days) and ϕ = 1 month(≈ 20 days), thus we have 161 daily points used for portfolio investments in total. The determination of the optimal values of the parameter ϕ and the size of investment horizon ∆t will be described in detail in network construction and determination of investment horizon in Methods respectively.

Network construction based on MST method
Denote r i (t) and r j (t) as the logarithmic returns of stock i and j, the Pearson correlation coefficient between their return series is given by where E[·] represents the mathematical expectation of the sequence over time t. Before the construction of MST graph, the correlation coefficient is converted into the distance between Fei Ren, Ya-Nan Lu, Sai-Ping Li, Xiong-Fei Jiang, Li-Xin Zhong and Tian Qiu stock i and j by the following equation The distance d(i, j) ranges from 0 to 2, and a small distance corresponds to a large correlation coefficient. For the 181 sample stocks respectively in the Shanghai and Shenzhen A-Share markets, a distance matrix with 181 × 181 elements is obtained for each market. The estimation of the correlation matrix has unavoidably associated with a statistical uncertainty, which is due to the finite length of the return series as well as noise.
We choose the MST method to filter out the network graph in each window so as to eliminate the redundancies and noise, and meanwhile, maintain significant links. In constructing the minimum spanning tree, we effectively reduce the information space from n(n − 1)/2 correlation coefficients to n − 1 tree edges, in other words, compress the amount of information dramatically. The procedure to build the MST network can be carried out as follows: First, arrange the distances between all pairs of stocks in an ascending order, then start by matching the nearest nodes, and continue matching following the ordered list if and only if the graph obtained after the matching is still a tree. Edges maximizing the sum of the correlations over the connections in the tree are more likely to stay in this method. Many researches like references (Mantegna 1999, Kim et al. 2002, Onnela et al. 2004, Lee et al. 2007, Micciche et al. 2003 have used the MST model to filter networks. Given the data used in our study, we choose Prim algorithm to build our network.
There exists a close relationship between correlation coefficient matrices and MST distance matrices. To investigate their relationship, we calculate the Pearson linear correlation coefficients between the value of mean, variance, skewness and kurtosis of the elements in both matrices. Generally speaking, mean value of the elements in the two matrices are anti-correlated, and there exist similar feature for skewness. Variance, together with kurtosis of the elements in two matrices are positively correlated. These characteristics can be expected in view of how distances are constructed from the correlation coefficients. To confirm that, we provide the Pearson linear correlation coefficients of these variables in table 2. We find that all variables of the elements in the two matrices are strongly correlated except kurtosis, showing that most of market information has been extracted by our MST network. In general, with a suitable choice of ϕ, the relationship between correlation coefficient matrices and MST distance matrices will be enhanced. With a series of tests, we find that ϕ = 1 month turns out to be the optimal choice.

Portfolio selection based on topological parameters
Five parameters are used to measure the centrality and peripherality of nodes in portfolio selection: I degree, II betweenness centrality, III distance on degree criterion, IV distance on correlation criterion and V distance on distance criterion. Here, we present a brief introduction of these parameters. I. Degree K, the number of neighbor nodes connected to a node. The larger the K is, the more the edges that are associated with this node.
II. Betweenness centrality C, reflecting the contribution of a node to the connectivity of the network. Denote V as the set of nodes in the network, for nodes i and j, C of a node can be calculated as where σ ij is the number of shortest routes from node i to node j, σ ij (V ) is a subsector of σ ij whose routes pass through this node. Distance refers to the smallest length from a node to the central node of the network. Here, three types of definitions of central node are introduced to reduce the error caused by a single method. Therefore three types of distances are described here.
III. Distance on degree criterion D degree , central node is the one that has the largest degree. IV. Distance on correlation criterion D correlation , central node is the one with the highest value of the sum of correlation coefficients with its neighbors; V. Distance on distance criterion D distance , central node is the one that produces the lowest value for the mean distance.
We use the parameters defined above to select the portfolios. Nodes with the largest 10% of degree or betweenness centrality are chosen to be in the central portfolio, and nodes whose degree equals to 1 or betweenness centrality equals to 0 are chosen to be in the peripheral portfolio. Similarly, we define the nodes ranking the top 10% of distance as the stocks of the peripheral portfolios, and the bottom 10% as the stocks of the central portfolios. The difference in the definitions results from a simple reason: For an MST network, the number of peripheral nodes (i.e., leaf nodes of a network), whose degree equals to 1 and betweenness centrality equals to 0, is much larger than 10% of the total nodes. We need to mention that it makes no difference to our results if we select randomly from these peripheral nodes so as to equal to the number in each portfolio.
The central portfolios and peripheral portfolios represent two opposite side of correlation and agglomeration. Generally speaking, central stocks play a vital role in the market and impose strong influence on other stocks. While the correlations between peripheral stocks are weak and contain much more noise than central stocks. We have learned in our study that the two kinds of portfolios have their own features under different market conditions.

Determination of investment horizon
In this part we will discuss the optimal choice of the length of investment horizons ∆t. In general, the length of investment horizon cannot be too long, otherwise the topological properties of the network will change and the selected central or peripheral portfolios will change accordingly. On the other hand, the length of investment horizons cannot be too short, or the returns will be greatly influenced by market noises or exogenous events. Here, we compare the profits gained in different time horizons, namely 1 month, 5 months, 10 months and 15 months.
Sharpe ratio, defined as the ratio of expected value of the excess returns to its standard deviation (Sharpe 1994), is widely used to evaluate the performance of portfolios practically (Jagannathan 2003, Scholz 2007. Table 3 shows Sharpe ratios of portfolios with different investment horizons, in which there is no specular length that could maximize Sharpe ratio in all circumstances. What's more, one-way ANOVA is used to test the equality of excess returns gained in different length of investment horizons. In table 3, the p-values for different horizons Fei Ren, Ya-Nan Lu, Sai-Ping Li, Xiong-Fei Jiang, Li-Xin Zhong and Tian Qiu are all insignificant, which indicates the choice of horizon's length doesn't affect the portfolio returns. In order to match the length of selection horizons and investment horizons and facilitate our identification of the market conditions, we choose ∆t = 10 months for portfolio investment.

Identification of market conditions
Market conditions, which describes the general trend of the market index over a specific horizon, are measured by using four criteria: I trading day criterion, II amplitude criterion, III "OR" criterion and IV "AND" criterion. The market indices corresponding to the Shanghai A-Share market and the Shenzhen A-Share market include the Shanghai A-Share Index and the Shenzhen A-Share Index. I. Trading day criterion. The ratio r d of the number of days with rising index to the total number of trading days in a specific time window is given by, where N i + is the number of days in which the closing price is larger than that of the previous day and N i is the total number of trading days in the i-th time window. The ratio r d ranges from 0 to 1, and a large value of r d represents a drawup condition, while a small value of r d represents a drawndown condition. With the thresholds θ + and θ − , we identify a drawup condition if r d > θ + , a drawdown condition if r d < θ − , and a stable condition if θ − ≤ r d ≤ θ + .
II. Amplitude criterion. The ratio r f of the sum of the amplitudes of the trading days with rising index to the sum of the amplitudes of the total trading days in a specific time window is given by, where T i + is the set of days in which the closing price is larger than that of the previous day, T i is the set of all the trading days in the i-th time window, and P (t) is the closing price on the t-th day. Similarly, with the thresholds θ + and θ − , we identify a drawup condition if r f > θ + , a drawdown condition if r f < θ − , and a stable condition if θ − ≤ r f ≤ θ + .
III. "OR" criterion, we identify a drawup condition if r d > θ + or r f > θ + , and a drawdown condition if r d < θ − or r f < θ − . A stable condition is identified if θ − ≤ r d ≤ θ + and θ − ≤ r f ≤ θ + . Situations like r d > θ + and r f < θ − , or r f > θ + and r d < θ − do not exist under the thresholds we choose.
IV. "AND" criterion, we identify a drawup condition if r d > θ + and r f > θ + , and a drawdown condition if r d < θ − and r f < θ − . A stable condition is identified if θ − ≤ r d ≤ θ + or θ − ≤ r f ≤ θ + . Situations like r d > θ + and r f < θ − , or r f > θ + and r d < θ − do not exist under the thresholds we choose.
The ratios r d and r f over time are shown in figure 1, each point on the curve is measured by using the market indices in a 10-month horizon following this point. In the figure, the patterns of r d and r f show some differences, which cause slight distinctions in the identification of market conditions. In our study, we choose θ + = 0.55, θ − = 0.45 as the thresholds. Theoretically, other choices of thresholds will work in our study. For a larger value of θ + and a smaller value of θ − , the number of samples of drawup or drawdown conditions is not statistically sufficient for the lack of data. For a smaller value of θ + and a larger value of θ − , the drawup and drawdown conditions cannot be distinctly identified. Other suitable choices of thresholds around θ + = 0.55, θ − = 0.45 have also been studied and the results do not change significantly.
Market conditions identified based on the trading day criterion for the Shanghai and Shenzhen A-Share markets are shown in figure 2. The upper triangle indicates a drawup horizon from the current time to 10 months later, and similarly the lower triangle indicates a drawdown horizon and the cross symbol indicates a stable horizon. It seems that most of the drawup and drawdown conditions identified in our study are proper and sustainable in both markets.
For each time window we get three possible market conditions, we thus get nine combinations of market conditions in selection and the following investment horizons: Drawup in both selection horizon and investment horizon (UU), drawup in the selection horizon and stable in the investment horizon (US), drawup in the selection horizon and drawdown in the investment horizon (UD), stable in the selection horizon and drawup in the investment horizon (SU), stable in both selection and investment horizons (SS), stable in the selection horizon and drawdown in the investment horizon (SD), drawdown in the selection horizon and drawup in the investment horizon (DU), drawdown in the selection horizon and stable trend in the investment horizon (DS), drawdown in both selection and investment horizons (DD).

Evolution of network structures
Practically, the network structure is evolving over time and changes remarkably during crises. Some evolutionary characteristics of the market can be found from the topological parameters of the networks. First, the average correlation coefficients among all stocks reflect the overall connections of the spanning tree, which are shown in figure 3. To learn more details about the evolution of correlation coefficients in each window, the correlation coefficients ranging within a standard deviation are shown. The average correlation coefficients rise sharply in the periods of market crashes in 2001 and 2008. As the market recovers, the average correlation coefficients decline correspondingly. This finding is consistent with the conclusions illustrated by previous researches, indicating that the connection between stocks will be enhanced during the crisis (Onnela et al. 2003, Drożdż et al. 2000. To better understand the variance of network structure over time t, we choose two typical examples of MST networks begin at January 1, 2000 and January 1, 2008, when stock prices are stable in the former window while volatile in the latter. Their network structures are shown in figure 4. We can see that the distances between stocks are much smaller, and the corresponding network shrinks to a large extent during the 2008 market crisis.
More specific than correlation coefficients, other parameters namely degree, betweenness centrality, distance on degree criterion, distance on correlation criterion and distance on distance criterion, can tell us more information about the stocks and networks. These parameters are used for selecting portfolios in our later study.
The parameter degree K describes the relationship between a stock and its neighbors. Many studies have found that degree in empirical networks follows a power-law distribution (Newman 2001, Strogatz 2001, Lee et al. 2007, where the distribution of K has a formula P (K) ∼ K −α . Here, we observe a power-law behavior for the probability density function (PDF) of K in figure 5. A maximum likelihood estimation method proposed by Newman is used to fit the distributions (Clauset et al. 2009). The exponents α = 3.6202, α = 3.5597 are estimated for P (K) in Shanghai and Shenzhen A-Share markets respectively. Another parameter betweenness centrality C reflects the contribution of a stock to the connectivity of the whole network, resembling degree to some extent. PDF of C, which is also shown in figure 5, also shows a power-law behavior. The exponents α = 2.0562, α = 2.1927 are estimated for P (C) in Shanghai and Shenzhen A-Share markets. Results in the figure show the scale free property of MST networks in the two markets, and also the intense connection between stocks existing in a small number of central stocks, whose volatility might have a great impact on its neighbors.
Distance, known as the total length from a node to the central node of the network, has three categories according to the choice of central node in our study, namely, distance on degree criterion D degree , distance on correlation criterion D correlation and distance on distance criterion D distance . Their PDFs are shown in figure 6. Although the three categories of distances vary from each other, their distributions as well as the stocks selected by them share similar behavior. As can be seen from figure 6, few stocks are very distant from the central node, while most stocks have a relatively short distance with the central node. In addition, note that the MST networks change over time, therefore its central node also changes.

Comparison between portfolio strategies under different market conditions
In this part, we compare the returns of central and peripheral portfolios and find the optimal portfolio among them. The portfolios are selected by using five parameters, i.e., K, C, D degree , Table 4. Excess returns of central and peripheral portfolios in the Shanghai A-Share market are compared based on one-way ANOVA. Central and peripheral portfolios are selected based on five parameters, i.e., K, C, D degree , D correlation and D correlation , and their excess returns are calculated under different combinations of market conditions based on trading day criterion. The listed variables include the number of samples (Num), f -value and p-value of one-way ANOVA, excess returns of central and peripheral portfolios under each combination of market conditions. Results which are not significant or calculated with less than 11 samples are not shown. ( *indicates significance at 10% level, **indicates significance at 5% level ). D correlation and D correlation , in the selection horizon, and the returns of the selected portfolios are calculated in the following investment horizon. The length of investment horizon is set to be 10 months as we discuss in Determination of investment horizon in Methods. In this paper, the selection horizon lasts from January 1, 2000 to February 31, 2014, and the investment horizon lasts from November 1, 2000 to December 31, 2014, thus we have 161 daily points used for portfolio investments in total. We calculate the returns of central portfolios and those of peripheral portfolios, and we use the returns of random portfolios as a benchmark. Random portfolio is defined as a random selected portfolio containing 10% of the total stocks. We first classify the samples of returns of selected portfolios and random portfolios into groups according to nine combinations of market conditions identified using thresholds θ + = 0.55, θ − = 0.45 based on trading day criterion. For each combination of market conditions, we calculate the average return of each individual stock in the group of selected portfolios and the average return of each individual stock in the group of random portfolios. The difference between the average returns of selected portfolios and random portfolios is defined as excess return. Furthermore, one-way ANOVA is used to test the equality of the excess returns between central portfolios and peripheral portfolios under the same market condition. Null hypothesis of one-way ANOVA, that the excess returns of central portfolios and peripheral portfolios are equal, are tested under a specific significance level. If the null hypothesis is rejected, the excess returns of the two portfolios are significantly different. If the null hypothesis cannot be rejected, there is no significant difference between excess returns of central portfolios and those of peripheral portfolios.
The results of one-way ANOVA test and the excess returns of central and peripheral portfolios for Shanghai and Shenzhen A-Share markets are listed in Tables 4 and 5 respectively. Note that if the sample number is less than 11 under a specific combination of market conditions, we do Table 5. Excess returns of central and peripheral portfolios in the Shenzhen A-Share market are compared based on one-way ANOVA. Central and peripheral portfolios are selected based on five parameters, i.e., K, C, D degree , D correlation and D correlation , and their excess returns are calculated under different combinations of market conditions based on trading day criterion. The listed variables include the number of samples (Num), f -value and p-value of one-way ANOVA, excess returns of central and peripheral portfolios under each combination of market conditions. Results which are not significant or calculated with less than 11 samples are not shown. not show the result of this combination for the lack of data. In addition, if there is no significant difference between excess returns of central portfolios and peripheral portfolios, the results are also not shown.
In table 4, we can see from the p-value that the excess returns between central and peripheral portfolios of the listed groups are all significantly different at the 10% level, and most of them are significantly different at the 5% level. By comparing the excess returns of central and peripheral portfolios under all the listed combinations of market conditions, we find that central portfolios are more profitable except for two cases. More specifically, when the market is stable in the investment horizon, whether the market is stable or drawup in the selection horizon, the excess returns of central portfolios are significantly larger than those of peripheral portfolios. When the market is drawdown in the selection horizon and drawup in the investment horizon, or when the market is stable in the selection horizon and drawup in the investment horizon, the central portfolios outperform peripheral portfolios using K, D degree , D correlation and D distance as parameter. Besides, when the market is stable in the selection horizon and drawdown in the investment horizon, peripheral portfolios gain more than central portfolios using D degree and D distance as parameter. However, under the same market condition while using K as parameter, the optimal portfolio is the central one with a relatively small gap between the excess returns of the two portfolios.
In table 5 for the Shenzhen A-Share market, we find the results are generally coincide with those for Shanghai A-Share market. Central portfolios outperform peripheral portfolios under every combination of market conditions when there exist significant difference between their returns. What's more, central portfolios selected by K, D degree , D correlation and D distance outperform peripheral portfolios when the market goes through a rising trend in both selection and investment horizons.
Here, we provide the PDF of the returns of individual stocks in central and peripheral portfolios for the Shanghai and Shenzhen A-Share markets in figures 7 and 8 respectively. In figure 7, under most market conditions, the center of distribution for central portfolios is on the right side of that for peripheral portfolios, indicating that the returns of central portfolios are on average larger than those of peripheral portfolios. However, when portfolios are selected with respect to D degree or D distance , the center of distribution for peripheral portfolios is on the right side of that for central portfolios under market conditions of SD. These results are consistent with that from table 4. We can also learn from figure 7 that returns of central portfolios distribute at a relatively narrow range compared with returns of peripheral portfolios under most market conditions, showing the close connection among stocks in central portfolios. Figure  Similar test and comparison are carried out using amplitude criterion, "AND" criterion and "OR" criterion in identification of market conditions for both markets. Using amplitude criterion and "AND" criterion, the results are very similar to those using trading day criterion. For "OR" criterion, we find that if the market goes through a turnaround, falling in the selection horizon and rallying in the investment horizon, the central portfolios are proven to be more profitable. More comprehensively, extra efforts have been made for other values of thresholds in the identification of market conditions. Despite some statistical distinction, the conclusions we get show great similarities with the above, which in turn confirm the reliability of our conclusion.
We summarize and interpret our results in three aspects. First, if the market rises in the investment horizon, the central portfolios should be the best choice. Specifically, if the market Fei Ren, Ya-Nan Lu, Sai-Ping Li, Xiong-Fei Jiang, Li-Xin Zhong and   has a drawup trend in both selection and investment horizons, stocks in central portfolios will be more likely to rise due to their collective movements in rising, while stocks in peripheral portfolios may be too diversified to make profits. If the market rises in the investment horizon after declining, stocks in central portfolios are more likely to suffer losses in the selection horizon, and are more likely to rise in the investment horizon after hitting rock bottom. Second, if the market is stable in the investment horizon and has just gone through a drawup or stable trend in the selection horizon, central portfolios are preferred. Since stocks in central portfolios are closely related, their prices move in a similar way. After the drawup or stable trend in the selection horizon, stocks in central portfolios tend to maintain the drawup or stable trend in the investment horizon. Returns of stocks in peripheral portfolios are too diversified in the stable investment horizon, some negative returns of individual stocks will be more likely to be in the portfolio. Last, if the market falls after a period of stable fluctuation, peripheral portfolios are preferred so as to avoid risks. The diverse characteristic of peripheral portfolios is a good way to reduce risk and secure capital.

Empirical test of optimal portfolio strategy
We have compared the performances of central and peripheral portfolios under different combinations of market conditions. We now attempt to pick out the optimal portfolio strategy and apply it to make real investment based on an empirical test. We use the data from 2000 to 2010 to select the optimal portfolio under each specific combination of market conditions through a training process, and use the selected optimal strategy according to the current market condition Table 6. Excess returns listed are gained by the optimal portfolio strategy for the Shanghai and Shenzhen A-Share markets. The optimal strategy is picked out from all the possible categories of portfolios selected with respect to five parameters, i.e., K, C, D degree , D correlation and D distance , based on four criteria, i.e., trading day criterion, amplitude criterion, "OR" criterion and "AND" criterion. Excess returns in boldface are positive which have returns larger than the random strategy.
Shanghai A-Share market Shenzhen A-Share market trading day amplitude "OR" "AND" trading day amplitude "OR" "AND" criterion criterion criterion criterion criterion criterion criterion criterion to make investment based on the data from 2010 to 2014. The test is performed specifically as follows.
I. Training to find the optimal portfolio strategy. The optimal portfolio strategy is picked out using the methods mentioned in the last section. We first select central and peripheral portfolios based on five parameters of the network in the selection horizon, and then invest these portfolios in the investment horizon. Excess returns of central and peripheral portfolios under each market condition, identified by one of the four criteria, are calculated and tested using one-way ANOVA. If the excess returns of central and peripheral portfolios are significantly different, portfolio with the higher excess returns is chosen as the optimal portfolio under the specific market condition. An optimal portfolio strategy comprises all the optimal portfolios under different combinations of market conditions. II. Applying optimal strategy to investment. Before investment, market conditions in the investment horizon need to be predicted. Since the policy and economic environment have a great impact on Chinese stock markets, it's possible to make a general assessment of the prospect for the stock markets in the investment horizon based on the current market information. To simplify our study, we identify the market conditions in the investment horizon using empirical data, and in other words, our strategy performs well when the market condition in the investment horizon has a clear trend. Based on the identified combination of market conditions, the optimal portfolio of the optimal strategy picked out in step I is then selected and used for further investment. If the combination of market conditions do not appear, investment will not be made. The length of selection and investment horizons are 10 months, the same as in the previous section.
We calculate the excess returns of our strategy, measured as the difference between the average return of each individual stock in the optimal portfolio strategy and random strategy. Random strategy comprises random portfolios, defined as a randomly selected portfolio containing 10% of the total stocks, under different combinations of market conditions. Since the optimal strategy changes as we use different parameters to select portfolios and different criteria to identify market conditions, the excess returns which are shown in table 6 differ correspondingly. It can be seen from the table that, in most cases higher profits can be obtained by our strategies compared with the random strategy. Specifically, 65% returns of our strategies are larger than those of the random strategy in the Shanghai A-Share market, and the proportion is 70% in the Shenzhen A-Share market. Furthermore, when using K as the parameter to select central or peripheral portfolios, returns of our strategies are always higher than those of the random strategy. While the portfolios selected by C rarely outperform random portfolios. Since our strategy based on "AND" criterion in the Shanghai A-Share market is rarely used, the excess returns under which are mostly negative. The most profitable strategy for the Shanghai A-share Fei Ren, Ya-Nan Lu, Sai-Ping Li, Xiong-Fei Jiang, Li-Xin Zhong and Tian Qiu Table 7. Specific optimal portfolios under particular combinations of market conditions comprise the strategy which has the highest return. The most profitable strategy for the Shanghai A-Share market uses D distance to select portfolios and identifies market conditions based on trading day criterion, and the most profitable strategy for the Shenzhen A-Share market uses D correlation to select portfolios and identifies market conditions based on trading day criterion. market uses D distance as the parameter to select portfolios and identifies market conditions based on trading day criterion, which has an excess return 0.0416. For the Shenzhen A-Share market, the most profitable strategy uses D correlation as the parameter to select portfolios and identifies market conditions based on trading day criterion, which has an excess return 0.0632. Table 7 lists the optimal portfolios of the most profitable strategy under different combinations of market conditions for both markets. One can see that central portfolios are chosen as the optimal portfolios under market conditions of UD, SS and DU, and peripheral portfolios are chosen under market conditions of SD for the Shanghai A-share market. For the Shenzhen A-Share market, central portfolios are chosen as the optimal portfolios under market conditions of SU and SS. The average returns of each individual stock in every investment horizon of the most profitable strategy and random strategy are plotted in figure 9, where the crosses are the average returns gained by the most profitable strategy in each investment horizon and the black solid line shows the average returns gained by random strategy. In 65.85% of the investment horizons, the average returns gained by the most profitable strategy are larger than those gained by the random strategy in the Shanghai A-Share market, and the proportion is 91.30% in the Shenzhen A-Share market.
We further find out the strategy that has the largest probability of gaining more profits than the random strategy, and in other words it outperforms random strategy in most of investment horizons. This strategy uses D correlation as the parameter to select portfolios and identifies market conditions based on trading day criterion for both two markets. The optimal portfolios under different combinations of market conditions are listed in table 8. One can see that cen- Table 8. Specific optimal portfolios under particular combinations of market conditions comprise the strategy that has the largest probability of gaining more profits than the random strategy. This strategy uses D correlation as the parameter to select portfolios and identifies market conditions based on trading day criterion for both markets.  Figure 10. Average returns of the strategy (cross) that has the largest probability of gaining more profits than the random strategy (black solid line) in the Shanghai A-Share market (a) and the Shenzhen A-Share market (b). This strategy is described in table 8.
tral portfolios are chosen as the optimal portfolios under market conditions of UD, SS and DU for the Shanghai A-share market. For the Shenzhen A-Share market, this strategy is also the most profitable strategy with central portfolios chosen as the optimal portfolios under market conditions of SU and SS. Similar to the above, the average returns of each individual stock in every investment horizon of this strategy and random strategy are plotted in figure 10. In 70% of the investment horizons, the average returns gained by our strategy are larger than the random strategy in the Shanghai A-Share market, and the proportion is 91.30% in the Shenzhen A-Share market.

Summary
In this paper, we propose a new dynamic portfolio strategy based on the time-varying structures of MST networks for the Shanghai and Shenzhen A-Share markets. The strategy first selects central and peripheral portfolios in the selection horizon using five topological parameters and uses the selected portfolios for investment in the investment horizon. Nine combinations of market conditions haven been considered when comparing the excess returns of central and peripheral portfolios, which are identified by the ratio of the number of trading days with rising index to the total number of trading days, or the ratio of the sum of the amplitudes of the trading days with rising index to the sum of the amplitudes of the total trading days. By picking out the portfolios with larger excess returns under different combinations of market conditions, the optimal portfolios under specific market conditions have been found out: I. If the market is likely

REFERENCES
to have a drawup trend in the following investment horizon, central portfolios should be the best choice, while the peripheral portfolios usually perform worse for excessive diversification. II. If the market will be in a relatively stable state in the investment horizon, central portfolios are preferred unless the market just goes through a drawdown trend in the selection horizon. III. If the market is likely to have a drawdown trend in the investment horizon and the market is stable in the selection horizon, the peripheral portfolios should be chosen to reduce risks. Empirical tests have also been carried out and verified the efficiency of our optimal portfolio strategy. We have used the data from 2000 to 2010 to select the optimal portfolio under each specific combination of market conditions through a training process. The selected optimal strategy have been selected according to the current market condition to make investment based on the data from 2010 to 2014. By calculating the excess returns of the optimal portfolio strategies, our strategies have been found to outperform the random strategy in most cases. Among all possible optimal portfolio strategies based on different parameters to select portfolios and different criteria to identify market conditions, 65% of our optimal portfolio strategies outperform the random strategy for the Shanghai A-Share market and the proportion is 70% for the Shenzhen A-Share market. Using degree K as the parameter to select central or peripheral portfolios, returns of our strategies have been always higher than those of the random strategy. What's more, the excess returns of the most profitable strategies in the Shanghai and Shenzhen A-Share markets are 0.0416 and 0.0632 respectively. The strategy that has the largest probability of gaining more profits than random strategy, outperforms random strategy in 70% of the investment horizons for the Shanghai A-Share market, and the proportion is 91.30% for the Shenzhen A-Share market.