Original | ETF Trading Strategy Combining Price Momentum and Crowding
Source | China Galaxy Securities Research Institute, Typesetting: Python Data Science
1. Introduction
This article mainly introduces the trading strategy for margin-financed ETFs. As an index tracking tool, ETFs have good asset allocation value. At the same time, by combining price diffusion and Minsky moments, the advantages of ETFs can be fully utilized. Based on a “top-down” approach to constructing ETF trading strategies, it can capture price momentum and reduce losses during the “Minsky” moment at the end of the momentum. However, the price momentum indicators have subjective factors and limitations of non-intelligence. Therefore, this article uses machine learning methods to improve the ETF strategy, with more direct and richer input variables, resulting in effective enhancement compared to the original strategy. Backtesting on data since 2020 shows that the annualized return of the strategy is 33.99%, with a Sharpe ratio of 1.37 and a Calmar ratio of 1.57.
2. Background Knowledge
Margin Financing and Securities Lending
Margin financing and securities lending (two financing) trading mechanism refers to the mechanism that allows investors to trade stocks using their own funds (financing) or borrowed funds (securities lending) on the securities exchange. Under this mechanism, investors can use leverage to trade stocks within a certain ratio, thus increasing profit levels. Specifically, the margin financing and securities lending trading mechanism usually includes two parts: margin trading and securities lending. Margin trading refers to investors obtaining loans by pledging their held stocks to securities companies, and then using these funds to purchase other stocks. Securities lending refers to investors borrowing stocks, selling them within a certain period, and promising to return the same quantity of stocks within the agreed time. In margin financing and securities lending trading, investors need to pay certain interest and handling fees. In addition, leverage ratios will also be restricted to control investors’ risks. Although the margin financing and securities lending trading mechanism can increase investors’ profit opportunities, it also carries higher risks, as leveraged trading may amplify investment losses, requiring investors to choose and manage risks carefully.
ETF stands for Exchange Traded Fund. It is an open-end index fund designed to provide investors with broad exposure to a specific market, industry, or investment strategy. ETFs trade similarly to individual stocks and can be traded on securities exchanges through regular brokerage accounts. Compared to traditional index funds, ETFs offer higher liquidity and trading flexibility, as they can be traded at any time during trading days, and prices fluctuate in real-time. Additionally, ETFs typically provide diversified investment opportunities at low costs, making them one of the increasingly popular investment tools. Some well-known A-share ETFs include Huaxia SSE 50 ETF, Bosera CSI 300 ETF, and Harvest CSI 500 ETF. They can also track specific industries or investment strategies.
As of now, there are 249 margin financing and securities lending ETFs in the Shanghai and Shenzhen markets, with a total managed asset scale exceeding 1.2 trillion yuan, already establishing a good trading foundation. Moreover, the returns of ETFs from different asset classes vary significantly, with the maximum and minimum monthly returns of stock ETFs differing by nearly 20% in the past year.
ETF Industry Classification
Based on the correlation between stock ETF returns and the Shenwan first-level industry index returns, margin-financed stock ETFs (excluding broad-based ETFs and overseas ETFs) are classified into 22 industries. Due to the small number of ETFs, small scale, and low fund shares in some industries, appropriate merging between industries is conducted to balance scale and liquidity.

Influenced by economic cycles, investor sentiment, and other factors, industry market rotation leads to significant differences in returns between different industries, with the difference between the best and worst performing industries’ monthly returns reaching a maximum of 25.86% and a minimum of 8.83%. Due to the differences in ETF returns across industries, ETF industry timing has practical significance, and increasing the allocation weight of high-return industry ETFs through industry timing can improve strategy returns.

Price Momentum
Price momentum strategy is an investment strategy based on predicting future stock prices based on historical price trends. This strategy posits that the price trends of stocks have inertia, meaning that rising or falling trends persist for a period of time. Based on this idea, the price momentum strategy selects stocks that have performed well over a past period and buys them, while selling stocks that have performed poorly. This strategy can determine buy and sell timing through technical analysis tools such as Relative Strength Index (RSI) and Moving Averages (MA). The advantages of price momentum strategy are its simplicity and flexibility, while its disadvantages include the need for a deep understanding and analysis of the market, along with issues such as overfitting and stock selection risks. Price momentum strategy is widely applied in practice, especially suitable when the stock market is volatile or difficult to determine trends.

Crowding refers to the concentration level of investors towards a particular asset or investment strategy. When a large number of investors flock to the same stock, investment strategy, or asset class, it leads to an increase in the crowding of that asset or strategy. Increased crowding may cause market mispricing, as investors are often driven by emotions rather than rational analysis when chasing or selling. Additionally, high crowding may lead to increased liquidity risk and operational risk, as when investors want to exit en masse, the market may not have enough buyers to take over these investors’ positions, leading to price declines. For investors, understanding crowding can help them better manage risks and avoid blindly following the crowd.

XGBoost (eXtreme Gradient Boosting) is a commonly used ensemble learning model based on gradient boosting trees. XGBoost has wide applications in data mining, machine learning, and statistical modeling. XGBoost constructs a strong classifier by serially training and weighting weak classifiers (decision trees) to gradually reduce errors. Specifically, it adopts a gradient boosting framework, optimizing the loss function to train each tree while using regularization methods to avoid overfitting. The advantages of the algorithm include:
-
Good robustness, capable of handling various types of data, including categorical and continuous variables.
-
Can process in parallel, with low memory consumption, exhibiting high efficiency.
-
Excellent performance in feature selection and handling missing values.
-
Automatically handles nonlinear relationships and feature interactions.
XGBoost is a powerful machine learning model that can be used for regression and classification problems, demonstrating excellent performance in practical applications across multiple fields.
3. Article Work
3.1 Momentum Timing Dynamic ETF Allocation Strategy (PMI Strategy)

