OPEN-SOURCE SCRIPT
Capital Rotational Event CRE As A Multi Pair Scanner

Capital Rotational Event (CRE) – Multi Pair Rotation Scanner
This open-source, non-overlay indicator scans for **capital rotation signals** across one lead/benchmark asset and up to four receiver/target assets simultaneously.
It detects when capital appears to be rotating **into** one or more of the receiver assets relative to the lead asset — a classic macro/rotation concept used in intermarket analysis.
Core Concept
In regime-shifting or macro-driven markets, money flows between asset classes or correlated instruments (risk-on → risk-off, equities → bonds, growth → value, etc.). When one asset class starts consistently outperforming another — and that outperformance is accelerating — it can signal a change in investor preference, risk appetite, or sector leadership.
This scanner visualizes that rotation in real time by calculating relative strength + momentum for multiple pairs at once.
How It Works
1. User selects:
- One Lead/ Benchmark asset (default: SPY – equities proxy)
- Up to four Receiver assets (defaults: GLD, TLT, USO, XLE)
2. For each receiver pair:
- Relative Strength (RS) = SMA( Receiver Close / Lead Close , RS Length )
- RS Momentum = SMA( change(RS) , Momentum Length )
3. Rotation Signal per pair:
- Bullish CRE (+1): RS > its own SMA **and** RS momentum > 0
→ Receiver outperforming Lead **and** the outperformance is accelerating
- Bearish CRE (-1): RS < its own SMA **and** RS momentum < 0
→ Receiver underperforming Lead **and** the underperformance is accelerating
- Neutral (0): otherwise
4. Visual Output:
- Four separate lines (green, blue, orange, purple) showing CRE signal for each receiver
→ +1 = bullish rotation into that asset
→ -1 = bearish rotation away from that asset
→ 0 = no clear rotation
- Background tint: light green when **at least one** receiver shows bullish CRE (+1)
Why this multi-pair scanner?
- Single-pair RS tools only show one relationship at a time.
- Monitoring multiple receivers simultaneously reveals **which** asset class or sector is currently receiving capital flows — very useful for macro traders, sector rotation strategies, or risk-on/off positioning.
- The momentum filter reduces lag and false signals compared to raw RS crossovers alone.
Typical Use Cases
- Risk-on/Risk-off: SPY (lead) vs GLD + TLT + USO (safe havens/commodities)
- Sector leadership: SPY vs XLE (energy) + XLK (tech) + XLV (healthcare) + XLF (financials)
- Macro themes: SPY vs TLT (equities vs bonds), DXY vs GLD, etc.
- Timeframes: Daily/weekly for macro swings, 4h/1h for tactical rotations
How to Use
1. Apply to any chart (timeframe of your choice — the indicator is timeframe-agnostic).
2. Set your preferred Lead asset and up to 4 Receivers in the inputs.
3. Adjust RS Length (default 14) and Momentum Length (default 9) to match your horizon.
4. Interpretation:
- Green line above zero → capital rotating into that receiver
- Multiple green lines rising → strong multi-sector rotation
- Light green background → at least one bullish rotation detected
- Use in combination with price action on the actual assets — this is a relative bias tool, not a direct trade signal.
5. Best in trending or regime-shifting markets; less useful when all assets move in strong correlation.
Inputs
- Lead Asset: benchmark (default SPY)
- Receiver 1–4: assets to monitor rotation into (defaults GLD, TLT, USO, XLE)
- RS Length: smoothing for relative strength (default 14)
- Momentum Length: smoothing for RS change (default 9)
Publishing Recommendation
- Publish with a clean chart (e.g., daily or 4h SPY, or any index/ETF)
- The indicator is non-overlay — it plots in a separate pane below price
- No other indicators needed for basic use
This script is fully open-source for transparency and learning. It highlights relative rotation patterns — not guaranteed future performance. Trading and investing involve significant risk of loss.
Feedback welcome — especially suggestions for other useful receiver pairs!
This open-source, non-overlay indicator scans for **capital rotation signals** across one lead/benchmark asset and up to four receiver/target assets simultaneously.
It detects when capital appears to be rotating **into** one or more of the receiver assets relative to the lead asset — a classic macro/rotation concept used in intermarket analysis.
Core Concept
In regime-shifting or macro-driven markets, money flows between asset classes or correlated instruments (risk-on → risk-off, equities → bonds, growth → value, etc.). When one asset class starts consistently outperforming another — and that outperformance is accelerating — it can signal a change in investor preference, risk appetite, or sector leadership.
This scanner visualizes that rotation in real time by calculating relative strength + momentum for multiple pairs at once.
How It Works
1. User selects:
- One Lead/ Benchmark asset (default: SPY – equities proxy)
- Up to four Receiver assets (defaults: GLD, TLT, USO, XLE)
2. For each receiver pair:
- Relative Strength (RS) = SMA( Receiver Close / Lead Close , RS Length )
- RS Momentum = SMA( change(RS) , Momentum Length )
3. Rotation Signal per pair:
- Bullish CRE (+1): RS > its own SMA **and** RS momentum > 0
→ Receiver outperforming Lead **and** the outperformance is accelerating
- Bearish CRE (-1): RS < its own SMA **and** RS momentum < 0
→ Receiver underperforming Lead **and** the underperformance is accelerating
- Neutral (0): otherwise
4. Visual Output:
- Four separate lines (green, blue, orange, purple) showing CRE signal for each receiver
→ +1 = bullish rotation into that asset
→ -1 = bearish rotation away from that asset
→ 0 = no clear rotation
- Background tint: light green when **at least one** receiver shows bullish CRE (+1)
Why this multi-pair scanner?
- Single-pair RS tools only show one relationship at a time.
- Monitoring multiple receivers simultaneously reveals **which** asset class or sector is currently receiving capital flows — very useful for macro traders, sector rotation strategies, or risk-on/off positioning.
- The momentum filter reduces lag and false signals compared to raw RS crossovers alone.
Typical Use Cases
- Risk-on/Risk-off: SPY (lead) vs GLD + TLT + USO (safe havens/commodities)
- Sector leadership: SPY vs XLE (energy) + XLK (tech) + XLV (healthcare) + XLF (financials)
- Macro themes: SPY vs TLT (equities vs bonds), DXY vs GLD, etc.
- Timeframes: Daily/weekly for macro swings, 4h/1h for tactical rotations
How to Use
1. Apply to any chart (timeframe of your choice — the indicator is timeframe-agnostic).
2. Set your preferred Lead asset and up to 4 Receivers in the inputs.
3. Adjust RS Length (default 14) and Momentum Length (default 9) to match your horizon.
4. Interpretation:
- Green line above zero → capital rotating into that receiver
- Multiple green lines rising → strong multi-sector rotation
- Light green background → at least one bullish rotation detected
- Use in combination with price action on the actual assets — this is a relative bias tool, not a direct trade signal.
5. Best in trending or regime-shifting markets; less useful when all assets move in strong correlation.
Inputs
- Lead Asset: benchmark (default SPY)
- Receiver 1–4: assets to monitor rotation into (defaults GLD, TLT, USO, XLE)
- RS Length: smoothing for relative strength (default 14)
- Momentum Length: smoothing for RS change (default 9)
Publishing Recommendation
- Publish with a clean chart (e.g., daily or 4h SPY, or any index/ETF)
- The indicator is non-overlay — it plots in a separate pane below price
- No other indicators needed for basic use
This script is fully open-source for transparency and learning. It highlights relative rotation patterns — not guaranteed future performance. Trading and investing involve significant risk of loss.
Feedback welcome — especially suggestions for other useful receiver pairs!
Script de código abierto
Fiel al espíritu de TradingView, el creador de este script lo ha convertido en código abierto, para que los traders puedan revisar y verificar su funcionalidad. ¡Enhorabuena al autor! Aunque puede utilizarlo de forma gratuita, recuerde que cualquier republicación del código está sujeta a nuestras Normas internas.
Exención de responsabilidad
La información y las publicaciones no constituyen, ni deben considerarse como, asesoramiento o recomendaciones financieras, de inversión, de trading u otro tipo, proporcionadas o respaldadas por TradingView. Obtenga más información en Condiciones de uso.
Script de código abierto
Fiel al espíritu de TradingView, el creador de este script lo ha convertido en código abierto, para que los traders puedan revisar y verificar su funcionalidad. ¡Enhorabuena al autor! Aunque puede utilizarlo de forma gratuita, recuerde que cualquier republicación del código está sujeta a nuestras Normas internas.
Exención de responsabilidad
La información y las publicaciones no constituyen, ni deben considerarse como, asesoramiento o recomendaciones financieras, de inversión, de trading u otro tipo, proporcionadas o respaldadas por TradingView. Obtenga más información en Condiciones de uso.