Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
Simple Moving Average crossover ETF strategy QQQ & TLT

Hey guys,
I'm exploring a simple ETF algorithm that only rebalances on a monthly basis. It buys Nasdaq & Long T-bill ETF's.
In light of rising rates, it could the that the long-running bond bull market might come to an end. I figured it would be good to scan for the best performing (over last 3 months?) bond each and include this ETF for the coming month. (i.e. include short term t-bonds & corporate junk bonds)
Does anyone have a suggestion how to include a sorting function for different assets? I've looked around but I'm struggling a bit.
All help is very appreciated!