Hi All,

I'm sharing my implementation of this interesting strategy on "Defensive Adaptive Asset Allocation" by Ilya Kipnis, which you can find explained in this link https://quantstrattrader.wordpress.com/2019/01/24/right-now-its-kda-asset-allocation/

The link above offers a more detailed explanation of the logic and its origin, but in QC lingo it can be summarised as follows:

  • UNIVERSE: The universe consists of ETFs from different asset classes: SPY (US equities), VGK (European equities),  EWJ  (Japanese equities), EEM (Emerging market equities), VNQ (US REITs), RWX (International REITs), TLT (US 30-year Treasuries), IEF (US 10-year Treasuries), DBC (Commodities) and GLD (Gold).
  • ALPHA: Every N days, we compute the 1-3-6-12 momentum filter for the whole Universe (i.e. the sum of 12 * 1-month momentum, 4 * 3-month momentum, 2 * 6-month momentum and 12-month momentum) and rank them. The final selection is based on Dual Momentum: a combination of Positive Absolute Momentum (momentum score above 0) and Relative Momentum (keeping the Top N assets in the ranking). In the original strategy, the proposed rebalancing period is monthly. However, this type of strategies are very sensitive to timing (when you launch the strategy) and rebalancing at the end or start of each month can have a huge impact on results. In my implementation, I'm proposing using a parameter daysToRecalculate = 21 to select the number of trading days to perform the momentum calculations and rebalancing regardless of when the strategy is deployed, thus reducing the timing biais.
  • PORTFOLIO: This is where things get more interesting:
    • We apply portfolio optimization to the top assets in a particular way. We compute the covariance matrix using one-month volatility estimates, and a correlation matrix that is the weighted average of the same parameters used for the momentum filter (12 * 1-month correlation + 4 * 3-month correlation + 2 * 6-month correlation + 12-month correlation, all divided by 19). In the original strategy, the proposed optimization is Minimum Variance. However, in my implementation I am adding the possibility to choose between: Minimize Portfolio Variance, Maximize Portfolio Return and Maximize Portfolio Sharpe Ratio.
    • This strategy also uses two Canary Assets: VWO (Vanguard FTSE Emerging Markets ETF) and BND (Vanguard Total Bond Market ETF), to determine the level of exposure to "risky assets". We compute the 1-3-6-12 momentum for the Canary Assets and our exposure to "risky assets" will be:
      • 100% if both have Positive Absolute Momentum.
      • 50% if only one has Positive Absolute Momentum.
      • 0% if none has Positive Absolute Momentum.
      • The remaining % from the above calculation will go to IEF if this asset also has Positive Absolute Momentum. Otherwise, we stay in cash.
  • EXECUTION: Immediate execution with Market Orders.
  • RISK: No extra risk management.

In order to illustrate a few interesting things about the algorithm, I also wrote a Research file. In the research.ipynb file you can find:

  • A step by step walk-through of the Momentum Score calculation.
  • A step by step walk-through on how to calculate the Covariance Matrix using a custom correlation matrix (like the one in our algorithm, computed as a weighted average of multiple period correlations).

Enjoy!

Emilio

InnoQuantivity.com