I replicated another tactical ETF strategy in QuantConnect that I think is somewhat interesting. The guys over at AllocateSmartly do a lot of replication on these types of strategies (and do a great job). Rather than rephrase everything in my own words, you are probably better served reading the write up they did on the strategy here. Results are pretty good for what it is. Feedback and thoughts are welcome. Enjoy.
Thanks,
Aaron
DEVON
cool stuff, very interesting. thanks for sharing this to the community.....
LukeI
I find the 2013 period fasinating on a lot of momentum based strategies. Almost always 2013 performs flat or negative when the market itself was rocketing up. I think this has to do with an overreliance on bonds and makes me worried for continued performace in a rising rate market.
Now how do we make a momentum strategy less reliant on bonds?
Just something to think about
Aaron Gilman
LukeI,
I agree with your statement. I think the easy (too easy) answer is to do what others have done with these tactical etf strategies and use SHY or BIL as the risk-free asset to remove any benefit from falling rates or just go to cash instead of the current risk free set. Another interesting point addressed by the guys at Newfound involves timing risk, where they tranche the portfolio into different sets and weight the results to reduce relying on a single day for executing the strategy. I haven't figured out a clean way to do this in QC yet, but will be attempting it this week most likely. At the end of the day, I think this strategy is just a good example and starting point for those new to the platform, and shouldn't be used as the sole basis for a strategy but more-or-less as a building block. Thanks for your comment. Have you done anything in your work that solves the issue or at least mitigates it?
Thanks,
Aaron
Upbias
Thanks for sharing!
Upbias
Hi Aaron,
Inspired by your post... I've just posted the implementation of a tactical ETF strategy I published last month at my blog.
The community post is:
https://www.quantconnect.com/forum/discussion/3189/a-simple-tactical-etf-strategy
Any feedback?
Regards,
Ricardo
Caleb Mock
Aaron,
By using a scheduled "rebalance" function, I can create a True/False boolean value that is used whenever you want the algorithm to fire.
This version has been modifed to use a monthly rebalancing. It takes advantage of the "Turn of the month" effect.
Caleb Mock
I attached the wrong backtest, the first one seleceted the second best safe. Oops.
Caleb Mock
For the fun of it, I set the rebalancing to weekly. Still a good algorithm, but no quite as promising.
I can't figure out how to tranche the portfolio. I believe the ke is to take the current portfolio value and symbols and reallocate them, but it's over my head as a coder.
There are a few artifacts of this code here, so check out the commented blocks.
Renaud Jeannot
Hi guys,
I am a newbie in coding but I still went reading your code : why are you liquidating the asset every month ? Can't we save some money in fees by not liquidating if the asset we are holding has still the best score ?
Thanks for your answer,
Alexandre Catarino
Hi Renaud Jeannot, you are totally right!
We check whether the security is invested before the Liquidate:
if not self.Portfolio[bestSafe[0]].Invested: self.Liquidate() # ... if not self.Portfolio[bestGrowth[0]].Invested: self.Liquidate()
With that improvement, we save $356.55 in fees which is about one third, by reducing the number of orders from 383 to 187.
Aaron Gilman
The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.
To unlock posting to the community forums please complete at least 30% of Boot Camp.
You can continue your Boot Camp training progress from the terminal. We hope to see you in the community soon!