This portfolio strategy, known as "Regime-Based Tactical Rotation," is a tactical asset allocation model that employs a dynamic, rules-based approach to navigate various market environments. Its primary goal is to aggressively capture gains during market uptrends while attempting to profit from downturns or shift to defensive assets during periods of weakness or volatility.
The strategy operates by analyzing market trends and momentum over different timeframes to select a single, optimal asset for investment at any given time. It exclusively uses leveraged and volatility-related Exchange Traded Funds (ETFs), indicating a high-risk, high-reward profile.
Theory
The strategy's central theory is that financial markets operate in distinct regimes, primarily a bull market (uptrend) and a bear market (downtrend). The algorithm first identifies the prevailing long-term regime and then applies a secondary set of rules to make tactical, short-term decisions based on momentum and mean-reversion principles.
Primary Regime Filter: The 200-day Simple Moving Average (SMA) of TQQQ (ProShares UltraPro QQQ) is the master switch. When the price of TQQQ is above its 200-day SMA, the strategy operates under a "Risk-On" or bull market playbook. When the price is below this average, it switches to a "Risk-Off" or bear market playbook.
Secondary Tactical Indicators: The strategy uses the 10-day Relative Strength Index (RSI) to identify short-term overbought or oversold conditions. RSI values above 80 are considered overbought (signaling a potential pullback), while values below 31 are considered oversold (signaling a potential rebound). A shorter-term, 20-day SMA is also used to detect brief uptrends within a larger downtrend.
Asset Roles and Selection
The strategy utilizes a specific set of ETFs, each chosen for a particular market scenario:

Detailed Breakdown of Trading Logic
The strategy follows a clear decision tree to select the single asset to hold.
Condition 1: Bull Market Regime (Risk-On)
This mode is active when TQQQ's price is above its 200-day SMA.
If the QQQ's 10-day RSI is > 80 (Overbought): The strategy anticipates a short-term drop or spike in volatility.
Action: Sell all other assets and invest 100% in UVXY.
Else (Strong, but not overbought, uptrend): The market trend is strong and likely to continue.
Action: Sell all other assets and invest 100% in TQQQ.
Condition 2: Bear Market Regime (Risk-Off)
This mode is active when TQQQ's price is below its 200-day SMA. The strategy then searches for specific opportunities.
If TQQQ's 10-day RSI is < 31 (Tech is Oversold): This signals a potential mean-reversion opportunity in the tech sector.
Action: Invest 100% in TECL to catch a sharp bounce.
Else, if UPRO's 10-day RSI is < 31 (S&P 500 is Oversold): If tech isn't oversold, it checks the broader market for a similar rebound opportunity.
Action: Invest 100% in UPRO.
Else, if TQQQ's price is > its 20-day SMA (Short-term Rally): This identifies a "bear market bounce" where short-term momentum is positive despite the negative long-term trend.
Action: Invest 100% in TQQQ to ride the brief rally.
Else (Confirmed Downtrend): If none of the above conditions are met, the market is in a confirmed downtrend with no clear buy-the-dip signal. The strategy shifts to a defensive or bearish position.
Action: It compares the 10-day RSI of TLT and SQQQ and invests 100% in the one with the lower RSI (the most oversold). This is either a flight to safety (TLT) or a bet on a continued crash (SQQQ).
Mia Alissi
This algorithm exactly follows the regime-based rotation logic you specified. Only one ETF is ever held. Indicator readiness is checked for safety, and all selections occur at the market open each day.
Sources: E T F Global Rotation Algorithm, Tactical - QuantConnect.com, docs writing algorithms indicators automatic indicators, A Risk Parity Approach to Leveraged ETFs, Momentum And Style Rotation Effect
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.
Dibakar Sigdel
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!