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)
Script protégé
Ce script est publié en source fermée. Cependant, vous pouvez l'utiliser librement et sans aucune restriction – pour en savoir plus, cliquez ici.
Clause de non-responsabilité
Les informations et publications ne sont pas destinées à être, et ne constituent pas, des conseils ou recommandations financiers, d'investissement, de trading ou autres fournis ou approuvés par TradingView. Pour en savoir plus, consultez les Conditions d'utilisation.
Script protégé
Ce script est publié en source fermée. Cependant, vous pouvez l'utiliser librement et sans aucune restriction – pour en savoir plus, cliquez ici.
Clause de non-responsabilité
Les informations et publications ne sont pas destinées à être, et ne constituent pas, des conseils ou recommandations financiers, d'investissement, de trading ou autres fournis ou approuvés par TradingView. Pour en savoir plus, consultez les Conditions d'utilisation.