OPEN-SOURCE SCRIPT

Relative Strength Regime Meter (SPY/QQQ/Peer Auto)

106
RS Dash v2 is a relative strength (RS) dashboard designed to quickly answer one question:

Is this asset leading or lagging vs (1) the market, (2) Nasdaq/growth, and (3) its peer group?

What it measures

For the current chart symbol, it calculates RS ratios:

RS vs SPY (market baseline)

RS vs QQQ (Nasdaq / growth baseline)

RS vs PEER ETF (sector/industry baseline)

RS ratio is simply:

RS = Symbol Close / Benchmark Close

Then it compares each RS ratio to its moving average (MA):

✅ if RS > RS_MA

Optional stricter rule: ✅ only if RS > RS_MA and RS_MA is rising

Peer ETF: Manual or Auto

You can pick the peer ETF in two ways:

MANUAL mode
Choose from labeled options like:

XLK – TECH, XLE – ENERGY, SMH – SEMIS, etc.

AUTO mode (default)
The script selects the peer ETF whose returns have the highest correlation to the symbol over a lookback window, with guardrails:

Min correlation threshold: if correlation is too low, it falls back to your chosen fallback peer.

Sticky switching: it only changes peer when the new best peer is better by a set margin (reduces “flicker”).

The table shows what AUTO picked, and it also prints the correlation as a trust meter.

Dashboard + Score

A table (bottom-left) shows:

SPY ✅/❌

QQQ ✅/❌

PEER ✅/❌ (with chosen peer name)

Total score 0–3

Interpretation:

3/3 = strong leadership (outperforming market + Nasdaq + peers)

2/3 = mixed leadership

0–1/3 = weak / lagging regime

Plot modes (solves scaling issues)

Because raw RS ratios can be on very different numeric scales, there are three plot modes:

Signal (% vs RS MA) (recommended)
Plots each RS as % above/below its RS MA where 0 = neutral.

Indexed (Base 100)
Normalizes each RS to start at 100 so you can compare “performance curves.”

Raw (single)
Shows only one RS ratio at a time (SPY / QQQ / PEER) for inspection.

Leadership line (Regime meter)

The Leadership line is a step line that visualizes the 0–3 score as a regime meter (it only has 4 states, by design). It helps you spot regime shifts without reading the table.

Divergences (optional)

Optional bullish/bearish divergence markers compare price pivots vs RS pivots on your chosen benchmark (SPY/QQQ/PEER). These are confirmation tools, not signals by themselves.

What this indicator is NOT

It does not predict tops/bottoms.

It does not replace fundamentals or risk management.

“AUTO peer” is correlation-based; in unusual regimes it can pick a peer that’s statistically close but not conceptually perfect — override with MANUAL when needed.

Suggested workflow

Keep plot mode on Signal (% vs RS MA)

Use AUTO peer for speed; flip to MANUAL if the chosen peer doesn’t make sense.

Use score changes + divergences as context, then use your main price/volume system for entries/exits.

Open-source, modify as you like.

Shorter description

RS Dash v2 compares the current symbol’s relative strength vs SPY, QQQ, and a Peer ETF (manual or auto-selected).
Each benchmark gets a ✅/❌ based on whether RS > RS_MA (optional: MA rising). The dashboard shows a 0–3 score and a Leadership step line that visualizes regime shifts.
Includes 3 plot modes to fix scaling: Signal (% vs MA), Indexed Base 100, and Raw single. Optional RS divergences.

Settings explanation

RS MA length: smoothing for RS trend. Higher = slower, fewer flips.

Auto return length / correlation lookback: controls how AUTO chooses the peer. Higher = more stable but slower to adapt.

Min corr / switch delta: guardrails to prevent nonsense picks and rapid switching.

Plot mode: choose Signal for decision clarity, Indexed for comparison curves, Raw for inspection.

Blunt “professional honesty” note

Correlation-based peer selection is a statistical best guess, not a fundamental sector classifier. That’s why the indicator is transparent: it shows the selected peer and correlation so users can override.

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.