Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
Simple Factor Timing Using Sharpe Ratio

Hi All,

I wanted to share a very simple factor timing system using the Sharpe Ratio as a decision for rebalancing weights. I took the idea from the following source:

http://www.rotationinvest.com/blog/etf-rotation-strategy-using-sharpe-ratio

In the algorithm, we essentially start out with an equal-weighted portfolio of SPY, GLD, EFA, and TMF. We rebalance every period (defined in initialize) and allocate x amount to the top-performing ETF (defined in initialize) and then split the rest amongst the other constituents.

Any feedback is welcome!

Cheers.

3 responses

UPDATED:

I realized I wasn't doing the sharpe ratios for the risk free security correctly. This backtest reflects the ability to allocate to the risk free security if all Sharpe Ratios are below 0.

Hi Sam,

this algorithm is interesting,about you are not fixing the sharpe ratios for the risk free security,
the issue could improvement? seems it occur between 2012 to 2014.

Yeah I'm looking at the logs and it looks like the sharpe ratio for GLD is outperforming the other constituents in the drawdown period (Jan 2013 - Jul 2013) even though the security is falling.

The risk free rate's sharpe ratio will always be zero. I forgot to correct it from NaN so it never used it in the portfolio.