DTC AIO [US] Why this is one tool, not a bundle of indicators
A stock's chart alone cannot tell you whether it is a genuine market leader. A rising 50-day average looks the same whether the earnings behind it are accelerating or shrinking; a strong-looking breakout looks the same whether the whole sector is moving or just that one ticker. Answering "is this a leader worth trading" requires checking several unrelated data sources against each other at the same time — the company's actual earnings, its price behavior relative to the market, how it behaves specifically when the market is under stress, and how it stacks up against the handful of stocks that compete with it. None of those four checks alone is reliable; a stock can look strong on any one of them and still not be a real leader. This script exists because doing that cross-check by hand — pulling up earnings, then flipping to a relative-strength chart, then manually building a peer watchlist — is slow and easy to skip. It runs all four checks against the same symbol on the same chart, automatically, and only then hands you the price-structure tools (moving averages, an anchored VWAP, pattern markers) needed to time an entry once that leadership case is actually made. The scoring engines are the reason this script exists; the timing tools are there so you are not forced to add three more indicators once you have your answer.
The four leadership checks
- Earnings engine. Quarterly or annual earnings and sales are pulled from PulseWire's financial data and laid out in a MarketSmith-style grid: the primary metric (earnings per share, or net income if you prefer), its year-over-year percentage change, sales, and the sales percentage change, with optional gross-margin and return-on-equity rows. Year-over-year is measured against the same period one year earlier so seasonal businesses compare fairly. A year-over-year change measured off a negative prior-year base is flagged with a "#", the standard convention for marking a percentage that would otherwise be misleading (e.g. earnings improving from -$1.00 to -$0.10 is not really a "-90%" move).
- Relative strength versus the market. A relative-strength line is built by dividing the stock's price by a benchmark's price (SPY by default), then scaling that ratio so it plots alongside the stock's own price. A one-year percentile rank of that ratio produces a 1-99 "RS Rating" — this is the same underlying idea used by IBD's RS Rating (how a stock's performance ranks against the rest of the market over the past year), calculated independently here from price data rather than licensed from any provider.
- Relative strength during stress ("Panic RS"). This checks something the plain RS line does not: whether the stock is holding above its own short-term average on days when the benchmark itself is below its own short-term average — in other words, is this stock outperforming specifically while the broad market is under pressure. That is a materially different (and rarer) signal than simply outperforming during a rally, and it is flagged with its own marker.
- Burst score (volatility regime). Instead of a single volatility number like ATR, this counts how many days over a chosen lookback (3 months to 3 years) closed up 5%, 10% and 17% or more, then combines those three counts into one score. A stock that regularly produces large up-days behaves very differently from one that grinds slowly upward even if their average volatility looks similar, and that difference is often visible in this count before it shows up in a standard momentum indicator.
- Automatic peer comparison. The stock's industry (or sector, as a fallback) is matched against a built-in map of roughly 60 US industry groups, each with a curated list of representative peer tickers, and a comparison table is built automatically from that group — day, 1-month and 3-month return, relative volume, and an RS column for each peer, with the current symbol pinned at the top. The RS column ranks each peer's 3-month return against the OTHER peers actually shown in the table (a 0-100 scale, highest = strongest of the group) — a peer-group-relative read, deliberately not the same 1-year-vs-market calculation the main RS Rating uses, since ranking a handful of direct competitors against each other is the more useful comparison in a table built specifically to check group leadership. You are not expected to build or maintain your own watchlist of comparable stocks; the peer set is derived from the symbol you already have on the chart.
Timing tools (used once the leadership case is made, not standalone)
- Four configurable moving averages (simple, exponential or weighted; independent length, color and width) for the standard support/trend read.
- An anchored VWAP measured from the most recent all-time high forward, giving a volume-weighted "fair value" line for the current up-leg rather than an arbitrary fixed lookback.
- Average daily range percentage and relative volume, so a breakout can be judged against the stock's own normal range and normal volume rather than an absolute number.
- Pattern markers: inside bars, a simplified pocket-pivot flag (an up day of 5%+ on above-threshold volume), the lowest-volume day over a lookback (often precedes a move), "three weeks tight" closes (three consecutive weekly closes within a volatility-scaled band of each other, an IBD base-tightening pattern), and swing high/low pivot labels with optional percentage change between them.
Compact dashboard
A small, repositionable table (top-right by default) puts the numbers behind the leadership read in one place: RS Rating, relative volume, average daily range %, 3-month return, the burst score, and float %. A stretched average daily range (7% or more) or an already-extended 3-month return (80% or more) is flagged in red with a ⚠ marker as a "this has probably already moved a lot" caution. Market cap, free float, and average dollar volume are available as the earnings table's configurable top-left header cell instead of a separate panel, so they sit next to the earnings grid they help contextualize.
How to use it
1. Add it to a daily chart of a US stock.
2. Check the earnings grid and the RS line/rating first: you want rising year-over-year earnings and sales together with relative strength making new highs against the benchmark.
3. Check whether the Panic RS markers and burst score are present — that tells you whether the leadership is showing up specifically during market weakness, and whether the stock has the range profile of an actual leader rather than a slow grinder.
4. Check the peer table to confirm the stock is leading its own group, not just riding the index up.
5. Once those four checks line up, use the moving-average stack, the anchored VWAP and the pattern markers to time an entry near support, sizing with the daily-range and relative-volume readings.
6. Every block has its own on/off toggle, so the dashboard can be reduced to only the checks you personally use.
Notes
- Earnings, sales, margin, return on equity, and the market-cap/float figures come from PulseWire's financial data and are only as complete as that data is for a given symbol; missing values show a dash rather than a misleading zero.
- Defaults assume US equities on a daily timeframe with a broad-market benchmark; the script will run on other markets and timeframes, but those defaults are US-equity-specific and not tuned for anything else.
- Tables and colors adapt automatically to a light or dark chart background.
- Open-source. Every input has a plain-language label and tooltip, so reading Pine is not required to use it.
- For educational and informational purposes only. Not financial advice.
Indicator










