Recently, due to the uncertainty in US-China relations, I had to start thinking about using investment diversity to hedge risks. I tried to create an ETF portfolio strategy and conducted some validation on JoinQuant (Python2 version).
1. Portfolios and Trading Strategies#
I selected two main portfolios. Portfolio 1 consists mainly of large-scale ETFs, supplemented by government bond ETFs and gold ETFs. Portfolio 2 focuses on industry and thematic ETFs. The specific compositions are as follows:
The trading strategies were backtested separately for long positions (Portfolio 1 corresponds to 1 sub-portfolio, Portfolio 2 corresponds to one sub-portfolio) and single positions (Portfolio 1 and Portfolio 2 in one holding), as shown in Table 1. The benchmark return for the backtest is the CSI 300.
Table 1: Trading Strategies
2. Portfolio Weights#
When rebalancing, the weights are recombined and positions are allocated according to the following different objective functions:
- Equal weights
- Risk parity
- Minimum portfolio risk
- Maximum Sharpe ratio (risk-free interest rate = 0.00)
- Maximum portfolio return
Unless otherwise specified, the constraint function used is "Total portfolio weight = 100%".
3. Backtest Period: January 1, 2017 - August 10, 2020#
The backtest period is from January 1, 2017 to August 10, 2020, a period of more than 3.5 years. By using 2 different position strategies * 5 different portfolio weight methods, we can obtain 10 backtest results, as shown in Table 2, Figure 1, Figure 2, Figure 3, Table 3, Figure 4, Figure 5, and Figure 6:
Table 2: Backtest Results for Long Positions with Different Objective Functions
Source: JoinQuant, calculated by the author
Figure 1: Returns for Long Positions with Different Objective Functions (0: Equal weights, 1: Risk parity, 2: Minimum portfolio risk, 3: Maximum Sharpe ratio, 4: Maximum portfolio return)
Source: JoinQuant, calculated by the author
Figure 2: Returns, Maximum Drawdown, Sharpe Ratio, and Volatility for Long Positions with Different Objective Functions (0: Equal weights, 1: Risk parity, 2: Minimum portfolio risk, 3: Maximum Sharpe ratio, 4: Maximum portfolio return)
Source: JoinQuant, calculated by the author
Figure 3: Annualized Returns and Maximum Drawdown for Long Positions (0: Equal weights, 1: Risk parity, 2: Minimum portfolio risk, 3: Maximum Sharpe ratio, 4: Maximum portfolio return)
Source: JoinQuant, calculated by the author
Table 3: Backtest Results for Single Positions with Different Objective Functions (In the case of maximum Sharpe ratio, the constraint function used is "Total portfolio weight = (0, 1)")
Source: JoinQuant, calculated by the author
Figure 4: Returns for Single Positions with Different Objective Functions (0: Equal weights, 1: Risk parity, 2: Minimum portfolio risk, 3: Maximum Sharpe ratio, 4: Maximum portfolio return)
Source: JoinQuant, calculated by the author
Figure 5: Returns, Maximum Drawdown, Sharpe Ratio, and Volatility for Single Positions with Different Objective Functions (0: Equal weights, 1: Risk parity, 2: Minimum portfolio risk, 3: Maximum Sharpe ratio, 4: Maximum portfolio return)
Source: JoinQuant, calculated by the author
Figure 6: Annualized Returns and Maximum Drawdown for Single Positions (0: Equal weights, 1: Risk parity, 2: Minimum portfolio risk, 3: Maximum Sharpe ratio, 4: Maximum portfolio return)
Source: JoinQuant, calculated by the author
From the above results, we can observe the following:
- In terms of returns, the portfolio with maximum Sharpe ratio performs the best, with single positions outperforming long positions. The risk parity portfolio for single positions comes next.
- In terms of maximum drawdown, the portfolio with minimum portfolio risk has the smallest drawdown, with long positions having a smaller drawdown than single positions, effectively diversifying risks. In addition, the risk parity portfolio for long positions also has a smaller drawdown.
- In terms of Sharpe ratio, the portfolio with maximum Sharpe ratio is relatively higher, with the ranking as follows: maximum Sharpe ratio for single positions > risk parity for single positions > maximum Sharpe ratio for long positions. The Sharpe ratio for the portfolio with minimum portfolio risk is the lowest.
- The risk parity portfolio performs well in terms of returns, ranking third, with a smaller maximum drawdown and a higher Sharpe ratio. It is a good portfolio.
- The equal weights portfolio is relatively moderate, not the best or the worst.
- The portfolio with maximum portfolio return shows a significant difference in performance between single positions and long positions.
4. Backtest Period: January 1, 2018 - December 31, 2018#
2018 was a bear market year, with the Shanghai Composite Index falling from over 3300 to below 2500. Using the same strategy for backtesting, the following results were obtained, as shown in Table 4, Table 5, Figure 7, and Figure 8:
Table 4: Backtest Results for Long Positions with Different Objective Functions
Source: JoinQuant, calculated by the author
Table 5: Backtest Results for Single Positions with Different Objective Functions
Source: JoinQuant, calculated by the author
Figure 7: Returns, Maximum Drawdown, Sharpe Ratio, and Volatility for Long Positions with Different Objective Functions (0: Equal weights, 1: Risk parity, 2: Minimum portfolio risk, 3: Maximum Sharpe ratio, 4: Maximum portfolio return)
Source: JoinQuant, calculated by the author
Figure 8: Returns, Maximum Drawdown, Sharpe Ratio, and Volatility for Single Positions with Different Objective Functions (0: Equal weights, 1: Risk parity, 2: Minimum portfolio risk, 3: Maximum Sharpe ratio, 4: Maximum portfolio return)
Source: JoinQuant, calculated by the author
From the above backtest results, we can observe the following:
- In a bear market, the portfolio with minimum portfolio risk effectively avoids risks, with the smallest maximum drawdown and the highest returns.
- In a bear market, the portfolio with maximum portfolio return has the largest maximum drawdown, and its returns are also the worst, making it not a good strategy.
- In a bear market, the performance of the portfolio with maximum Sharpe ratio is also unsatisfactory.
- In a bear market, the risk parity portfolio and the equal weights portfolio have similar performance, relatively moderate.
5. Backtest Period: March 1, 2020 - July 14, 2020#
Although 2020 was affected by the pandemic, after the domestic epidemic was brought under control, a small bull market was created. Taking this period as an example, the following backtest results were obtained, as shown in Table 6, Table 7, Figure 9, and Figure 10:
Table 6: Backtest Results for Long Positions with Different Objective Functions
Source: JoinQuant, calculated by the author
Table 7: Backtest Results for Single Positions with Different Objective Functions
Source: JoinQuant, calculated by the author
Figure 9: Returns, Maximum Drawdown, Sharpe Ratio, and Volatility for Long Positions with Different Objective Functions (0: Equal weights, 1: Risk parity, 2: Minimum portfolio risk, 3: Maximum Sharpe ratio, 4: Maximum portfolio return)
Source: JoinQuant, calculated by the author
Figure 10: Returns, Maximum Drawdown, Sharpe Ratio, and Volatility for Single Positions with Different Objective Functions (0: Equal weights, 1: Risk parity, 2: Minimum portfolio risk, 3: Maximum Sharpe ratio, 4: Maximum portfolio return)
Source: JoinQuant, calculated by the author
From the above backtest results, we can observe the following:
- In a bull market, the portfolio with maximum portfolio return has the highest returns and the largest maximum drawdown.
- In a bull market, the equal weights portfolio and the risk parity portfolio perform relatively well, barely outperforming the benchmark return.
- In a bull market, the performance of the portfolio with maximum Sharpe ratio is average.
- In a bull market, the portfolio with minimum portfolio risk is the worst strategy.