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)
Skrip dilindungi
Skrip ini diterbitkan sebagai sumber tertutup. Akan tetapi, anda boleh menggunakannya secara bebas dan tanpa apa-apa had – ketahui lebih di sini.
Penafian
Maklumat dan penerbitan adalah tidak bertujuan, dan tidak membentuk, nasihat atau cadangan kewangan, pelaburan, dagangan atau jenis lain yang diberikan atau disahkan oleh TradingView. Baca lebih dalam Terma Penggunaan.
Skrip dilindungi
Skrip ini diterbitkan sebagai sumber tertutup. Akan tetapi, anda boleh menggunakannya secara bebas dan tanpa apa-apa had – ketahui lebih di sini.
Penafian
Maklumat dan penerbitan adalah tidak bertujuan, dan tidak membentuk, nasihat atau cadangan kewangan, pelaburan, dagangan atau jenis lain yang diberikan atau disahkan oleh TradingView. Baca lebih dalam Terma Penggunaan.