Stan Weinstein's cycle: Stage 1 base (flat 30-week MA) → Stage 2 advance (price above a rising 30-week MA) → Stage 3 top (MA flattens) → Stage 4 decline (price below a falling MA). It is a weekly method; both screens run on weekly bars built from Kite daily data, refreshed every trading evening (16:40 / 16:45 IST).
| Gate | Rule | Why |
|---|---|---|
| G1 Series | EQ only (no BE/BZ/SM/ST) | trade-to-trade / surveillance books are untradeable |
| G2 Liquidity | ≥ ₹20 cr traded value / week | fills and exits must be real |
| G3 Above MA | weekly close > 30-week MA | below it is still Stage 1 (or 4) |
| G3b MA turn | 30-week MA slope (13w) ≥ 0 | a falling 30wk MA is Stage 1 by definition; v1 scored this instead of gating and let 30 not-yet-turned names through |
| G4 Long base | base ≥ 30 weeks | this screen is specifically about long bases |
| G5 Contained | base depth ≤ 40% | deeper is a downtrend, not accumulation |
| G6 Near pivot | within 10% below the pivot | mid-base is waiting, not transitioning |
Mechanical, no hand-picked pivots: walk backwards from the latest week extending the window while the range stays contained; the base is the tightest band that still contains ≥ 30 weeks (tested at 15/18/22/25/30/35/40% ceilings). The pivot is the base's high excluding the last 4 weeks — including the current bar makes breakouts mathematically undetectable (a real v1 bug).
| Block | Pts | Components |
|---|---|---|
| Base structure | 30 | length (30w=6 … 78w+=12) · depth (≤25%=8) · ATR contraction vs base start (5) · last-10w compression <50% of range (5) |
| 30wk MA transition | 25 | above MA (8) · slope ≥ 0 (7) · slope improving vs 13w ago (5) · MA was falling earlier in the base — proves a real Stage 1, not a continuation (5) |
| Trigger | 20 | position vs pivot (just cleared 0..+8% = 10) · P&F 2%×3 in X column (5) · upper half of base (5) |
| Volume | 15 | up-day thrust ≥2× 50d avg (7; ≥1.5× = 4) · 20d up/down volume > 1.2 (4) · base volume dry-up vs prior decline (4) |
| RS (improving) | 10 | RS line vs NIFTY 500 at a 13-week high (5) · 3m RS accelerating past 6m (5) |
Volume thrust counts up-days only (v2 fix — a heavy distribution day used to score as breakout volume). Grades: A ≥ 80 · B 65–79 · C 50–64; below 50 not listed.
| COILED | within 10% below the pivot, not yet triggered — watchlist |
| BREAKING OUT | 0 to +8% past the pivot — the actionable window (O'Neil: buy within ~5% of the pivot) |
| EARLY STAGE 2 | +8–20% past, MA rising — trend underway, wait for a pullback |
| EXTENDED | >20% past — context only, never a fresh entry |
A card gets the green ring and 🎯 badge only when all seven actionable checks pass at once — the daily-leader screen's founding lesson (TATATECH was the only 4-of-4 name of its week; every near-miss shared one or two perfect blocks, and the conjunction was what separated the winner):
P&F X-column confirmation is deliberately excluded — the backtest found it selected worse forward returns (likely an extension proxy). An ALL-GREEN badge is a full-checklist probe candidate, after the earnings-date check — it is still discovery, not a guarantee. Near-misses on the page show which check failed (e.g. "6/7 green — missing: market Stage 2").
| Price | weekly close below the 30-week MA |
| MA | 30-week MA slope ≤ 0 — a dip below a RISING MA is a pullback, not Stage 4 (this gate keeps healthy stocks having a bad fortnight off the list) |
| Top | ≥ 20 weeks — there must have been something to distribute from |
| Near floor | within +10% above the top's floor and not more than 25% below it — the screen is about the turn, not cataloguing wreckage |
Top structure 25 · 30-week MA 25 · Breakdown trigger 20 · Volume 15 (down-day thrust + down-volume dominance) · RS 15 (RS at a 13-week low, 3m worse than 6m).
| DISTRIBUTION | still above the floor — topping, the early warning |
| BREAKING DOWN | 0 to −8% through the floor — the actionable warning |
| STAGE 4 | −8 to −25% below, MA falling — decline established |
Weinstein's first rule: most Stage-2 breakouts fail when the index itself is Stage 3/4. Both pages carry the benchmark's own stage read (NIFTY 500 vs its 30-week MA, 2% band, 4-week MA slope). When the market is not in Stage 2, the Stage 1→2 page shows a banner: half-size probes at most, or skip. This was the highest-EV recommendation in the best-practice research (Weinstein, Clenow's index filter, Faber's timing work all converge on it).
Every card carries P&F at two box sizes, both 3-box reversal, from the same ta_score.pnf_read()
a single-stock run uses. 2%×3 governs (position-trade box; drives the score). 1%×3 turns earlier; when the
two disagree an amber chip fires — 1%=O inside 2%=X is deterioration under an intact uptrend, before the slower
box confirms. The count target is shown because it is computed from column width; a measured move off an
unproven base is a guess and is deliberately not shown.
RS = price ratio vs NIFTY 500, plus (v2) the 26-week return percentile vs all ~700 scanned names — Minervini/IBD gate leaders at percentile ≥ 70. On the Stage 1→2 page it is context, not a gate (see the RS asymmetry); single digits on the Stage 3→4 page confirm the breakdown.
Sector health = TREND 50 + RS 30 + POSITION 20 per NSE sector index (no volume block — index bars carry no volume; a component broken identically for everyone is noise). Stock→sector is assigned by 104-week weekly-return correlation; below r = 0.45 the card says UNCLASSIFIED rather than guessing. The map file is hand-editable and the builder only fills missing symbols, so corrections are permanent (e.g. hotels/travel pinned to NIFTY IND TOURISM, diagnostics/hospitals to NIFTY HEALTHCARE, 08-Aug-26).
Names in the F&O segment carry an ⚡ chip. For displayed F&O cards the near-monthly option chain is read and three positioning numbers shown: the put floor (strike with max put OI — positioning support), the call wall (strike with max call OI — overhead supply), and the PCR. Use: a call wall sitting between CMP and the count target is resistance the breakout must eat through (a close through it often accelerates on short-covering); a put floor beneath the probe stop is confluence; on the breakdown page, the put floor holding or failing is the level the positioning itself watches. Stock options are monthly and far thinner than index options — context, never a gate, and deliberately excluded from the ALL-GREEN conjunction.
--limit) write separate .smoke files so they can never pollute the
diff history.| Stop | Where | Use |
|---|---|---|
| Base-low stop | the base low (25–40% away) | Weinstein's investor stop for a position trade; printed for honesty, rarely sized against |
| Probe stop | 5% under the pivot, never closer than 1.5× daily ATR | the tradeable stop, per Weinstein's 4–6%-below-the-breakout trader rule |
The probe line on each card shows entry (CMP if through the pivot, else a buy-stop just above it), the probe stop, risk %, R:R to the P&F count target, and ADR% (20-day average daily range — can this name pay?). R:R < 2 is flagged UNVIABLE: breakout systems run ~45–50% win rates, so the payoff ratio is the entire edge.
stage_backtest.py replays both screens week-by-week over ~3 years of Kite daily history
(each signal needs 260 warm-up days, so the signal window is roughly the last 18–20 months). It is an
event study: every onset of BREAKING OUT / BREAKING DOWN, forward 4/8/13/26-week returns vs NIFTY 500,
probe-stop-vs-target outcomes, and cuts by volume confirmation, market regime and score — i.e. it tests whether
the chips and the forest-rule banner earn their place.
| Finding | Number | Read |
|---|---|---|
| Base rate | 13w median excess −0.4%, win ~49%; mean +1.6% (26w mean +2.7%) | the classic breakout profile: half fail small, the edge lives in the right tail — win rate is NOT the edge, payoff is |
| Market regime | regime-OK: median +0.45%, win 50.8% · regime-bad: −1.94%, win 44.8% | the forest-rule banner earns its place — a ~2.4pp median / 6pp win-rate spread from one filter |
| Volume ≥1.5× | median −0.25% vs −1.52% without | the low-volume warning chip is justified |
| Probe trades | stop-first 563 · target-first 190 · still open 142 | ~25% of resolved probes reach the P&F count before the 5%-under-pivot stop — viable only because the count is typically several times the risk; demand R:R ≥ 2 |
| P&F X at breakout | X-column names did WORSE (−0.84%, win 46.8%) than non-X (+1.68%, win 56.8%) | counterintuitive — under review. Possibly an extension proxy (an established X column means the move already ran). Treat the P&F chip as information, not a filter, until re-tested |
| Score ≥ 65 | no separation vs <65 in 13w excess | the score ranks setup quality, not short-horizon forward return — use it to prioritise attention, not to predict |
| Stage 3→4 warning | median excess negative at every horizon (−0.2% to −1.45%), win ~48% | mild but consistent defensive edge; means are positive (big rebounds skew), and survivorship understates true severity — the delisted wrecks are not in the sample |
Three runs per trading day: 11:05 (catch fresh moves with most of the session left), 14:40 (pre-close decision window), 16:40 IST (EOD — the authoritative run; Stage 3→4 follows each by ~10 min). Weinstein is a weekly method — the decisive input is the weekly close, so hourly or 5-minute refreshes would add noise, API load and false urgency without adding signal. Intraday runs exist for exactly two events: a fresh breakout worth acting on today, and a held name losing its floor intraday — exactly what the intraday runs exist to surface. Note the intraday runs read a partial daily bar: volume ratios understate until EOD.
Every number on the cards comes from one shared scoring engine, covered by a regression and acceptance test suite; each bug found during the build is pinned by a test so it cannot return.