The Momentum Timing Dynamic ETF Allocation Strategy (PMI Strategy) is a three-step approach based on a “sector-individual” top-down method for selecting ETFs.
First, calculate the scores of each sector based on the sector PMI (Purchasing Managers’ Index) and crowding, and select the top 5 sectors ranked by PMI and the top 5 sectors ranked by crowding score (historical percentile) as the buying sectors.
Second, from the selected sectors, choose the ETF with the lowest PMI and the lowest crowding score as the investment target. If there are more than one ETF that meet the criteria, select the ETF with the highest trading volume to reduce transaction costs.
Finally, calculate the weights of each ETF based on the historical percentiles of ETF shares. The higher the historical percentile of fund shares, the lower the weight. This method helps investors scientifically select ETFs and determine the weights of each ETF in the portfolio, reducing investment risks and improving investment returns.


The annualized return of the PMI strategy is 27.42%, with an annualized volatility of 21.26%, a Sharpe ratio of 1.25, and a Calmar ratio of 1.65. In contrast, the performance of the CSI 300 ETF allocation strategy is much poorer, with an annualized return of only 1.13%, an annualized volatility of 19.56%, a Sharpe ratio of 0.16, and a Calmar ratio of 0.31. The 60/40 allocation strategy also underperforms the PMI allocation strategy, with an annualized return of 1.88%, an annualized volatility of 11.71%, a Sharpe ratio of 0.22, and a Calmar ratio of 0.08. Therefore, constructing an ETF investment portfolio based on momentum and crowding can achieve relatively stable returns and demonstrate good returns in long-term investments.
3.2 Improving Trading Strategies Using XGBoost Algorithm
The PMI strategy uses a simple price momentum quantitative method (such as MA moving averages), which can easily lead to lags and misjudgments and is insensitive to complex market environments and multiple factors’ influences. Therefore, a multi-dimensional optimization upgrade of momentum assessment is needed to improve the strategy’s ability to judge the market and investment returns.
Strategy Improvement
The XGBoost algorithm includes six steps: clarifying the problem, data selection, feature engineering, model training, model evaluation, and decision-making:
1) Clarifying the Problem: Predicting the probability of ETF price increase. For stock ETFs: if the average return over the last 5 days is greater than 0.3% and today’s return is greater than zero, it is considered an increase, marked as 1; otherwise, it is marked as 0. For bond ETFs: if the average return over the last 5 days is greater than zero and today’s return is greater than zero, it is marked as 1; otherwise, it is marked as 0.
2) Data Selection: The sample includes margin-financed stock ETFs and bond ETFs, with a sample period from 2016.01.01 to 2023.04.16.
3) Feature Engineering: Select feature variables that have the ability to predict the probability of ETF price increase. Feature variables include moving averages for 5, 10, 20, 30, 40, 50, 60, and 75 days, as well as the cumulative return over the last 10 days (roc) and the cumulative growth of closing prices over the last 10 days (mom). According to the feature importance ranking of XGBoost, the closing price has the greatest impact on the probability of ETF price increase, while the 30-day moving average MA60 has the least impact.
4) Model Training: The dataset is divided into training and testing sets. The training sample period for this report is from 2016.01.01 to 2019.12.31. Model training requires pre-setting parameters, i.e., hyperparameters, which can be optimized using grid search algorithms, random grid search, and manual tuning methods. In automated search methods, the existing problem is the excessive computational load, and the optimization process is lengthy. This report chooses random grid search.
5) Model Evaluation: The purpose of machine learning is to fit to a “good” model, i.e., a model with good predictive ability, thus requiring evaluation of model effectiveness. Evaluation metrics include accuracy, precision, recall, and F1 score. According to the model confusion matrix, the accuracy, precision, recall, and F1 score are 0.64, 0.85, 0.64, and 0.73, respectively.
6) Decision-Making: Output the probability of ETF price increase for the testing set, serving as a substitute variable for PMI.
Strategy Backtesting


In the improved strategy, we use the ETF price increase probability predicted by XGBoost as a substitute for the PMI indicator, no longer directly inputting the original moving average data into the model. The training period is from 2016 to 2019, and the backtesting data since 2020 is used as the testing set for the model. The annualized return of the strategy increases to 33.99%, with an annualized volatility of 23.34%. The Sharpe ratio and Calmar ratio are 1.37 and 1.57, respectively, outperforming the original strategy. However, the strategy’s effectiveness has declined in recent years, and using a rolling optimization approach would yield better results. Therefore, it is essential to pay attention to adjusting parameters and strategy cycles in practice to ensure the stability and return level of the investment portfolio.
4. Summary and Outlook
The ETF industry market rotation strategy based on momentum and crowding timing can effectively avoid the impending “Minsky” moment at the end of momentum while capturing momentum returns and reducing losses caused by price declines. By first selecting industries and then selecting ETFs, the “top-down” approach to constructing ETF allocation strategies can achieve robust returns. However, since the price momentum PMI construction method relies on empirical rules, it may have certain subjectivity and uncertainty. Therefore, we have improved the ETF allocation strategy using machine learning methods, which has higher return performance and can better adapt to market changes and risk management needs. In practice, investors need to combine their risk tolerance and investment objectives to formulate ETF allocation strategies using scientific methods to enhance the robustness and return level of their investment portfolios.
Note | This article is for knowledge sharing only and does not constitute any investment advice.
Recommended Reading
1. 100 Cool Operations with Pandas
2. Pandas Data Cleaning
3. Original Series on Machine Learning