Yes, when SPY's closing price is less than the 200 Simple Moving Average sell all Leveraged ETFs (if long) and go to cash. The code I put went to plain cash when SPY<200SMA down in the "Else:" line.
You could go to SHY, IEF, TLT or AGG, or any combination of those to move into risk off positioning for example. The point is to have a bull/bear market timer to get you to a risk off position to preserve capital. Once the market changes, you can back to a full risk on position. This is where the 3x leverage will give you good alpha over time.
As for the market timer logic it doesn't have to be SPY<200SMA. There are lots of ways to determine a bull/bear cycle. If the 6 month percent return is less than 0%, the number of down days over the last few months is greater than the up days, etc. Look for some white papers that include market timer logic for more examples.
I'm a trader tying to learn to code, so I hacked this together, I'm not 100% certain this code is error free ;)
The 2 week rebalance is not as critical in Taylor's version, instead it keeps the allocation consistent. But when there is a market timer involved the rebalancing schedule becomes critical. If you were to only rebalance every Jan. 1, then you will get out of bear markets too late and get in bull markets too late, so you may not achieve any alpha. Daily rebalancing is too often in this case. However when you switch to weekly, bi-weekly, or even monthly, then you get in that sweet spot to get out of a bear market in time and get in a bull market early enough to capture those gains.