Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
Shorting Leveraged ETFs pair with re-balancing threshold

I am trying to build a strategy which would go short on 3x leveraged ETFs and rebalance it based on a threshold.

Can someone point me to an algo that would do re-balancing of short positions?

The strategy is based on this paper http://papers.ssrn.com/sol3/papers.cfm?abstract_id=2211387

7 responses

This should be pretty easy if you use order_target_percent(sid1, -0.5) and do that inside a scheduled function. If you need a threshold, you could run code in handle_data and then test your threshold, only rebalancing if necessary.

Let me code that up, I am curious.

There you go.

Thank you. I used this algo as an example https://www.quantopian.com/posts/is-this-a-good-rebalance-algorithm-or-does-it-need-work
Now i just need to add target rebalancing threshold.

You can check out my backtest here https://www.quantopian.com/posts/shorting-3x-etfs-with-regular-rebalancing
For now it does rebalancing based on time interval, i will correct it to add the target % threshold rebalancing.

here is my followup algo on shorting two LETF pairs DGAZ/UGAZ and DWTI/UWTI. The algo has bullish bias for nat gaz and bearish bias for WTI, profiting from contango effect.

About 90 cents per dollar spent, not bad. Can be run for just the first couple of months if you want to work on the 2x+ leverage since the max happens early.

thanks for you feedback Garyha. I will work on improving the leverage management. The algo starts with 2X leverage and leverage drops to 0.5 by the end of backtest period. I also attached the tear-sheet. Also , i am wondering how to perform parameters' optimization in the research environment? I want to test possible allocation combinations...