宽客秀

宽客秀

Quant.Show的Web3站点,Archives from quant.show

Attempt at ETF portfolio strategy

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:

411948267a96442df5b4b89839a20717 1

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

411948267a96442df5b4b89839a20717 2


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

0a4eb9c3e37eb8ed7db43c8b31753205

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)

Returns for Long Positions with Different Objective Functions

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)

f051744115f6a43c1edbdecbce97c866 1

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)

c21b18359def0f4b0fdf77c3fb58fec3 1

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)")

f2a81275287187583658bed0f24dd440 2

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)

723e42b98621b7a1eb693da74f62cbc7

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)

ce498f48cf8cc3e13f462ad04ed95bf6

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)

f31ed96404b86bdb916f452346de5b96

Source: JoinQuant, calculated by the author

From the above results, we can observe the following:

  1. 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.
  2. 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.
  3. 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.
  4. 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.
  5. The equal weights portfolio is relatively moderate, not the best or the worst.
  6. 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

3f225cd19b9e487c31e68957f000f6e9

Source: JoinQuant, calculated by the author

Table 5: Backtest Results for Single Positions with Different Objective Functions

2da73e08e0e78106a16d0faec8efa18d

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)

78b7323a1186554499ce5c7e3773f3fa

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)

11153f5fc33d4df8a198b112a84e4e2b

Source: JoinQuant, calculated by the author

From the above backtest results, we can observe the following:

  1. In a bear market, the portfolio with minimum portfolio risk effectively avoids risks, with the smallest maximum drawdown and the highest returns.
  2. 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.
  3. In a bear market, the performance of the portfolio with maximum Sharpe ratio is also unsatisfactory.
  4. 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

514b31266d049d3925139e5b824b8e1a

Source: JoinQuant, calculated by the author

Table 7: Backtest Results for Single Positions with Different Objective Functions

0d23585cf14a3398af68aa019768266b

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)

0bff4b11bb5cbe5de1f83bb215cd8711

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)

f23b9a662f3d8dce4d7c7668d03f85fd

Source: JoinQuant, calculated by the author

From the above backtest results, we can observe the following:

  1. In a bull market, the portfolio with maximum portfolio return has the highest returns and the largest maximum drawdown.
  2. In a bull market, the equal weights portfolio and the risk parity portfolio perform relatively well, barely outperforming the benchmark return.
  3. In a bull market, the performance of the portfolio with maximum Sharpe ratio is average.
  4. In a bull market, the portfolio with minimum portfolio risk is the worst strategy.
Loading...
Ownership of this post data is guaranteed by blockchain and smart contracts to the creator alone.