OPEN-SOURCE SCRIPT

Trident Screener - Stocks, Themes, Sectors [Galin]

160
Trident Screener

What it does
One screener, three universes. Run it in the Pine Screener on individual stocks, on thematic and industry ETFs, and on the sector SPDRs — same columns, same saved filters, three watchlists. It combines a Minervini-style trend template, an IBD-style weighted relative strength score, a three-condition leadership flag with same-day rotation detection, and setup-ripeness columns: contraction, volume dry-up, extension. Every plot becomes a filterable, sortable column — the answer arrives as a ranked table, not a chart to eyeball.

The columns

Trend
MM — 0 to 8, one point per rule when true: 1) close above the 150 and 200 SMA · 2) 150 SMA above 200 SMA · 3) 200 SMA rising vs 22 bars ago · 4) 50 SMA above the 150 and 200 · 5) close above the 50 SMA · 6) at least 25% above the 260-bar low · 7) within 25% of the 260-bar high · 8) weighted price-momentum composite above 70. Rule 8 uses a price composite, not an IBD-style rating — that job belongs to RS Score below.

Relative strength
RS Score — IBD-style weighted relative strength vs the benchmark, in percentage points: 40% × 3M + 20% × 6M + 20% × 9M + 20% × 12M. Zero means the symbol moves with the benchmark; leaders typically read +20 to +80. It is a margin, not a 0–99 percentile — sorting the column gives you the ranking over your own watchlist, which is the honest version of a ranking anyway.
RS 1W % / RS 1M % / RS 3M % — relative performance vs the benchmark per window, computed as the change of the symbol/benchmark ratio.

Leadership & rotation
A+ — 1/0. Above the 200-day SMA AND beats the benchmark over 1 month AND over 3 months. Each condition catches what the other two miss: a "strong month" inside a downtrend is a bounce, not a leader.
A+ streak — consecutive days with the A+ flag. 1 = promoted today: your rotation alert. Sort descending to rank the most established leaders. Tip: check RS 1W on fresh promotions — a green week means an organic promotion; a deep red week means the calendar just rolled a crash out of the 1-month window.
Improving — above the 200 SMA and beating the benchmark on 1M but not yet on 3M: the waiting room for tomorrow's leaders.

Early accumulation
RS NH — the RS line (symbol ÷ benchmark) is at a 252-bar high.
RS NH lead — RS NH while price is still more than 2% below its own 260-bar high. Relative strength breaking out before price is a classic accumulation tell: someone is buying the base hard enough to outrun the index without a breakout.

Setup ripeness
xFrom50 — extension from the 50 SMA measured in daily ATRs: the "too extended to chase" gauge.
% vs 20SMA — the pullback radar: an extended leader near its 20 SMA is offering an entry instead of demanding a chase.
% from 20D High / % from 60D High — proximity to the recent high and to the base high.
Tight5 (xATR) — the 5-day range measured in ATRs. Small = contraction.
Vol 5D/50D — volume dry-up ratio; below ~0.8 = quiet base.

Suggested setups (set once — filters stick to the indicator)
Stocks: MM = 8 · xFrom50 0 to 4 · % from 60D High −8 to 0 · Tight5 < 3 · Vol 5D/50D < 0.8 → sort RS Score descending. Result: tight, dry leaders sitting just under their highs. Loosen the last three by ~30% for an "almost ready" second pass.
Themes / sectors: A+ = 1 → sort RS Score descending. The row count is a daily breadth curve — log it. A+ streak = 1 → fresh promotions. Improving = 1 → the waiting room.
Weekly: RS NH lead = 1 → the names where the money arrived before the breakout.

Settings
Benchmark — default SPY. Compare sectors vs SPY, growth themes vs QQQ, breadth vs RSP, or a stock vs its own sector ETF.

Notes
Run the screener on the 1D timeframe — required, because A+ streak and RS NH count chart bars, so one bar must equal one day. Plots are hidden on the chart by design; this is a screener tool. All windows are trading days (5/21/63/126/189/252). Symbols younger than ~12 months show empty RS Score cells until the history exists. MM criteria adapted from the Minervini Trend Template by yogy.frestarahmawan (MPL 2.0). Volume confirms what the screener nominates — for entry confirmation, pair it with my Relative Volume At Time indicator.

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.