Back to Community
Critical Line Algorithm for Portfolio Optimization

The critical line algorithm (CLA) is a portfolio optimization routine developed by Harry Markowitz. I stumbled on an open sourced version of the routine that happened to be done in Python, so I got it working in Quantopian.

This paper gives a pretty thorough step-by-step explanation of the algorithm. This version uses the weights that maximize the sharpe ratio, but the algorithm produces several sets of weights along the efficient frontier curve.

David

Clone Algorithm
175
Loading...
Backtest from to with initial capital
Total Returns
--
Alpha
--
Beta
--
Sharpe
--
Sortino
--
Max Drawdown
--
Benchmark Returns
--
Volatility
--
Returns 1 Month 3 Month 6 Month 12 Month
Alpha 1 Month 3 Month 6 Month 12 Month
Beta 1 Month 3 Month 6 Month 12 Month
Sharpe 1 Month 3 Month 6 Month 12 Month
Sortino 1 Month 3 Month 6 Month 12 Month
Volatility 1 Month 3 Month 6 Month 12 Month
Max Drawdown 1 Month 3 Month 6 Month 12 Month
# Backtest ID: 54161bfb4c3fc307e16ea1e9
There was a runtime error.
5 responses

CLA on the sector etf plus TLT

Clone Algorithm
170
Loading...
Backtest from to with initial capital
Total Returns
--
Alpha
--
Beta
--
Sharpe
--
Sortino
--
Max Drawdown
--
Benchmark Returns
--
Volatility
--
Returns 1 Month 3 Month 6 Month 12 Month
Alpha 1 Month 3 Month 6 Month 12 Month
Beta 1 Month 3 Month 6 Month 12 Month
Sharpe 1 Month 3 Month 6 Month 12 Month
Sortino 1 Month 3 Month 6 Month 12 Month
Volatility 1 Month 3 Month 6 Month 12 Month
Max Drawdown 1 Month 3 Month 6 Month 12 Month
# Backtest ID: 55b752a21eab430c6a2eea7c
There was a runtime error.

Looks pretty solid Vladimir, I find that these optimization routines work much better with fewer assets, sector ETFs are usually a go to for me as well.

Look long term.

Clone Algorithm
7
Loading...
Backtest from to with initial capital
Total Returns
--
Alpha
--
Beta
--
Sharpe
--
Sortino
--
Max Drawdown
--
Benchmark Returns
--
Volatility
--
Returns 1 Month 3 Month 6 Month 12 Month
Alpha 1 Month 3 Month 6 Month 12 Month
Beta 1 Month 3 Month 6 Month 12 Month
Sharpe 1 Month 3 Month 6 Month 12 Month
Sortino 1 Month 3 Month 6 Month 12 Month
Volatility 1 Month 3 Month 6 Month 12 Month
Max Drawdown 1 Month 3 Month 6 Month 12 Month
# Backtest ID: 57a79837745fd610051b96b5
There was a runtime error.

backtest result if rebalance weekly, remoe tlt, and disable commission fee.

Clone Algorithm
8
Loading...
Backtest from to with initial capital
Total Returns
--
Alpha
--
Beta
--
Sharpe
--
Sortino
--
Max Drawdown
--
Benchmark Returns
--
Volatility
--
Returns 1 Month 3 Month 6 Month 12 Month
Alpha 1 Month 3 Month 6 Month 12 Month
Beta 1 Month 3 Month 6 Month 12 Month
Sharpe 1 Month 3 Month 6 Month 12 Month
Sortino 1 Month 3 Month 6 Month 12 Month
Volatility 1 Month 3 Month 6 Month 12 Month
Max Drawdown 1 Month 3 Month 6 Month 12 Month
# Backtest ID: 57a7d68506b1441002e155b1
There was a runtime error.

Good strategy, thanks for sharing!

Please refer to paper: https://papers.ssrn.com/sol3/papers.cfm?abstract_id=2606884

In the paper, a target volatility, for example 5% or 10%, which are treated as Offensive or Defensive solutions, were recommended. Question is, how can we target a volatility by CLA api? Or we have to search on Effective Front to find it by ourself?

Best,
David