PROTECTED SOURCE SCRIPT

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

41
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)

คำจำกัดสิทธิ์ความรับผิดชอบ

ข้อมูลและบทความไม่ได้มีวัตถุประสงค์เพื่อก่อให้เกิดกิจกรรมทางการเงิน, การลงทุน, การซื้อขาย, ข้อเสนอแนะ หรือคำแนะนำประเภทอื่น ๆ ที่ให้หรือรับรองโดย TradingView อ่านเพิ่มเติมใน ข้อกำหนดการใช้งาน