Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
The Logical Invest Enhanced Bond Rotation Strategy

I took a bond rotation strategy from Ilya Kipnis at QuantStrat TradeR. He coded the strategy in R, and I simply translated it into Python. I've since played around with the strategy a lot by tweaking various parameters. What's attached here is the original strategy. Unfortunately, I don't think it's a good strategy for a few reasons. Here are two main ones:

  • If you change the reallocation scheduled function from month start to month end, the strategy does significantly worse (returns from ~100% to ~60% in the same time period.
  • If you change / add bond ETFs, the strategy again does much worse. This suggests that the original creator (not Ilya) overfit to securities that work well.

Any thoughts?

4 responses

If the equity curve is too good to be true, it's probably an overfit.

The original strategy relies on the 4 assets (bonds in this case) being relatively uncorrelated. Which bonds do you replace with, and do they have the same correlations and volatility as the original ones?

It's very sensitive to the Lookback parameter - changing it to either 60 or 120 degrades performance, suggesting curve-fitting.
- Are there utilities in Quantopian to test robustness of parameters? For example, sensitivity analysis of performance to the parameters ..
- Also, not sure if Quantopian has Optimization features (exhaustive or genetic)..

thx
Kiran

Are there utilities in Quantopian to test robustness of parameters? For example, sensitivity analysis of performance to the parameters...

Kinda, sorta. You can vary the parameters yourself manually and then pull the backtest results into the research platform, using get_backtest(). Note that you can run as many backtests in parallel as you want, so this might be a viable approach. There is the so-called pyfolio tool, but I don't think it'll handle multiple backtests and perform sensitivity analysis across parameters.

Also, not sure if Quantopian has Optimization features (exhaustive or genetic)...

Not anything built-in. However, if you port your backtest over to the research platform, then I think you could try such a thing (although I fear it would get mighty bogged down, since you'll only be able to run one backtest at a time).