Momentum Based ETF Portfolio Rebalancing Optimizing Portfolio Construction For Optimal Sharpe Ratio www.quantconnect.com Jared Broad CEO and Founder
Momentum Based ETF Portfolio RebalancingOptimizing Portfolio Construction For Optimal Sharpe Ratio
www.quantconnect.com
Jared Broad
CEO and Founder
We’ve built a web algorithm lab where thousands of
people test their ideas on financial data we provide; for free.
LEAN ALGO
TECHNOLOGY
FINANCIAL
DATA
POWER
COMPUTING
What is QuantConnect?
EQUITIES
OPTIONS
FUTURES
FOREX
CRYPTO
April-2018 QuantConnect – Momentum Based ETF Portfolio Rebalancing Page 2
Outline
▪ Basics of Mean Variance Portfolio Construction
▪ Defining Optimization Function
▪ LEAN Algorithm Framework
▪ Implementing Our Model
▪ Testing and Researching
▪ Summary
April-2018 QuantConnect – Momentum Based ETF Portfolio Rebalancing Page 3
Reduce volatility, increase returns by
calculating optimal weight allocation of a
portfolio for minimum volatility.
Core Idea:
1) Create an estimate of returns and volatility.
2) Build portfolio of assets; allocating to each by weight.
3) Optimize weights to minimize the volatility in portfolio.
Classic Mean Variance Portfolio Construction
April-2018 QuantConnect – Momentum Based ETF Portfolio Rebalancing Page 4
Classic Mean Variance Portfolio Construction
April-2018 QuantConnect – Momentum Based ETF Portfolio Rebalancing Page 5
$-
$5.00
$10.00
$15.00
$20.00
$25.00
$30.00
$35.00
$40.00
Jan-18 Feb-18 Mar-18 Apr-18 May-18 Jun-18 Jul-18 Aug-18 Sep-18 Oct-18
Stock A Stock B
Ideal = 50-50
Classic Mean Variance Portfolio Construction
April-2018 QuantConnect – Momentum Based ETF Portfolio Rebalancing Page 6
$-
$2.00
$4.00
$6.00
$8.00
$10.00
$12.00
Jan-18 Feb-18 Mar-18 Apr-18 May-18 Jun-18 Jul-18 Aug-18 Sep-18 Oct-18
Stock A Stock B Stock C
Stock D Stock E Stock F
Stock G Stock H
Most real world applications have portfolios of many assets. We are seeking to find best balance of hundreds of assets.
Mean Variance Optimization Function
April-2018 QuantConnect – Momentum Based ETF Portfolio Rebalancing Page 7
Optimizers experiment with portfolios; seeking to
minimize the objective function.
Classic Mean Variance Optimization the objective
function seeks to minimize expected volatility.
Redefining Our Objective
April-2018 QuantConnect – Momentum Based ETF Portfolio Rebalancing Page 8
We will seek to optimize Sharpe Ratio instead of volatility; seeking to
minimize objective function:
𝑥 = min(𝐴𝑛𝑛𝑢𝑎𝑙 𝑃𝑜𝑟𝑡𝑓𝑜𝑙𝑖𝑜 𝑅𝑒𝑡𝑢𝑟𝑛
𝑉𝑎𝑟)
This approximates the traditional Sharpe Ratio function and serves as
our weighting target.
Algorithm Framework Modules
April-2018 QuantConnect – Momentum Based ETF Portfolio Rebalancing Page 9
Assumptions and Limitations
❖ Mean Variance Optimization requires expected returns and we provide historical
values. We’re making an assumption these returns will continue in the future.
❖ Most variance approximations assume a normal distribution.
❖ Any estimation error in the return prediction magnified.
❖ The resulting portfolios can be concentrated and nonsensical. In practice its more
common to use Black-Litterman method.
April-2018 QuantConnect – Momentum Based ETF Portfolio Rebalancing Page 10
Code and Implementation
April-2018 QuantConnect – Momentum Based ETF Portfolio Rebalancing Page 11
Backtest
Summary
❖ Using portfolio construction techniques we can automatically assign weights
to our portfolio assets.
❖ This reduces the number of variables we manually define; can improve returns
and lower volatility.
Next Steps – Investigate more robust portfolio construction techniques!
(E.g. Black-Litterman).
Total Trades Drawdown Net Profit Sharpe Ratio
270 12.9% 34% 0.555
April-2018 QuantConnect – Momentum Based ETF Portfolio Rebalancing Page 12
www.quantconnect.com Thank you.
Appendix
Our Research Environment
April-2018 QuantConnect – Momentum Based ETF Portfolio Rebalancing Page 15
Coding the Idea, The Algorithm Lab
April-2018 QuantConnect – Momentum Based ETF Portfolio Rebalancing Page 16
Going Live, Deploying to Live Trading
April-2018 QuantConnect – Momentum Based ETF Portfolio Rebalancing Page 17