QuantConnect implementation of the Adaptive Asset Allocation strategy presented by Ilya Kipnis in this post


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


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


  • 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 this implementation we’re 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 or stay in cash otherwise.


Immediate Execution with Market Orders


Null Risk Management Model

Research Notebook

  • 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).