PROTECTED SOURCE SCRIPT
indicator("Rotation Oscillator (Sectors / Metals / Crypto) + USD

This indicator builds a rotation/relative-strength oscillator for Sectors, Metals, or Crypto using a fixed analysis timeframe (Daily/Weekly) regardless of your chart.
It calculates Fast and Slow signals as the spread between a “bull basket” and a “bear/benchmark” basket using percent returns over TF-aware lookbacks (Daily: 11/22, Weekly: 5/10). In Crypto mode, Auto defaults to Weekly to avoid the 7-day crypto vs 5-day equities calendar mismatch.
Signal quality is improved with:
• Volatility normalization per leg (Off / Stdev-scaled / Z-score)
• Adaptive USD headwind using a rolling beta to UUP (optional trend-gated)
• A USD divergence/convergence module that can boost the score or gate alerts based on whether price action aligns with the expected USD relationship
• Debounced alerts using a deadband and multi-bar confirmation to reduce whipsaws
Outputs:
• Slow (histogram) and Fast (line) adjusted oscillator
• Optional UUP % reference and optional USD div/conv score
• Alerts when Fast/Slow move beyond the deadband and hold for the chosen confirmation bars (optionally filtered by USD div/conv gate)
It calculates Fast and Slow signals as the spread between a “bull basket” and a “bear/benchmark” basket using percent returns over TF-aware lookbacks (Daily: 11/22, Weekly: 5/10). In Crypto mode, Auto defaults to Weekly to avoid the 7-day crypto vs 5-day equities calendar mismatch.
Signal quality is improved with:
• Volatility normalization per leg (Off / Stdev-scaled / Z-score)
• Adaptive USD headwind using a rolling beta to UUP (optional trend-gated)
• A USD divergence/convergence module that can boost the score or gate alerts based on whether price action aligns with the expected USD relationship
• Debounced alerts using a deadband and multi-bar confirmation to reduce whipsaws
Outputs:
• Slow (histogram) and Fast (line) adjusted oscillator
• Optional UUP % reference and optional USD div/conv score
• Alerts when Fast/Slow move beyond the deadband and hold for the chosen confirmation bars (optionally filtered by USD div/conv gate)
Skrypt chroniony
Ten skrypt został opublikowany jako zamknięty kod źródłowy. Można z tego korzystać swobodnie i bez żadnych ograniczeń — więcej informacji znajduje się tutaj.
Wyłączenie odpowiedzialności
Informacje i publikacje nie stanowią i nie powinny być traktowane jako porady finansowe, inwestycyjne, tradingowe ani jakiekolwiek inne rekomendacje dostarczane lub zatwierdzone przez TradingView. Więcej informacji znajduje się w Warunkach użytkowania.
Skrypt chroniony
Ten skrypt został opublikowany jako zamknięty kod źródłowy. Można z tego korzystać swobodnie i bez żadnych ograniczeń — więcej informacji znajduje się tutaj.
Wyłączenie odpowiedzialności
Informacje i publikacje nie stanowią i nie powinny być traktowane jako porady finansowe, inwestycyjne, tradingowe ani jakiekolwiek inne rekomendacje dostarczane lub zatwierdzone przez TradingView. Więcej informacji znajduje się w Warunkach użytkowania.