The attached strategy is hardly perfect, but the idea is to test a very aggressive basket of stocks (in this case cybersecurity) for momentum,
and stay in those until their momentum turns negative, then jump into bonds (tlt,eif or uup) if those show positive momentum, and cash if nothing is going up. My thanks to Chris De Palma for the original elegant code.
If you look at the log files, you will see the thing goes short huge amounts of various securities. This should not happen, as I never have an
order to go short. When I want to exit a position, I am using order_target_percentage(targetSecurity,0) , which gets called once a week. So even if this were to be unnecessarily repeated it should not go short, right?