Markets: A Rigorous Course

4.2 Swing-trading frameworks as testable rule sets

Foundation about 30 min

Motivation

Swing trading holds positions for days to weeks to capture one leg of a trend. Its best-known methods come from practitioners' books, not from peer-reviewed tests. They are worth studying because they encode a coherent hypothesis (buy strength in leaders when the market is healthy, cut losses fast), and because they are almost fully codable. The research task is to code them exactly, test them on point-in-time data with Indian costs, and see what survives.

A caution on sources. The frameworks come from four books: Weinstein (1988), Minervini (2013), O'Neil (4th ed., 2009) and Darvas (1960). The chapter locations below were checked against the publishers' tables of contents (McGraw-Hill product pages, accessed 6 Nov 2026), and chapters are cited by title because numbering differs between printings. The printed pages themselves were not available to the course. Every number therefore carries one of two labels in the table below:

  • restated: the figure is attributed to the author consistently by independent secondary sources, but it has not been checked against the page;
  • course adaptation: the author states the idea qualitatively, or gives no number, and the course chose one to make the rule codable.

Check the restated numbers against your own copy before you rely on them. Authors also restate their rules across editions. Treat each number as a default parameter, record it, and count it as a trial when you vary it.

Rule Source (book, chapter) Number used here Label
Four stages, 30-week moving average, buy only in Stage 2 Weinstein (1988), opening chapters on chart reading and the stages 30 weeks restated
Breakout volume about twice the weekly average; Mansfield RS >0>0 Weinstein (1988), chapters on buying RVOL≥2\mathrm{RVOL}\ge2, RS >0>0 restated
Slope lag of four weeks, flatness tolerance ϵ\epsilon, 26-week Donchian breakout none (Weinstein judges these by eye) ϵ=0.5%\epsilon=0.5\%, 4 weeks, 26 weeks course adaptation
Trend Template criteria 1–5 (price and the 50/150/200-day averages) Minervini (2013), "Trading with the Trend" as listed restated
200-day average rising for at least one month Minervini (2013), "Trading with the Trend" 21 trading days restated (one month); the 21-day lag is a course adaptation
Price at least 30% above the 52-week low and within 25% of the 52-week high Minervini (2013), "Trading with the Trend" 1.30, 0.75 restated
RS ranking at least 70 Minervini (2013), "Trading with the Trend" (IBD's RS rating) 70 restated; the 12-month-return percentile proxy is a course adaptation
VCP: successively smaller contractions, volume dry-up, pivot breakout Minervini (2013), "A Picture Is Worth a Million Dollars" base ≤65\le65 days, J∈{2,…,6}J\in\{2,\dots,6\}, 10- vs 50-day volume, RVOL≥1.5\mathrm{RVOL}\ge1.5, stop within 10% course adaptation (the pattern is the book's; the numbers are the course's)
C: current quarterly EPS growth O'Neil (2009), "C = Current Quarterly Earnings per Share" about 25% year on year restated
A: annual EPS growth over three years; ROE O'Neil (2009), "A = Annual Earnings Increases" about 25%; ROE about 17% restated
S: breakout volume above average O'Neil (2009), "S = Supply and Demand" 40–50% above average restated
L: relative strength O'Neil (2009), "L = Leader or Laggard" RS rating at least 80 restated
M: confirmed uptrend, distribution days, follow-through day O'Neil (2009), "M = Market Direction" Definition 4.8 (200-day SMA) course adaptation (O'Neil's own test is the distribution-day count)
Cut losses at 7–8% below the buy point O'Neil (2009), "When to Sell and Cut Your Losses" 7–8% restated
Take profits at 20–25%; hold a 20%-in-three-weeks gainer for eight weeks O'Neil (2009), "When to Sell and Take Your Profit" 20–25%, 3 and 8 weeks restated
Buy at the pivot of a proper base, not more than 5% above it O'Neil (2009), "How to Read Charts Like an Expert" 5% restated
Darvas box: new high, top and bottom confirmed by later bars Darvas (1960) three-day confirmations course adaptation (Darvas describes the box in narrative, not as a fixed count)

4.2.1Weinstein stage analysis#

Stan Weinstein, Secrets for Profiting in Bull and Bear Markets (1988), uses weekly bars and a 30-week moving average. He describes four stages: 1 (basing: the average is flat and price oscillates around it), 2 (advancing: price breaks above resistance and above a rising average, on volume of about twice the weekly average), 3 (topping: the average flattens), and 4 (declining: price below a falling average). He buys only in Stage 2 and trails stops under the average and successive swing lows. He also requires positive Mansfield relative strength and a supportive market and sector (top-down).

Definition 4.5codable stages

Let CτC_\tau be weekly closes, mτ=SMA30(C)τm_\tau=\mathrm{SMA}_{30}(C)_\tau and slope gτ=mτ/mτ−4−1g_\tau=m_\tau/m_{\tau-4}-1, with tolerance ϵ\epsilon (say 0.5% over four weeks). Then

  • Stage 2 if Cτ>mτC_\tau>m_\tau and gτ>ϵg_\tau>\epsilon;
  • Stage 4 if Cτ<mτC_\tau<m_\tau and gτ<−ϵg_\tau<-\epsilon;
  • otherwise the average is flat: Stage 3 if the most recent non-flat stage was 2, else Stage 1.

An entry rule is then: buy at the next weekly open after the first week with Stage 2, a 26-week Donchian breakout, RVOL≥2\mathrm{RVOL}\ge2 and Mansfield RS >0>0. (The market filter is Definition 4.8 in 4.2.3.) Note what the definition forces you to decide: the slope lag, the flatness tolerance, and what "resistance" means. Weinstein makes these calls by eye.

4.2.2Minervini's Trend Template, SEPA and VCP#

Mark Minervini (Trade Like a Stock Market Wizard, 2013) screens with a "Trend Template" before looking at any setup.

Definition 4.6Trend Template, daily bars

All of:

  1. Ct>SMA150C_t>\mathrm{SMA}_{150} and Ct>SMA200C_t>\mathrm{SMA}_{200};
  2. SMA150>SMA200\mathrm{SMA}_{150}>\mathrm{SMA}_{200};
  3. SMA200\mathrm{SMA}_{200} rising for at least one month: SMA200,t>SMA200,t−21\mathrm{SMA}_{200,t}>\mathrm{SMA}_{200,t-21};
  4. SMA50>SMA150\mathrm{SMA}_{50}>\mathrm{SMA}_{150} and SMA50>SMA200\mathrm{SMA}_{50}>\mathrm{SMA}_{200};
  5. Ct>SMA50C_t>\mathrm{SMA}_{50};
  6. Ct≥1.30×C_t\ge1.30\times the 52-week low;
  7. Ct≥0.75×C_t\ge0.75\times the 52-week high;
  8. RS rank ≥70\ge70 (IBD rating; approximate by the percentile of 12-month return in the universe).

By Proposition 4.1, criteria 1–5 are all positive-weight filters on past returns. The template is a multi-horizon momentum screen with a 52-week-high proximity condition (criterion 7), which links it to the 52-week-high effect of George and Hwang (2004).

SEPA ("Specific Entry Point Analysis") adds fundamentals (accelerating earnings and sales), a catalyst, and an entry from a volatility contraction pattern.

Definition 4.7VCP, one codable version

Within a base of length ≤65\le 65 days following a Trend-Template uptrend, find successive swing highs and the following swing lows (pivots confirmed kk days later). Let the pullback depths be c1,c2,…,cJc_1,c_2,\dots,c_J with J∈{2,…,6}J\in\{2,\dots,6\}. Require cj+1<cjc_{j+1}<c_j for all jj (for example 25%, 15%, 8%, 3%), and the 10-day average volume in the last contraction below its 50-day average ("volume dry-up"). Entry: a close above the last swing high (the pivot) with RVOL≥1.5\mathrm{RVOL}\ge1.5. Stop: below the last contraction's low, typically within 10%.

4.2.3O'Neil's CAN SLIM#

William O'Neil (How to Make Money in Stocks, 4th ed., 2009) combines fundamentals and price:

Letter Rule (thresholds as restated; see the source table above) Codable from prices? Data needed for a backtest
C Current quarterly EPS up ≥ ~25% year on year No Point-in-time quarterly EPS with announcement dates
A Annual EPS growth ≥ ~25% for 3 years, ROE ≥ ~17% No Point-in-time annual statements
N New product/management/high; breakout from a proper base Partly (new high, base) Prices
S Volume ≥ 40–50% above average on breakout Yes: RVOL≥1.4\mathrm{RVOL}\ge1.4–1.51.5 Volume
L Leader: RS rating ≥ 80 Yes (RS percentile) Universe returns
I Rising institutional sponsorship No Quarterly shareholding pattern (in India, filed with the exchanges)
M Market in a confirmed uptrend Yes, as a regime filter Index prices

Definition 4.8market regime filter

A simple codable "M": the benchmark index (Nifty 50 or Nifty 500) is above its 200-day SMA and the 200-day SMA is rising. O'Neil's own version counts "distribution days" (index down on higher volume) and waits for a "follow-through day". Both are functions of index bars.

Exits: cut every loss at 7–8% below the buy point with no averaging down; take most profits at 20–25%, except hold a stock that rises 20% within three weeks for at least eight weeks. Entry: at the pivot of a base such as a cup-with-handle, not more than 5% above the pivot.

4.2.4Darvas boxes#

Nicolas Darvas (How I Made $2,000,000 in the Stock Market, 1960) bought stocks making new highs on unusual volume.

Definition 4.9Darvas box, codable

After a new 52-week high at day uu, the box top is HuH_u if no later high exceeds it for three days (confirmed at u+3u+3). The box bottom is the lowest low after uu that holds for three days (confirmed three days after it is set). Buy when the close breaks above the confirmed top. Place the stop just below the box bottom, and trail it up as new boxes form above. Sell when price closes below the current box bottom.

Both confirmations are lags. A backtest that draws the box using days u+1..u+3u+1..u+3 and then "buys" at uu is using the future.

4.2.5The common archetype and its arithmetic#

All four methods reduce to one archetype: trade only uptrending leaders in a healthy market; enter on a breakout from a low-volatility base with volume; set the initial stop at the base low or about 7–8% below entry, which defines one unit of risk 1R1R (M03); and let winners run, so the average win is a multiple of 1R1R while the win rate is often 35–50%.

Proposition 4.5breakeven win rate with costs

Let each trade lose exactly 1R1R or win WRWR, with win probability pp, and let round-trip costs be cc (in units of RR). The expectancy is E=pW−(1−p)−cE=pW-(1-p)-c, and it is positive iff

p>p∗=1+c1+W.(4.5)p>p^*=\frac{1+c}{1+W}. \tag{4.5}
Proof

pW−(1−p)−c>0  ⟺  p(W+1)>1+cpW-(1-p)-c>0\iff p(W+1)>1+c.∎

Worked example 4.3Indian delivery costs on a 7% stop

Buy and sell ₹1,00,000 of a stock on delivery at a discount broker charging no delivery brokerage (statutory and exchange rates as of 6 Nov 2026, sources in M01 · 1.7 and Facts that change; set your own brokerage and DP charge): STT 0.1% on each side = ₹200; NSE transaction charges 0.00307% each side = ₹6.14; SEBI fee ₹10 per crore = ₹0.20; GST 18% of (transaction + SEBI) = ₹1.14; stamp duty 0.015% on the buy = ₹15; DP charge ₹15.34 on the sell. Total ₹237.82, or 0.238% round trip (11.9 bp per side). With a 7% stop, 1R=7%1R=7\% and c=0.238/7=0.034Rc=0.238/7=0.034R. Add slippage: a mid-cap breakout bought "at the pivot" is often filled 0.2–0.5% higher, which adds roughly another 0.03–0.07R. With W=2.5W=2.5: p∗=(1+0.034)/3.5=29.5%p^*=(1+0.034)/3.5=29.5\% before slippage. At p=40%p=40\%, expectancy is 0.4×2.5−0.6−0.034=0.366R0.4\times2.5-0.6-0.034=0.366R per trade. Costs are small for a swing trader with a 7% stop. They become decisive with a 1% stop (intraday, M05), where the same ₹238 is 0.24R0.24R.

The danger is not costs. It is that pp and WW are estimated from a few dozen trades chosen by the author. Proposition 4.4 and 4.5 tell you how wide the error bars are.

4.2.6Caveats specific to swing frameworks#

  • Selection by the author. Books show the trades that worked. A chart gallery of winners says nothing about pp. Only a mechanical screen run on a full point-in-time universe can estimate it.
  • Discretion. "Proper base", "tight", "constructive" are judgements. Code one version, then treat alternative codings as additional trials (4.6).
  • Universe and survivorship. Testing on today's Nifty 500 constituents over the last ten years includes only firms that survived and grew into the index. 4.4.3 quantifies the bias.
  • Gaps and price bands. Many Indian stocks without derivatives trade with daily price bands of 2%, 5%, 10% or 20% (stocks with F&O have dynamic bands instead). A stock that opens at its lower band may not trade at all, and a 7% stop then fills far below 7% or not at all. A backtest must fill stops at min⁡(Ot+1,stop)\min(O_{t+1},\text{stop}) and should model no-fill days.
  • Liquidity. Breakout rules drift toward small, illiquid stocks, where the quoted price is not the price you get (M05).
  • Regime dependence. All four methods are long momentum strategies. They inherit momentum's crash risk (4.3.4). The "M" filter is an attempt to time that risk.

Create a free account

Reading is open to everyone. An account keeps your progress, answers, notes and code drafts, and gives you the study plan, the journals and the simulator. Running code needs an account approved for it.