OPEN-SOURCE SCRIPT
Updated Stage 2 Trend Qualifier 8-Criteria Trend Template with RS score

A compact on-chart dashboard that evaluates whether a stock qualifies as a Stage 2 uptrend using an 8-criteria trend template based on moving average alignment and price position relative to key benchmarks. Includes relative strength scoring, outperformance day tracking, and RS line analysis.
█ WHAT IT DOES
This indicator runs 8 mechanical checks on every bar and displays pass/fail status in a clean overlay table:
1. Price above 150-day SMA
2. Price above 200-day SMA
3. 50-day SMA above 150-day SMA
4. 50-day SMA above 200-day SMA
5. 200-day SMA trending up for at least 1 month
6. Price at least 25% above its 52-week low
7. Price within 25% of its 52-week high
8. Price not more than 10% below the 50-day SMA
When all 8 pass → STAGE 2 (confirmed uptrend). Otherwise the indicator classifies the stock as Stage 1 (basing), Stage 3 (topping), or Stage 4 (decline) based on moving average relationships.
█ RS SCORE (1–99)
Relative strength versus a user-selected benchmark (default: SPY) displayed as a normalized score from 1 to 99 across four timeframes: 1M, 3M, 6M, and 12M.
50 = matching the benchmark. Above 50 = outperforming. Below 50 = underperforming. Each timeframe uses a calibrated scale so scores are comparable across periods.
Color coding:
≥80 → bright green (strong leader)
60–79 → green (outperformer)
40–59 → gray (average)
<40 → red (laggard)
█ RS DAYS
Counts how many trading days the stock outperformed the benchmark over rolling windows of 15, 30, and 60 days. Displayed as: count (win-rate%). For example, "9 (60%)" means the stock beat the benchmark on 9 out of 15 days.
A high RS Score with a low RS Days % means the stock had a few big winning days but isn't consistently leading — less reliable strength. Consistent outperformance (>60%) across all windows is the strongest signal.
█ RS LINE STATUS
Evaluates the relative strength line (stock price ÷ benchmark price) versus its own 52-week high:
NEW HIGH → RS line at its 52-week peak. Strongest relative performance in a year. Often leads price breakouts.
NEAR HIGH → Within 3% of 52-week high. Relative strength building toward leadership.
NEUTRAL → 3–15% below 52-week high. Average relative performance, no clear edge.
WEAK → More than 15% below 52-week high. Relative strength deteriorating. Market rotating away.
█ ALERTS
Three built-in alert conditions:
- Stage 2 Qualified — stock transitions from <8/8 to 8/8 criteria met
- Stage 2 Lost — stock drops from 8/8 to fewer criteria met
- RS Line New High — relative strength line hits a new 52-week high
█ SETTINGS
- Toggle sections: Trend Template, RS Score & Days (on/off independently)
- Table position: any corner or middle edge
- Text size: tiny, small, normal
- Theme: Dark or Light (match your chart background)
- Benchmark symbol: default SPY, changeable to any index or ETF
█ USAGE NOTES
- Designed for the DAILY timeframe. On intraday or weekly charts, the bar-based lookbacks (252 bars for 52-week, 21 bars for 1 month) represent chart bars, not calendar days.
- Stage 2 identification is mechanically precise — all 8 criteria must pass. Stages 1, 3, and 4 use approximate moving average relationship logic.
- RS Score normalizes relative performance to a 1–99 scale. This is NOT a percentile rank across a stock universe — it measures magnitude of outperformance vs your selected benchmark.
- This indicator is an educational and analytical tool. It does not generate buy or sell signals.
█ WHAT IT DOES
This indicator runs 8 mechanical checks on every bar and displays pass/fail status in a clean overlay table:
1. Price above 150-day SMA
2. Price above 200-day SMA
3. 50-day SMA above 150-day SMA
4. 50-day SMA above 200-day SMA
5. 200-day SMA trending up for at least 1 month
6. Price at least 25% above its 52-week low
7. Price within 25% of its 52-week high
8. Price not more than 10% below the 50-day SMA
When all 8 pass → STAGE 2 (confirmed uptrend). Otherwise the indicator classifies the stock as Stage 1 (basing), Stage 3 (topping), or Stage 4 (decline) based on moving average relationships.
█ RS SCORE (1–99)
Relative strength versus a user-selected benchmark (default: SPY) displayed as a normalized score from 1 to 99 across four timeframes: 1M, 3M, 6M, and 12M.
50 = matching the benchmark. Above 50 = outperforming. Below 50 = underperforming. Each timeframe uses a calibrated scale so scores are comparable across periods.
Color coding:
≥80 → bright green (strong leader)
60–79 → green (outperformer)
40–59 → gray (average)
<40 → red (laggard)
█ RS DAYS
Counts how many trading days the stock outperformed the benchmark over rolling windows of 15, 30, and 60 days. Displayed as: count (win-rate%). For example, "9 (60%)" means the stock beat the benchmark on 9 out of 15 days.
A high RS Score with a low RS Days % means the stock had a few big winning days but isn't consistently leading — less reliable strength. Consistent outperformance (>60%) across all windows is the strongest signal.
█ RS LINE STATUS
Evaluates the relative strength line (stock price ÷ benchmark price) versus its own 52-week high:
NEW HIGH → RS line at its 52-week peak. Strongest relative performance in a year. Often leads price breakouts.
NEAR HIGH → Within 3% of 52-week high. Relative strength building toward leadership.
NEUTRAL → 3–15% below 52-week high. Average relative performance, no clear edge.
WEAK → More than 15% below 52-week high. Relative strength deteriorating. Market rotating away.
█ ALERTS
Three built-in alert conditions:
- Stage 2 Qualified — stock transitions from <8/8 to 8/8 criteria met
- Stage 2 Lost — stock drops from 8/8 to fewer criteria met
- RS Line New High — relative strength line hits a new 52-week high
█ SETTINGS
- Toggle sections: Trend Template, RS Score & Days (on/off independently)
- Table position: any corner or middle edge
- Text size: tiny, small, normal
- Theme: Dark or Light (match your chart background)
- Benchmark symbol: default SPY, changeable to any index or ETF
█ USAGE NOTES
- Designed for the DAILY timeframe. On intraday or weekly charts, the bar-based lookbacks (252 bars for 52-week, 21 bars for 1 month) represent chart bars, not calendar days.
- Stage 2 identification is mechanically precise — all 8 criteria must pass. Stages 1, 3, and 4 use approximate moving average relationship logic.
- RS Score normalizes relative performance to a 1–99 scale. This is NOT a percentile rank across a stock universe — it measures magnitude of outperformance vs your selected benchmark.
- This indicator is an educational and analytical tool. It does not generate buy or sell signals.
Release Notes
Added Volume Run Rate (VRR) — shows projected volume pace vs 50-day volume MA on the live bar. Positive = above average, negative = below average. Helps gauge real-time volume conviction during the session.Release Notes
"Removed VRR debug overlay."Removed VRR debug overlay. No feature changes."Open-source script
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
Disclaimer
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.
Open-source script
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
Disclaimer
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.