OPEN-SOURCE SCRIPT
Diupdate US Market Timing

Disclaimer: Results are hypothetical and do not take into account taxes and fees. This is for informational purposes only and is not financial advice. People can and do lose money investing and trading. Invest responsibly.
US Market Timing strategy designed for long-only position trading. It focuses on multi-month trends rather than day trading, specifically optimized for major US indices like the Nasdaq-100 (QQQ) and S&P 500 (SPY).
Here is a breakdown of how the strategy operates:
Core Strategy Logic
The system uses a "dual-index confirmation" approach. It looks at the S&P 500 (SPX) for the broad market regime and the Nasdaq-100 (QQQ) for specific execution signals.
Entry Conditions (The "Buy" Signal)
To enter a trade, four specific conditions must be met simultaneously:
Exit Conditions (The "Sell" Signal)
The strategy uses two distinct methods to get out of a trade:
Key Technical Components
Performance Notes
Best Results: QQQ, MDY, IWM, SPY and their leveraged counterparts (QLD, SSO).
Drawdown: Historically, it has significantly outperformed "Buy and Hold" in terms of risk-adjusted returns, often cutting the Max Drawdown of the Nasdaq in half (e.g., QQQ ~28% drawdown vs. much higher during the dot-com era).
Timeframe: Designed for daily charts with trades lasting several months.
US Market Timing strategy designed for long-only position trading. It focuses on multi-month trends rather than day trading, specifically optimized for major US indices like the Nasdaq-100 (QQQ) and S&P 500 (SPY).
Here is a breakdown of how the strategy operates:
Core Strategy Logic
The system uses a "dual-index confirmation" approach. It looks at the S&P 500 (SPX) for the broad market regime and the Nasdaq-100 (QQQ) for specific execution signals.
Entry Conditions (The "Buy" Signal)
To enter a trade, four specific conditions must be met simultaneously:
- Broad Market Strength: The SPX daily low must stay above its 21-day EMA for 4 consecutive days.
- Growth Confirmation: The QQQ daily low must be above both its 14-day and 21-day EMAs.
- Momentum Check: The current QQQ close must not be weaker than the previous three days (preventing buying into a dip that's turning into a slide).
- Trend Intensity: The SPX ADX (Average Directional Index) must be above 16, ensuring the market is actually trending and not just chopping sideways.
Exit Conditions (The "Sell" Signal)
The strategy uses two distinct methods to get out of a trade:
- The Trend-Based Exit (Loose Stop): This triggers if the SPX 7-day SMA crosses below the 107-day SMA while the QQQ is showing price weakness (closing below its 21-day EMA). This is designed to capture the bulk of a major bull run.
- The Safety Exit (Tight Stop): A hard stop is set at 3.5% below the entry price. However, it only triggers if the QQQ is also trading below its 50-day SMA, acting as a double-confirmation to avoid being "shaken out" by minor volatility.
Key Technical Components
- 21-day EMA - Used as the primary "floor" for price action.
- ADX (13-period) - Filters out "flat" markets; requires a value > 16 to trade.
- 7/107 SMA Cross - Determines the long-term trend shift for exits.
- QQQ/SPX Correlation - Uses SPX for the macro trend and QQQ for the micro timing.
Performance Notes
Best Results: QQQ, MDY, IWM, SPY and their leveraged counterparts (QLD, SSO).
Drawdown: Historically, it has significantly outperformed "Buy and Hold" in terms of risk-adjusted returns, often cutting the Max Drawdown of the Nasdaq in half (e.g., QQQ ~28% drawdown vs. much higher during the dot-com era).
Timeframe: Designed for daily charts with trades lasting several months.
Catatan Rilis
Disclaimer: This is not financial advice. All results are hypothetical and do not account for taxes and fees."US Market Timing" strategy designed for long-only position trading. It focuses on multi-month trends rather than day trading, specifically optimized for major US indices like the Nasdaq-100 (QQQ) and S&P 500 (SPY).
Here is a breakdown of how the strategy operates:
## Core Strategy Logic
The system uses a "dual-index confirmation" approach. It looks at the S&P 500 (SPX) for the broad market regime and the Nasdaq-100 (QQQ) for specific execution signals.
Entry Conditions (The "Buy" Signal)
To enter a trade, four specific conditions must be met simultaneously:
Broad Market Strength: The SPX daily low must stay above its 21-day EMA for 4 consecutive days.
Growth Confirmation: The QQQ daily low must be above both its 14-day and 21-day EMAs.
Momentum Check: The current QQQ close must not be weaker than the previous three days (preventing buying into a dip that's turning into a slide).
Trend Intensity: The SPX ADX (Average Directional Index) must be above 16, ensuring the market is actually trending and not just chopping sideways.
Exit Conditions (The "Sell" Signal)
The strategy uses two distinct methods to get out of a trade:
The Trend-Based Exit (Loose Stop): This triggers if the SPX 7-day SMA crosses below the 107-day SMA while the QQQ is showing price weakness (closing below its 21-day EMA). This is designed to capture the bulk of a major bull run.
The Safety Exit (Tight Stop): A hard stop is set at 3.5% below the entry price. However, it only triggers if the QQQ is also trading below its 50-day SMA, acting as a double-confirmation to avoid being "shaken out" by minor volatility.
## Key Technical Components
21-day EMA Used as the primary "floor" for price action.
ADX (13-period) Filters out "flat" markets; requires a value > 16 to trade.
7/107 SMA Cross Determines the long-term trend shift for exits.
QQQ/SPX Correlation Uses SPX for the macro trend and QQQ for the micro timing.
## Performance Notes
The author notes that while the strategy was tested on various assets, it is highly optimized for US Indexes.
Best Results: QQQ, MDY, IWM, SPY, and their leveraged counterparts (QLD, SSO).
Drawdown: Historically, it has significantly outperformed "Buy and Hold" in terms of risk-adjusted returns, often cutting the Max Drawdown of the Nasdaq in half (e.g., QQQ ~28% drawdown vs. much higher during the dot-com era).
Timeframe: Designed for daily charts with trades lasting several months.
Skrip open-source
Dengan semangat TradingView yang sesungguhnya, pembuat skrip ini telah menjadikannya sebagai sumber terbuka, sehingga para trader dapat meninjau dan memverifikasi fungsinya. Salut untuk penulisnya! Meskipun Anda dapat menggunakannya secara gratis, perlu diingat bahwa penerbitan ulang kode ini tunduk pada Tata Tertib kami.
Pernyataan Penyangkalan
Informasi dan publikasi ini tidak dimaksudkan, dan bukan merupakan, saran atau rekomendasi keuangan, investasi, trading, atau jenis lainnya yang diberikan atau didukung oleh TradingView. Baca selengkapnya di Ketentuan Penggunaan.
Skrip open-source
Dengan semangat TradingView yang sesungguhnya, pembuat skrip ini telah menjadikannya sebagai sumber terbuka, sehingga para trader dapat meninjau dan memverifikasi fungsinya. Salut untuk penulisnya! Meskipun Anda dapat menggunakannya secara gratis, perlu diingat bahwa penerbitan ulang kode ini tunduk pada Tata Tertib kami.
Pernyataan Penyangkalan
Informasi dan publikasi ini tidak dimaksudkan, dan bukan merupakan, saran atau rekomendasi keuangan, investasi, trading, atau jenis lainnya yang diberikan atau didukung oleh TradingView. Baca selengkapnya di Ketentuan Penggunaan.