CSCheatsheets
Markets · trading

Technical Analysis

Market mechanics, Dow theory and stages, price action, candlesticks, chart patterns with Bulkowski statistics, indicators with Python code, Wyckoff and breadth, strategies, risk and position sizing, psychology, backtesting and algo trading.

16sections
101cards
12diagrams
0%known

00Technical analysis atlas: topics and routes

The whole sheet on one screen. Select an area or topic to jump to it, and hover diagram boxes for explanations. This is an educational reference, not investment advice.

How to use this sheet#

  1. Learning: read market mechanics, trend and cycles, then price action. Every indicator and pattern is a summary of price and volume, so these come first.
  2. Building a method: pick one strategy, one or two indicators, and the risk rules. Write them down as a trading plan.
  3. Before a trade: run the top-down flow below, size the position, then use the pre-trade checklist at the end.
  4. Improving: journal every trade, backtest rule changes, and change one thing at a time.
Educational, not investment advice. Built from personal study notes; trading carries a real risk of loss.

Top-down analysis flow#

flowchart TD
  HTF["Higher timeframe trend"] --> LVL["Key levels"]
  LVL --> REG["Regime: trend or range"]
  REG --> SET["Setup that fits the regime"]
  SET --> TRG["Entry trigger"]
  TRG --> RISK["Stop and position size"]
  RISK --> MAN["Manage: partials, trail"]
  MAN --> REV["Journal and review"]

Each step can veto the trade. If you cannot name the level, the stop or the size, there is no trade.

Check yourself 2 questions
  1. What comes right after the higher-timeframe trend?

    Show answer

    Marking the key levels.

  2. Why decide the regime before the setup?

    Show answer

    Trend and range need different setups and tools.

Takeaway Higher-timeframe trend, key levels, regime, a setup that fits, a trigger, stop and size, then manage.

The three questions behind every chart#

QuestionToolsWhere it's covered
Which way is the path of least resistance?Structure (HH/HL), moving averages, higher-timeframe trend, market stageTrend and cycles, price action
Where would I be wrong?Support and resistance, swing points, pattern boundaries, ATRPrice action, chart patterns, risk
Is the move supported?Volume, breadth, momentum divergence, intermarket confirmationIndicators, advanced
Check yourself 2 questions
  1. Which tools answer 'where would I be wrong?'

    Show answer

    Support and resistance and swing points: they place the stop.

  2. Which tools answer the direction question?

    Show answer

    Structure, moving averages, the higher-timeframe trend and market stage.

Takeaway Which way is least resistance, where would I be wrong, and is the reward worth the risk?

01Market mechanics: how price moves

TradingOverview/technical-analysis/handbook/01-market-basics

Price discovery and the order book#

  • Price is the last trade, not fair value. It moves when aggressive orders exhaust the liquidity resting at the best price.
  • Liquidity is the ability to trade size without moving price; thick books mean tight spreads and small slippage.
  • Order flow imbalance drives short-term moves: more market buys than resting asks lifts price.
Bids (buyers)        Asks (sellers)
100 @ 50.00          200 @ 50.01
300 @ 49.99          150 @ 50.02
500 @ 49.98          400 @ 50.03

Market buy 350 → 200 @ 50.01, 150 @ 50.02
Best ask is now 50.03: price moved 2 ticks.

This is why large orders are sliced (TWAP, VWAP algorithms) and why a thin book lets one order spike price.

Check yourself 2 questions
  1. What makes price move?

    Show answer

    Aggressive orders exhausting the liquidity resting at the best price.

  2. What does a thick order book give you?

    Show answer

    Tight spreads and small slippage.

Takeaway Price is the last trade, not fair value; it moves when aggressive orders exhaust the liquidity at the best price.

Who is on the other side#

ParticipantGoalFootprint on the chart
RetailProfit from movesSmall size; reactive to news, patterns, social media
Institutions (funds)Long-term returns vs a benchmarkSteady accumulation or distribution over days; volume at key levels
Market makersEarn the spreadQuote both sides; widen or pull quotes in stress
HFT / algosArbitrage, rebates, speedTight spreads in calm markets; liquidity vanishes in shocks
HedgersOffset business riskLarge, price-insensitive flow
Central banksPolicy goalsRare, overwhelming moves in rates and FX
Check yourself 2 questions
  1. What's the chart footprint of institutional buying?

    Show answer

    Steady accumulation over days, with volume at key levels.

  2. How does retail typically trade?

    Show answer

    Small size, reacting to news, patterns and social media.

Takeaway Retail reacts, institutions accumulate or distribute over days, and market makers and algos provide liquidity.

Bid, ask, spread and slippage#

  • Bid = best price buyers pay; ask = best price sellers accept; spread = ask − bid, the cost of an instant round trip.
  • Slippage = fill worse than the quote, from thin size at the quote, fast markets or a large order.
  • Spreads widen with low volume, news, small caps, exotic pairs and off-hours.
  • Budget at least half the spread on entry and exit; scalping in wide-spread names can erase the whole edge.
Check yourself 2 questions
  1. Define the spread.

    Show answer

    Ask − bid: the cost of buying and instantly selling.

  2. Name two causes of slippage.

    Show answer

    Any two of: thin size at the quote, fast markets, a large order.

Takeaway The spread is the cost of an instant round trip; slippage is a fill worse than the quote, and both widen in thin or fast markets.

Order types#

TypeFillsUseRisk
MarketNow, at best availableSpeed matters more than priceSlippage in thin or fast markets
LimitAt your price or betterEntries at levels, exits at targetsMay never fill
Stop (stop-market)Becomes a market order at the triggerStop-losses, breakout entriesGaps fill far beyond the stop
Stop-limitBecomes a limit order at the triggerTrigger with a price capNo fill in a gap, so you stay in the loser
Bracket / OCOEntry plus linked stop and targetAutomating exitsCheck broker support for gaps
Check yourself 2 questions
  1. What's the risk of a limit order?

    Show answer

    It may never fill.

  2. What does a stop-market order become when triggered?

    Show answer

    A market order.

Takeaway Market for speed, limit for price, stop to force an exit, stop-limit for a price floor that may not fill.

Sessions and timing#

MarketHoursBehaviour
India (NSE/BSE cash)09:15–15:30 IST, pre-open 09:00–09:15Opening gap and first 15–30 minutes are noisy; closing auction volume
US equities09:30–16:00 ETOpen and close carry most volume; midday drift
FX London~07:00–16:00 UTCMost FX volume; EUR and GBP pairs
FX New York~13:00–22:00 UTCLondon overlap 13:00–16:00 UTC is the most liquid window
Crypto24/7Liquidity still clusters around equity sessions; weekend wicks

Mark the open, prior high and low, and VWAP intraday. Size down or stand aside in thin hours and before scheduled news.

Check yourself 2 questions
  1. Indian cash market hours?

    Show answer

    9:15 am to 3:30 pm IST, with pre-open from 9:00.

  2. When do US equities trade most volume?

    Show answer

    At the open and close.

Takeaway Opens and closes carry the most volume; India's first 15–30 minutes are noisy.

Microstructure in one card#

  • Price-time priority: best price fills first; at the same price, earlier orders fill first.
  • Maker vs taker: limit orders that rest add liquidity (often cheaper); market orders take it.
  • Gaps form when news arrives while the market is closed; stops can fill far away.
  • Venues: exchanges (central order book), ECNs, OTC dealers, dark pools for block trades.
  • Your edge as a retail trader is in setup selection and risk control, not speed.
Check yourself 2 questions
  1. Price-time priority means what?

    Show answer

    Best price fills first; at the same price, earlier orders first.

  2. Maker versus taker?

    Show answer

    Makers rest limit orders and add liquidity; takers hit them with market orders.

Takeaway Price-time priority, makers add liquidity, takers remove it, and gaps form while the market is closed.

India market specifics#

RuleDetail
SettlementT+1 for cash equities
Pre-open09:00–09:15: orders 09:00–09:08, call-auction matching sets the open
Official close (NSE)Not the last trade. From 3 Aug 2026, stocks with derivatives close through a closing auction (continuous trading stops 15:15; matching by 15:35 within ±3% of the 15:00–15:15 VWAP). Other stocks: volume-weighted average of the last 30 minutes. From 7 Dec 2026 the auction moves to 15:30–15:40 (continuous trading to 15:30, reference = 15:15–15:30 VWAP)
Stock price bands2%, 5%, 10% or 20% daily circuits for non-F&O stocks; F&O stocks have wider dynamic bands
Market-wide circuit breakers10%, 15% and 20% moves in Nifty 50 or Sensex halt trading
F&O banStock over 95% of market-wide position limit: no fresh positions
CostsBrokerage, STT, exchange fees, GST, stamp duty; intraday and F&O costs add up fast

Circuits matter for stops: a stock locked at its lower circuit cannot be sold, so size small in names with tight bands.

Check yourself 2 questions
  1. Settlement cycle for Indian cash equities?

    Show answer

    T+1.

  2. Is NSE's official close the last trade?

    Show answer

    No; it's a VWAP or, for F&O stocks from August 2026, a closing auction.

Takeaway T+1 settlement, a 9:00–9:15 pre-open call auction, and an official close that isn't simply the last trade.

Asset classes compared#

MarketHoursTypical leverageMain driversChart quirks
EquitiesExchange sessionLow to moderate (margin)Earnings, sector rotation, macroOvernight gaps; VWAP and session levels matter
Index futures and optionsExtended sessionsHighMacro, flows, volatilityExpiry effects, open interest
Forex24/5HighRate differentials, central banksSession ranges; round numbers
CommoditiesSessions plus electronicModerate to highSupply and demand, USD, real yieldsContract rolls; seasonality
Crypto24/7Very highSentiment, flows, regulationLarge wicks; thin weekend books
Check yourself 2 questions
  1. Which chart quirk matters most for equities?

    Show answer

    Overnight gaps.

  2. Which market drivers matter for equities?

    Show answer

    Earnings, sector rotation and macro.

Takeaway Equities gap overnight, futures and options carry leverage and expiries, FX trades nearly round the clock.

02Trend, Dow theory and market cycles

TradingOverview/technical-analysis/book-summary (Technical Analysis Explained, Technical Analysis of the Futures Markets, Multiple Timeframes)

Dow theory: six tenets#

  1. The averages discount everything: all known information is in the price.
  2. Three movements: primary trend (1+ years), secondary reactions (weeks to months, retracing about a third to two thirds), minor moves (days).
  3. Primary trends have three phases: accumulation, public participation, excess (and distribution, public selling, panic in bear markets).
  4. Averages must confirm each other (originally Industrials and Transports).
  5. Volume confirms the trend: it expands in the direction of the primary trend.
  6. A trend persists until a clear reversal (a failed swing that breaks the sequence of highs and lows).
Check yourself 2 questions
  1. How much does a secondary reaction usually retrace?

    Show answer

    About a third to two-thirds.

  2. How long does a primary trend last?

    Show answer

    A year or more.

Takeaway The averages discount everything, three movements run at once, primary trends have phases, averages and volume must confirm.

The four stages of a stock#

StageLooks likeAction
1 Accumulation (base)Sideways after a decline; flat 30-week MA; volume dries upWatch; buy the breakout from the base
2 Markup (advance)Higher highs and lows; rising MA; volume on up movesHold and add on pullbacks
3 Distribution (top)Sideways after an advance; MA flattens; wide swingsTighten stops, take profits
4 Markdown (decline)Lower highs and lows; falling MAAvoid longs; short or stay out

From Weinstein and Shannon. Most money is made in stage 2; most losses come from buying stage 4 because it "looks cheap".

Check yourself 2 questions
  1. What does stage 1 look like?

    Show answer

    Sideways after a decline, a flat 30-week MA and drying volume.

  2. What do you do in stage 2?

    Show answer

    Hold and add on pullbacks.

Takeaway Accumulation, markup, distribution, markdown: buy breakouts from stage 1, hold stage 2, avoid 3 and 4.

Stage cycle#

flowchart TD
  S1["Stage 1: accumulation"] --> S2["Stage 2: markup"]
  S2 --> S3["Stage 3: distribution"]
  S3 --> S4["Stage 4: markdown"]
  S4 --> S1
Check yourself 2 questions
  1. Which stage follows distribution?

    Show answer

    Stage 4, markdown.

  2. Which stage follows markdown?

    Show answer

    Stage 1, accumulation.

Takeaway Stage 1 → 2 → 3 → 4 → back to 1.

Multiple-timeframe framework#

RoleSwing traderIntraday traderQuestion it answers
Trend (higher)WeeklyDaily / 1HWhich direction am I allowed to trade?
Setup (middle)Daily15mIs there a pullback or pattern at a level?
Trigger (lower)4H / 1H5m / 1mExactly where do I enter and put the stop?
  • Use a ratio of roughly 4–6× between timeframes.
  • Trade in the direction of the higher timeframe; a level visible on several timeframes is stronger.
Check yourself 2 questions
  1. Swing trader's trend timeframe?

    Show answer

    Weekly.

  2. What does the lowest timeframe decide?

    Show answer

    The exact entry trigger.

Takeaway The higher timeframe allows a direction, the middle finds the setup, the lower times the trigger.

Trend vs range: what changes#

Range (contraction)Trend (expansion)
StructureNo clean HH/HL or LH/LL; flat boundariesClear HH/HL or LH/LL
StrategyFade the edges or wait for a breakoutBuy pullbacks / sell rallies; break of structure
IndicatorsOscillators (RSI, Stochastic)MAs, ADX, trendlines
Main riskBreakout stops out the fadesLate entries, false breakouts
VolatilityContracting (squeeze)Expanding on impulse legs
Check yourself 2 questions
  1. Which indicators suit ranges?

    Show answer

    Oscillators such as RSI and stochastics.

  2. What structure defines a trend?

    Show answer

    Clear HH/HL or LH/LL sequences.

Takeaway Ranges call for fading edges and oscillators; trends for buying pullbacks, breaks of structure and trend tools.

Trend or range? A quick test#

Your trading timeframe
1Clear HH/HL or LH/LL sequence?
yes
Trendpullbacks, BOS entries, trail stops
no
2Price bouncing between flat levels?
yes
Rangefade edges with tight stops
no
3Bands or ATR contracting?
yes
Squeezewait for a breakout with volume
no
Chopstand aside or cut size
Check yourself 2 questions
  1. Bands and ATR contracting with no structure: what then?

    Show answer

    A squeeze: wait for a breakout.

  2. Price bouncing between flat levels: tactic?

    Show answer

    Fade the edges with tight stops.

Takeaway Clean structure means trend; flat levels mean range; contracting bands mean a squeeze.

03Price action: levels, trendlines and structure

TradingOverview/technical-analysis/handbook/02-price-action

Support and resistance#

  • Support: where buying has appeared before (prior lows, round numbers, volume nodes). Resistance: where selling has appeared.
  • Why levels work: memory, unfilled orders left behind, and attention on obvious numbers.
  • Strength: sharp reversals, high volume, several timeframes, and recent tests. Many tests can also exhaust a level.
  • Role reversal: broken resistance tends to become support, and broken support resistance.
  • Treat levels as zones, not exact prices.
Check yourself 2 questions
  1. Why do levels work?

    Show answer

    Memory, unfilled orders left behind, and attention on obvious numbers.

  2. Name two sources of support.

    Show answer

    Any two of: prior lows, round numbers, volume nodes.

Takeaway Levels work through memory, unfilled orders and attention; strength comes from sharp reversals, touches and volume.

Trendlines and channels#

  • Uptrend line joins higher lows; downtrend line joins lower highs. Two touches draw it, a third validates it.
  • Do not force lines through every wick. Steeper lines break sooner.
  • Channels: a parallel line through the opposite swings. Buy the lower rail, sell the upper, or trade a break with confirmation.
  • A break of a trendline signals the trend is weakening, not necessarily reversing.
  • Dynamic levels: 20/50/200 EMAs and VWAP act as moving support in uptrends.
Check yourself 2 questions
  1. What does an uptrend line connect?

    Show answer

    Higher lows.

  2. Why avoid forcing lines through every wick?

    Show answer

    It creates false precision; steeper forced lines break sooner.

Takeaway Two touches draw a line, a third validates it; steeper lines break sooner.

Market structure vocabulary#

TermMeaningUse
HH / HLHigher high / higher lowUptrend; buy pullbacks to the HL
LH / LLLower high / lower lowDowntrend; sell rallies to the LH
BOSBreak of structure: close beyond the last HH (or LL)Trend continuation or entry confirmation
MSS / CHoCHMarket structure shift / change of character: first LL in an uptrend (first HH in a downtrend)Early warning of reversal or a deeper pullback
Swing pointPivot with lower highs (or higher lows) on both sidesDefine consistently, e.g. 2–3 bars each side
Check yourself 2 questions
  1. What's a break of structure (BOS)?

    Show answer

    A close beyond the last higher high (or lower low).

  2. In an uptrend, where do you buy?

    Show answer

    Pullbacks to the higher low.

Takeaway HH/HL is an uptrend, LH/LL a downtrend; BOS continues the trend, CHoCH warns of a change.

Liquidity grabs and stop hunts#

  • Stops cluster just beyond obvious highs, lows and round numbers.
  • Price often sweeps those levels, triggers the stops, then reverses, leaving a long wick.
  • Setup: sweep below support, strong close back inside, then long with the stop below the wick.
  • Defence: place stops beyond the obvious level with a buffer (or use a close beyond the level as the exit).
  • Most "manipulation" is ordinary liquidity mechanics; plan for it instead of blaming it.
Check yourself 2 questions
  1. Where do stops cluster?

    Show answer

    Just beyond obvious highs, lows and round numbers.

  2. Describe the sweep long setup.

    Show answer

    A sweep below support, a strong close back inside, then long with the stop beyond the wick.

Takeaway Price often sweeps stop clusters beyond obvious levels, then reverses, leaving a long wick.

Price-action entries and exits#

SituationEntryStopTarget
Long at supportBullish candle at the level; enter over its highBelow the level (with buffer)Next resistance or 1:2
Short at resistanceBearish rejection; enter under its lowAbove the levelNext support
BreakoutClose beyond the level, or the retestBack inside the rangeRange height projected
Trend pullbackRejection at the HL, trendline or EMABelow the HLPrior high, then trail
After bearish MSSRetest of broken HL from belowAbove the MSS highNext support / LL
Liquidity sweepClose back inside after the wickBeyond the wickOpposite side of the range
Check yourself 2 questions
  1. Long at support: where's the entry?

    Show answer

    Over the high of a bullish candle at the level.

  2. Where does the stop go?

    Show answer

    Below the level, with a buffer.

Takeaway Enter on a confirming candle at the level, stop beyond it with a buffer, target the next level or 1:2.

04Candlesticks: anatomy, patterns and context

TradingOverview/technical-analysis/handbook/03-candlestick-analysis · book-summary/japanese-candlestick-charting-techniques (Nison)

Candle anatomy and psychology#

  • Body = open to close; green or white when close > open. Body size shows conviction.
  • Upper wick = high − max(open, close): sellers rejected higher prices.
  • Lower wick = min(open, close) − low: buyers rejected lower prices.
  • Close near the high = buyers in control; close near the low = sellers in control.
  • Small body (doji-like) = indecision. It matters only after a strong move or at a level.
close location = (close − low) ÷ (high − low)1 = closed on the high · 0 = closed on the low
Check yourself 2 questions
  1. Upper wick formula?

    Show answer

    High − max(open, close).

  2. A long lower wick shows what?

    Show answer

    Buyers rejected lower prices.

Takeaway Body shows conviction, upper wicks rejected highs, lower wicks rejected lows, and the close location tells who won.

Context beats the pattern#

  • Level: a hammer at support or a higher low means far more than one mid-range.
  • Trend: a reversal candle against the higher-timeframe trend is a lower-odds trade.
  • Volume: above-average volume on the signal candle adds conviction.
  • Sequence: a doji after three large down candles at support is exhaustion; after one candle it is noise.
  • Confirmation: wait for the next candle to close in the signal's direction before entering.
Check yourself 2 questions
  1. A hammer mid-range versus at support: which matters?

    Show answer

    At support (or a higher low).

  2. How does volume change a signal candle?

    Show answer

    Above-average volume adds conviction.

Takeaway Level, trend, volume and sequence decide whether a candle pattern means anything.

Single-candle patterns#

PatternShapeWhere it countsBiasEntry and stop
DojiOpen ≈ close; wicks varyAfter a strong move, at S/RIndecision; reversal only if confirmedTrade the next candle's break; stop beyond the doji
HammerSmall body at top, lower wick ≥ 2× body, tiny upper wickAfter a decline, at supportBullishBuy over the high; stop under the low
Hanging manHammer shapeAfter a rally, at resistanceBearish warningSell under the low; stop over the high
Inverted hammerSmall body at bottom, long upper wickAfter a declineBullish if confirmedBuy over the high; stop under the low
Shooting starInverted-hammer shapeAfter a rally, at resistanceBearishSell under the low; stop over the high
MarubozuFull body, no wicksBreakouts, trend legsDirection of the bodyMomentum confirmation; stop beyond the candle
Spinning topSmall body, wicks both sidesAfter a runLoss of momentumNot a trigger on its own
Check yourself 2 questions
  1. Is a doji a reversal signal on its own?

    Show answer

    No; indecision, a reversal only if confirmed.

  2. How do you trade a doji?

    Show answer

    On the next candle's break, stop beyond the doji.

Takeaway Doji, hammer, shooting star and marubozu: trade the next candle's break with the stop beyond the pattern.

Two-candle patterns#

PatternRuleBias
Bullish engulfingBullish body fully engulfs the prior bearish bodyBullish
Bearish engulfingBearish body fully engulfs the prior bullish bodyBearish
Piercing lineGaps down, closes above the midpoint of the prior red bodyBullish (weaker than engulfing)
Dark cloud coverGaps up, closes below the midpoint of the prior green bodyBearish
Tweezer top / bottomTwo candles with matching highs (lows)Bearish / bullish at S/R
HaramiSmall body inside the prior large body ("pregnant")Trend pausing; reversal if confirmed
Harami crossHarami whose second candle is a dojiStronger than a plain harami
Counterattack linesOpposite colours closing at the same priceReversal; weaker than engulfing
Check yourself 2 questions
  1. Define a bullish engulfing.

    Show answer

    A bullish body fully engulfing the prior bearish body.

  2. Piercing line rule?

    Show answer

    Gaps down, then closes above the midpoint of the prior bearish candle.

Takeaway Engulfing, piercing, dark cloud, harami and tweezers: a second candle that overrides the first.

Three-candle patterns#

PatternSequenceBias
Morning starLarge red, small body (gap), large green closing past the midpoint of candle 1Bullish
Evening starLarge green, small body, large red into candle 1's bodyBearish
Abandoned babyStar is a doji gapped away on both sidesRare, strong reversal
Three white soldiersThree greens, each opening in the prior body and closing near its highBullish
Three black crowsThree reds, each closing lower near its lowBearish
Inside barHigh and low inside the prior ("mother") barCoil; trade the break of the mother bar
Outside barRange engulfs the prior barDirection of the close
Check yourself 2 questions
  1. Morning star sequence?

    Show answer

    Large red, small-bodied star, then large green closing past candle 1's midpoint.

  2. What makes an abandoned baby?

    Show answer

    A doji star gapped away on both sides.

Takeaway Morning and evening stars, abandoned babies, three soldiers and crows add confirmation across three bars.

Nison's extra patterns#

  • Belt-hold: opens on its extreme and runs the other way (bullish opens on the low); stronger the longer the body.
  • Upside-gap two crows: after a rally, a small red gaps up and a second red engulfs it but stays above the first candle; bearish.
  • Tasuki gaps: a gap in the trend direction, then a counter candle that does not close the gap; continuation.
  • Rising / falling three methods: a long candle, three small counter candles inside its range, then a long candle to a new close; continuation.
  • Doji family: long-legged (big wicks both sides), gravestone (open = close = low; bearish at tops), dragonfly (open = close = high; bullish at bottoms), four-price (no range; illiquid).
  • Nison's rule: candles give early warnings, Western tools give targets. Pair a candle with a trendline, MA or level.
Check yourself 2 questions
  1. What is a bullish belt-hold?

    Show answer

    A candle opening on its low and running up.

  2. Where does upside-gap two crows appear?

    Show answer

    After a rally; bearish.

Takeaway Belt-holds, upside-gap two crows and other Nison patterns refine the main set.

Should I trade this candle?#

Candle signal on your chart
1At a level you marked before the candle formed?
no
Skipa pattern in the middle of a range is noise
yes
2Agrees with the higher-timeframe trend?
no
Counter-trendhalf size and wait for a confirming close
yes
3Volume or range above average?
no
Waitlet the next candle confirm
yes
4Stop beyond the candle still gives at least 1 to 2?
yes
Tradeenter past the extreme, stop beyond the other end
no
Passthe reward does not pay for the risk
Check yourself 2 questions
  1. A pattern in the middle of a range: trade it?

    Show answer

    Skip it: noise.

  2. Counter-trend candle: how do you handle it?

    Show answer

    Half size, and wait for a confirming close.

Takeaway Trade candles only at pre-marked levels, with the higher-timeframe trend, with a defined stop.

05Chart patterns: reversals, continuations and breakouts

TradingOverview/technical-analysis/handbook/04-chart-patterns · patterns-cheat-sheet · book-summary/encyclopedia-of-chart-patterns (Bulkowski)

Reversal patterns#

PatternShapeConfirms onMeasured targetStopVolume tell
Head and shoulders topThree peaks, middle highest; neckline through the two lowsClose below the necklineHead-to-neckline height, projected downAbove the right shoulderHeavier on the left shoulder, light on the right, expands on the break
Inverse H&SThree troughs, middle lowestClose above the necklineHeight projected upBelow the right shoulderExpands on the breakout
Double topTwo similar highs ("M")Close below the middle lowTop-to-valley height, downAbove the topsLower on the second peak
Double bottomTwo similar lows ("W")Close above the middle highHeight, upBelow the bottomsHigher on the breakout
Triple top / bottomThree tests of one levelBreak of the swing low (high)HeightBeyond the patternConfirm with breakout volume
Rounding bottom (saucer)Slow U-shaped turnClose above the rimDepth, upBelow the low or the last pullbackU-shaped volume too
Rising wedgeConverging lines both risingBreak below the lower lineBack to the wedge startAbove the wedge highShrinks into the apex
Falling wedgeConverging lines both fallingBreak above the upper lineBack to the wedge startBelow the wedge lowExpands on the break
Check yourself 2 questions
  1. Head and shoulders target?

    Show answer

    Head-to-neckline height projected down from the neckline.

  2. Where's the stop on a head and shoulders short?

    Show answer

    Above the right shoulder.

Takeaway Head and shoulders, double and triple tops and bottoms confirm on a neckline close, with height-based targets.

Continuation patterns#

PatternShapeTradeTargetNotes
Bull / bear flagSharp pole, then a small channel sloping against itBreak of the flag in the pole's directionPole length from the breakoutFlags longer than about 3 weeks underperform
PennantPole, then a small symmetrical triangleBreak in the pole's directionPole lengthShort (1–3 weeks); volume dries up inside
Ascending triangleFlat top, rising lowsClose above the flat topTriangle heightBuyers more aggressive each test
Descending triangleFlat bottom, falling highsClose below the flat bottomHeightBearish bias; can still break up
Symmetrical triangleConverging linesEither direction; usually with the prior trendWidest partBreakouts two-thirds to three-quarters of the way to the apex are best
RectangleFlat support and resistanceClose outside the boxBox heightFade the edges inside, trade the break outside
Cup and handleU-shaped cup, shallow handle in its upper halfBreak above the handle (rim)Cup depthO'Neil: cup 7–65 weeks, depth 12–33%, handle 1–2 weeks
Check yourself 2 questions
  1. Flag target?

    Show answer

    Pole length from the breakout.

  2. What happens to flags lasting longer than about 3 weeks?

    Show answer

    They underperform.

Takeaway Flags, pennants, triangles and rectangles usually continue the prior move; targets use the pole or height.

Breakout confirmation#

  1. Close beyond the level, not just a wick; wicks are often stop runs.
  2. Volume above average (≥ 1.5× the 50-day average is a common bar).
  3. Retest: broken resistance holds as support; entering there tightens the stop.
  4. Timeframe: a daily close outranks a 5-minute break.
  5. Invalidation: a close back inside the pattern means the breakout failed; exit or reverse.
Check yourself 2 questions
  1. Is a wick beyond resistance a breakout?

    Show answer

    No; wait for a close beyond it.

  2. Common volume bar for a valid breakout?

    Show answer

    At least 1.5× the 50-day average.

Takeaway Close beyond the level, volume at least 1.5× average, and ideally a retest that holds.

False breakouts#

  • Why: stops cluster beyond obvious levels; there is no follow-through; or the break shows only on a noisy timeframe.
  • Defend: wait for the close, put the stop beyond the level plus a buffer, enter half size and add on the retest.
  • Exploit: a failed break that closes back inside often runs to the other side of the range (Wyckoff spring or upthrust).
  • Bulkowski: about 2 in 3 breakouts throw back to the breakout level, so expect a retest rather than panicking.
Check yourself 2 questions
  1. How do you defend against false breakouts?

    Show answer

    Wait for the close, buffer the stop, enter half size and add on the retest.

  2. How can you exploit a failed breakout?

    Show answer

    Trade the reversal back inside the range.

Takeaway Stops beyond obvious levels and no follow-through create fakeouts; wait for closes, buffer stops, add on the retest.

Pattern statistics (Bulkowski, US stocks)#

Pattern (breakout)Average moveFailure rate*Throwback / pullbackComment
Cup with handle (up)+54% bull market5%62%Ranked 3rd of 39 in bull markets
Rounding bottom (up)+48% bull / +37% bear4% / 6%64%Ranked 1st of 20 in bear markets
Rectangle bottom (up)+48% bull15%—Down breakouts in bull markets bust 43% of the time
Head and shoulders bottom (up)+45% bull / +28% bear11% / 9%65%One of the most reliable reversals
Triple bottom (up)+46% bull / +27% bear13%65% within 12 days—
Adam & Eve double bottom (up)+42%12%67%48% of candidates never confirm: wait for the breakout
Falling wedge (up)+38% bull / +26% bear26%62%—
Descending triangle+38% up / −15% down (bull)——Breaks either way; wait for it
Symmetrical triangle (up)+34% bull / +26% bear25–37%62–65%Down breakouts −12% bull
Head and shoulders top (down)−24% bear / −16% bull5% / 19%68%Ranked 4th of 19 in bear markets
Rising wedge (down)−9% bull / −17% bear51% / 28%70–72%Poor in bull markets; take profits fast
Flag (up)+9% bullOnly 46% hit target67%Short-term trade, not a big mover
PennantContinues the trend 75–76% of the timeMisses target 54% bull / 40% bear—Measure rule works only 32–46%

*Failure = price moves less than 5% after the breakout. Historical base rates from US stocks; use them to set expectations, not as a promise for any one chart.

Check yourself 2 questions
  1. Average move of a cup with handle in bull markets?

    Show answer

    About +54%.

  2. Do these statistics apply directly to Indian stocks?

    Show answer

    Not necessarily; they're from US stocks.

Takeaway Bulkowski's US data ranks patterns: cup with handle and rounding bottoms rate highly, but throwbacks are common.

Gaps#

GapWhereMeaningFill tendency
Common / areaInside a range, low volumeNoise85–92% close within a week
BreakawayOut of a base or pattern, high volumeNew trend startingRarely closes soon (≈1% within a week)
Runaway (measuring)Mid-trendTrend accelerating; often near the halfway pointTakes months to fill, if ever
ExhaustionLate in a trend, climactic volumeLast burst before reversal60–75% close within a week
Island reversalGap, a few bars, opposite gapTrapped traders; strong reversal—
Check yourself 2 questions
  1. How often do common gaps close within a week?

    Show answer

    About 85–92%.

  2. Breakaway gaps close soon how often?

    Show answer

    Rarely, about 1% within a week.

Takeaway Common gaps fill fast, breakaway gaps rarely close soon, runaway gaps mark mid-trend, exhaustion gaps end moves.

Measuring targets#

H&S target = neckline − (head − neckline)flag target = breakout + flagpole lengthtriangle target = breakout ± widest heighthalf-height target ≈ hit far more often than full height
  • Bulkowski's Big W: full-height target hit 74% of the time in bull markets; half height 88%.
  • Take partial profits at half height and trail the rest.
  • Targets are guides; the next higher-timeframe level often stops price first.
Check yourself 2 questions
  1. Triangle target?

    Show answer

    Breakout ± the widest height.

  2. Which is hit more often, half or full height?

    Show answer

    Half height.

Takeaway Targets project the pattern's height; half-height targets are hit far more often than full height.

06Indicators: trend, momentum, volatility and volume

TradingOverview/technical-analysis/handbook/05-technical-indicators · indicators-quick-reference

Indicator quick reference#

IndicatorFamilyDefaultFormula sketchReadFails when
SMA / EMATrend20 / 50 / 200EMA = α·P + (1 − α)·EMA₋₁, α = 2/(N+1)Price above a rising MA = bullish; crossesRanges whipsaw crossovers
VWAPTrend / volumeSessionΣ(typical price × vol) / Σ volAbove = buyers in control intraday; institutional benchmarkResets daily; little use on daily charts
ADX / DMITrend strength14Smoothed |+DI − −DI| / (+DI + −DI)ADX above 25 = trending; below 20 = rangeSays nothing about direction
IchimokuTrend system9 / 26 / 52Tenkan, Kijun, cloud spans shifted +26, Chikou −26Price above the cloud = bullish; cloud = S/RChoppy markets; many lines
Parabolic SARTrailing stop0.02 step, 0.2 maxSAR += AF × (EP − SAR)Dots flip sides = trend changeRanges: constant flips
SupertrendTrailing stop10, 3(H+L)/2 ± 3 × ATR(10), ratchetedLine below price = long biasRanges; gaps through the line
RSIMomentum14100 − 100 / (1 + avg gain / avg loss)70 / 30 in ranges; 40–80 band in uptrendsStays overbought in strong trends
MACDMomentum / trend12, 26, 9EMA12 − EMA26; signal = EMA9; histogram = differenceSignal cross, zero line, divergenceLags; false crosses in chop
StochasticMomentum14, 3, 3%K = (C − L₁₄) / (H₁₄ − L₁₄) × 10080 / 20; %K/%D crossNoisy in trends
CCIMomentum20(TP − SMA) / (0.015 × mean deviation)±100 extremesUnbounded; trends
Rate of changeMomentum10–12(C / C₋ₙ − 1) × 100Zero-line cross, divergenceNo fixed extremes
Bollinger BandsVolatility20, 2SMA20 ± 2σSqueeze → expansion; walking the band = strong trendBand touch is not a signal alone
ATRVolatility14Wilder average of true rangeStops and sizing (1.5–3 × ATR)No direction
Keltner ChannelsVolatilityEMA20 ± 2 × ATR10ATR-based envelopeBollinger inside Keltner = squeeze (TTM)No direction
Donchian ChannelsBreakout20 / 55Highest high, lowest low of N barsTurtle breakout entries and exitsRanges
OBVVolume—± volume by close direction, cumulativeDivergence vs priceOnly the slope matters
A/D lineVolume—Σ ((C − L) − (H − C)) / (H − L) × volAccumulation or distributionIgnores gaps
MFIVolume momentum14RSI computed on typical price × volume80 / 20Same as RSI
Volume profileVolume at priceSession / rangeHistogram of volume by pricePOC, value area (70%), HVN/LVNNeeds good volume data
Anchored VWAPVolumeFrom an eventVWAP from a chosen barAverage cost of everyone since the eventAnchor choice is subjective
Check yourself 2 questions
  1. EMA smoothing factor?

    Show answer

    α = 2 ÷ (N + 1).

  2. When do moving average crossovers fail?

    Show answer

    In ranges: whipsaws.

Takeaway Know each indicator's family, default, formula, read and failure mode.

Which indicator for which job?#

What do you need the indicator to tell you?
1Need the trend direction?
yes
Moving averagesEMA 20/50, SMA 200, Ichimoku cloud
no
2Need to know whether there is a trend at all?
yes
ADXabove 25 trending, below 20 ranging
no
3Is the move stretched or tiring?
yes
OscillatorsRSI, Stochastic, divergences
no
4Need a stop distance and position size?
yes
ATRstop 1.5–3 × ATR, size from the stop
no
5Need to know if real money is behind the move?
yes
Volume toolsvolume vs average, OBV, VWAP, profile
no
Price action firstlevels and structure beat any indicator
Check yourself 2 questions
  1. Which indicator says whether there's a trend at all?

    Show answer

    ADX: above 25 trending, below 20 ranging.

  2. Which tools give direction?

    Show answer

    Moving averages and the Ichimoku cloud.

Takeaway Direction → moving averages; trend or not → ADX; momentum → RSI or MACD; volatility → ATR or bands; conviction → volume.

Divergences#

TypePriceOscillatorMeaning
Regular bullishLower lowHigher lowSelling momentum fading; possible reversal up
Regular bearishHigher highLower highBuying momentum fading; possible reversal down
Hidden bullishHigher lowLower lowUptrend continuation (pullback buy)
Hidden bearishLower highHigher highDowntrend continuation
  • Divergence is a warning, not a trigger: wait for a structure break or trendline break.
  • Strong trends can print several divergences before turning.
Check yourself 2 questions
  1. Regular bullish divergence?

    Show answer

    Price makes a lower low while the oscillator makes a higher low.

  2. What does hidden bullish divergence suggest?

    Show answer

    Trend continuation up.

Takeaway Regular divergence warns of reversal; hidden divergence signals trend continuation.

Moving-average playbook#

  • Trend filter: trade longs only above a rising 200-day SMA (the most watched line for stocks and indices).
  • Pullback zones: 20 EMA in strong trends, 50 in normal ones.
  • Golden cross (50 over 200) and death cross are slow regime markers, not entries.
  • Three-MA alignment (price > 20 > 50 > 200, all rising) is the textbook stage-2 picture.
  • EMAs react faster but whipsaw more; SMAs are slower but the 50/200-day lines are the market convention.
Check yourself 2 questions
  1. Pullback zone in a strong trend?

    Show answer

    The 20 EMA.

  2. What are golden and death crosses good for?

    Show answer

    Slow regime markers, not precise entries.

Takeaway Trade longs above a rising 200-day SMA, buy pullbacks to the 20 or 50 EMA, and treat crosses as slow regime markers.

RSI in context#

  • Range regime: RSI oscillates 30–70; fade the extremes at range edges.
  • Bull regime: RSI holds 40–80; dips to 40–50 are buyable pullbacks (Cardwell / Brown ranges).
  • Bear regime: RSI holds 20–60; rallies to 55–60 fail.
  • Failure swing: RSI breaks its own prior swing before price does.
  • RSI(2) below 10 in an uptrend is a classic short-term mean-reversion entry (Connors).
Check yourself 2 questions
  1. In a bull regime, where are RSI dips buyable?

    Show answer

    Around 40–50.

  2. In a bear regime, where do rallies usually fail?

    Show answer

    Around 55–60.

Takeaway RSI ranges shift with regime: 30–70 in ranges, 40–80 in bull trends, 20–60 in bear trends.

Volatility toolkit#

TR = max(H − L, |H − C₋₁|, |L − C₋₁|)ATR₁₄ = Wilder average of TR%B = (C − lower) / (upper − lower)bandwidth = (upper − lower) / middle
  • Squeeze: bandwidth at a 6-month low, or Bollinger inside Keltner, means a big move is coming; direction unknown.
  • Chandelier exit: highest high since entry − 3 × ATR.
  • Volatility contraction pattern (Minervini): successive pullbacks shrink, e.g. 25% → 15% → 8%, before a breakout.
Check yourself 2 questions
  1. True range formula?

    Show answer

    max(H − L, |H − prev C|, |L − prev C|).

  2. What signals a squeeze?

    Show answer

    Bandwidth at a six-month low, or Bollinger inside Keltner.

Takeaway True range, ATR, %B and bandwidth; a squeeze means a big move is coming, direction unknown.

Volume rules#

  • Volume confirms price: up moves on rising volume, pullbacks on falling volume = healthy trend.
  • Breakouts need volume (≥ 1.5× average); a breakout on light volume is suspect.
  • Climax volume after a long run often marks exhaustion.
  • Volume profile: price moves fast through low-volume nodes and stalls at high-volume nodes; the POC acts like a magnet.
  • Relative volume (today vs the same time on recent days) finds stocks in play intraday.
Check yourself 2 questions
  1. Healthy uptrend volume pattern?

    Show answer

    Rising on up moves, falling on pullbacks.

  2. A breakout on light volume is…?

    Show answer

    Suspect.

Takeaway Volume confirms healthy trends, breakouts need it, and climax volume after a long run often marks exhaustion.

Common indicator mistakes#

  • Stacking three momentum oscillators: they are the same information three times.
  • Selling "overbought" in a strong trend.
  • Optimising parameters until the backtest shines (curve fitting).
  • Ignoring the regime: trend tools in ranges and oscillators in trends.
  • Treating crossovers as entries without a level, stop or size.
  • Rule of thumb: one trend tool + one momentum or volume tool + ATR is enough.
Check yourself 2 questions
  1. Why is stacking three momentum oscillators a mistake?

    Show answer

    It's the same information three times.

  2. What is curve fitting?

    Show answer

    Optimising parameters until the backtest shines, which fails live.

Takeaway Stacking oscillators, selling overbought in trends, curve-fitting, and ignoring the regime.

Indicators in Python (pandas)#

import pandas as pd

def ema(s, n):
    return s.ewm(span=n, adjust=False).mean()

def rsi(close, n=14):
    d = close.diff()
    gain = d.clip(lower=0).ewm(alpha=1/n, adjust=False).mean()    # Wilder smoothing
    loss = (-d.clip(upper=0)).ewm(alpha=1/n, adjust=False).mean()
    return 100 - 100 / (1 + gain / loss)

def macd(close, fast=12, slow=26, signal=9):
    line = ema(close, fast) - ema(close, slow)
    sig = ema(line, signal)
    return line, sig, line - sig                                   # line, signal, histogram

def atr(high, low, close, n=14):
    prev = close.shift()
    tr = pd.concat([high - low, (high - prev).abs(), (low - prev).abs()], axis=1).max(axis=1)
    return tr.ewm(alpha=1/n, adjust=False).mean()

def bollinger(close, n=20, k=2):
    mid = close.rolling(n).mean()
    sd = close.rolling(n).std(ddof=0)                              # population std, as charting tools use
    return mid - k * sd, mid, mid + k * sd

def vwap(high, low, close, volume):                                # one session of intraday bars
    tp = (high + low + close) / 3
    return (tp * volume).cumsum() / volume.cumsum()

Checked against the ta library: MACD, Bollinger and VWAP match exactly; RSI and ATR match after the warm-up bars. Wilder smoothing is an EMA with α = 1/N.

Check yourself 2 questions
  1. pandas EMA one-liner?

    Show answer

    s.ewm(span=n, adjust=False).mean().

  2. What smoothing does RSI use?

    Show answer

    Wilder smoothing: ewm with alpha = 1/n.

Takeaway EMA via ewm(span=n), RSI with Wilder smoothing via ewm(alpha=1/n).

07Fibonacci, Elliott waves, point and figure

TradingOverview/technical-analysis/book-summary (Technical Analysis of the Futures Markets, Technical Analysis Explained, Encyclopedia of Chart Patterns)

Fibonacci retracements and extensions#

LevelUse
23.6%Shallow pullback in a very strong trend
38.2%Normal pullback in a strong trend
50%Not Fibonacci, but widely watched (Dow's half retracement)
61.8%Deep pullback; last line for the trend to stay intact
78.6%Very deep; harmonic patterns use it
127.2% / 161.8%Extension targets beyond the prior swing
retracement level = high − r × (high − low) (uptrend)extension target = low + e × (high − low)

Draw from swing low to swing high in an uptrend. Levels work best where they coincide with prior S/R, a moving average or a trendline (confluence).

Check yourself 2 questions
  1. Which retracement suits a very strong trend?

    Show answer

    23.6% to 38.2%.

  2. What does a break of 61.8% suggest?

    Show answer

    The trend may not stay intact.

Takeaway 38.2% for strong trends, 61.8% as the last line, 50% widely watched though not Fibonacci.

Elliott wave basics#

  • Impulse: 5 waves with the trend (1-2-3-4-5), then a correction of 3 waves (A-B-C).
  • Hard rules: wave 2 never retraces beyond the start of wave 1; wave 3 is never the shortest; wave 4 does not overlap wave 1's price territory.
  • Guidelines: wave 3 is often 1.618 × wave 1; waves 2 and 4 alternate (sharp vs sideways); wave 5 often equals wave 1.
  • Corrections: zigzag (5-3-5, sharp), flat (3-3-5, sideways), triangle (3-3-3-3-3).
  • Typical retracements: wave 2 retraces 50–62%, wave 4 about 38%.
  • Useful as a map of where you are in a trend; counts are subjective, so trade the invalidation levels.
Check yourself 2 questions
  1. Name the three hard rules.

    Show answer

    Wave 2 never retraces beyond wave 1's start; wave 3 is never the shortest; wave 4 doesn't overlap wave 1.

  2. How many waves in a correction?

    Show answer

    Three: A-B-C.

Takeaway Five impulse waves, three corrective; wave 2 never passes wave 1's start, wave 3 is never shortest, wave 4 doesn't overlap wave 1.

Elliott wave cycle#

flowchart TD
  W1["Wave 1: early buyers"] --> W2["Wave 2: retrace 50–62%"]
  W2 --> W3["Wave 3: longest, strongest"]
  W3 --> W4["Wave 4: shallow, sideways"]
  W4 --> W5["Wave 5: final push, divergence"]
  W5 --> WA["Wave A: first drop"]
  WA --> WB["Wave B: bull trap"]
  WB --> WC["Wave C: completes correction"]
Check yourself 2 questions
  1. Typical retrace of wave 2?

    Show answer

    50–62%.

  2. Which wave often shows divergence?

    Show answer

    Wave 5.

Takeaway Wave 3 is the longest and strongest; wave 5 is the final push, often with divergence.

Point and figure charts#

  • Plot only price: X columns for rises, O columns for falls. Time and small moves are ignored.
  • Box size sets the minimum move counted (e.g. ₹1 for a ₹100 stock, or ATR-based).
  • 3-box reversal: a new column starts only after a reversal of three boxes.
  • Double-top buy: an X column exceeds the prior X column. Double-bottom sell: an O column breaks the prior O column.
  • Count method: width of a congestion area × box size × reversal gives a price target.
  • Great for clean S/R and trendlines (45° lines) without noise.
Check yourself 2 questions
  1. What does P&F ignore?

    Show answer

    Time and small moves.

  2. When does a new column start?

    Show answer

    After a reversal of three boxes.

Takeaway Point and figure plots only price in X and O columns, ignoring time; box size and a 3-box reversal set sensitivity.

Futures-specific signals (Murphy)#

PriceVolumeOpen interestRead
UpUpUpStrong: new longs entering
UpDownDownWeak: short covering rally
DownUpUpStrong: new shorts entering
DownDownDownWeak: long liquidation, may be near a low

COT report: commercials (hedgers) are the "smart money" at extremes; large speculators are trend followers who are most crowded at turns.

India: NSE publishes F&O open interest and participant-wise OI (FII, DII, pro, client) daily.

Check yourself 2 questions
  1. Price up, volume and OI down?

    Show answer

    Weak: a short-covering rally.

  2. Price down, volume and OI up?

    Show answer

    Strong: new shorts entering.

Takeaway Price, volume and open interest together separate strong new positioning from weak covering or liquidation.

Other classic tools#

  • Pivot points: P = (H + L + C) / 3; R1 = 2P − L; S1 = 2P − H. Intraday levels many traders watch.
  • Heikin-Ashi: averaged candles that smooth trends; not real prices, so do not place orders from them.
  • Renko: fixed-size bricks, time ignored; clean trends, but late signals.
  • Seasonality and cycles: presidential cycle, "sell in May", Diwali / budget effects in India; weak alone, useful as a tie-breaker.
  • Market profile (TPO): time spent at each price; value area and initial balance.
Check yourself 2 questions
  1. Pivot point formula?

    Show answer

    P = (H + L + C) ÷ 3.

  2. Why not place orders from Heikin-Ashi prices?

    Show answer

    They're averaged, not real prices.

Takeaway Pivot points, Heikin-Ashi, Renko and others; Heikin-Ashi candles aren't real prices.

08Advanced: smart money, Wyckoff, intermarket and breadth

TradingOverview/technical-analysis/handbook/06-advanced-concepts · book-summary/technical-analysis-explained (Pring)

Smart money concepts (SMC)#

ConceptDefinitionHow it is traded
Order blockLast opposite candle before a strong impulsive moveEnter on the retest of that candle's range; stop beyond it
Fair value gap (FVG)Three-candle imbalance: candle 1 and candle 3 ranges do not overlapPrice often returns to fill it; enter in the trend direction inside the gap
Liquidity poolEqual highs or lows where stops clusterWait for the sweep and a close back inside, then trade the reversal
BOS / CHoCHBreak of structure (continuation) / change of character (first counter break)CHoCH is the condition before looking for reversal entries
Premium / discountAbove or below the 50% level of the current swingBuy in discount, sell in premium

SMC renames classic ideas (supply and demand zones, gaps, stop runs). Judge it by the same rules: level, confirmation, stop, size.

Check yourself 2 questions
  1. What is an order block?

    Show answer

    The last opposite candle before a strong impulsive move.

  2. Define a fair value gap.

    Show answer

    A three-candle imbalance where candle 1 and candle 3's ranges don't overlap.

Takeaway Order blocks, fair value gaps and liquidity sweeps describe where large players left footprints; trade their retests with stops beyond.

Wyckoff accumulation sequence#

flowchart TD
  PS["Preliminary support"] --> SC["Selling climax"]
  SC --> AR["Automatic rally"]
  AR --> ST["Secondary test"]
  ST --> SP["Spring"]
  SP --> SOS["Sign of strength"]
  SOS --> LPS["Last point of support"]
  LPS --> MU["Markup"]

Distribution mirrors it: preliminary supply, buying climax, automatic reaction, secondary test, upthrust, sign of weakness, last point of supply, markdown.

Check yourself 2 questions
  1. What is the spring in Wyckoff accumulation?

    Show answer

    A shakeout below the range that quickly reverses.

  2. What follows the last point of support?

    Show answer

    Markup.

Takeaway Preliminary support, selling climax, automatic rally, secondary test, spring, sign of strength, last point of support, markup.

Wyckoff in practice#

  • Three laws: supply and demand (price), cause and effect (the length of the range sets the size of the move), effort vs result (volume vs price progress).
  • Phases A–E: A stops the prior trend, B builds the cause, C tests (spring or upthrust), D shows strength or weakness, E is the trend out of the range.
  • Spring trade: long after the false break below the range closes back inside; stop under the spring low; target the range top, then the measured cause.
  • Upthrust trade: the mirror image at the top of a distribution range.
  • Effort vs result: heavy volume with little price progress means the other side is absorbing.
Check yourself 2 questions
  1. Wyckoff's cause and effect law?

    Show answer

    The length of the range (cause) sets the size of the move (effect).

  2. What does effort versus result compare?

    Show answer

    Volume against price progress.

Takeaway Three laws: supply and demand, cause and effect, effort versus result; phases A to E.

Intermarket relationships#

RelationshipUsual directionUse
Bond yields vs equity valuationsInverse (higher yields compress P/E, esp. growth)Yields breaking out = headwind for long-duration stocks
US dollar (DXY) vs commoditiesInverseGold or oil breakout fighting a rising DXY is weaker
Gold vs real yieldsInverseFalling real yields support gold
Copper vs growthSame direction ("Dr Copper")Equities rising while copper falls is a warning
High-yield credit spreads vs stocksInverseWidening spreads often lead equity corrections
2Y–10Y curveInversion precedes recessions (6–24 months)Re-steepening after inversion is the late, risky stage
AUD/JPY, CAD/JPYRise in risk-onQuick risk-appetite gauge

India: watch the 10-year G-sec yield, USD/INR, crude oil (India imports most of its oil) and FII flows alongside the Nifty.

Check yourself 2 questions
  1. Bond yields breaking out: good or bad for long-duration growth stocks?

    Show answer

    Bad: higher yields compress P/E.

  2. Usual relationship between the US dollar and commodities?

    Show answer

    Inverse.

Takeaway Higher yields compress valuations, a strong dollar weighs on commodities; intermarket breaks give early warnings.

Breadth indicators#

IndicatorFormulaSignal
Advance–decline lineCumulative (advances − declines)Index new high without A/D new high = narrow, fragile rally
McClellan Oscillator19-day EMA − 39-day EMA of net advancesExtremes beyond about ±70 to ±100 = stretched breadth
New highs − new lows52-week highs minus lowsShrinking new highs in a rising market = distribution
% above 200-day MAShare of index members above their 200-DMAAbove 70% strong; below 20–30% washed out
Arms index (TRIN)(adv / dec) ÷ (adv vol / dec vol)Above 1 bearish intraday; very high readings near capitulation
Check yourself 2 questions
  1. Advance–decline line formula?

    Show answer

    Cumulative (advances − declines).

  2. Index makes a new high but the A/D line doesn't. Read?

    Show answer

    A narrow, fragile rally.

Takeaway Breadth checks how many stocks join a move; an index high without an A/D high is a narrow, fragile rally.

Sentiment (contrarian at extremes)#

  • Put/call ratio: very high = fear (bullish contrarian); very low = complacency.
  • Volatility index: VIX or India VIX spikes mark panic lows more reliably than they mark tops.
  • Surveys: AAII bulls vs bears; extreme readings are contrarian.
  • Insider buying: clusters of insider purchases are more informative than sales.
  • Margin debt and IPO frenzy rise into tops.
  • Dow Theory and O'Neil: a follow-through day (a big index gain on higher volume, usually 4–10 days after a low) confirms a new uptrend; 4–5 distribution days (index down on higher volume) within a few weeks warn of a top.
Check yourself 2 questions
  1. Very high put/call ratio: contrarian read?

    Show answer

    Fear, which is contrarian bullish.

  2. Do VIX spikes mark tops or bottoms more reliably?

    Show answer

    Panic lows.

Takeaway Sentiment works contrarian at extremes: very high put/call or VIX spikes mark fear lows.

Relative strength#

  • RS line = stock ÷ index. A rising RS line means the stock is beating the market, even in a falling market.
  • RS line at a new high before price is one of the strongest leadership tells (O'Neil, Minervini).
  • Mansfield RS = (RS ÷ 52-week average of RS − 1) × 100; above zero = outperforming.
  • RS rating (1–99 percentile of 12-month performance): leaders usually rate 80–90+.
  • Relative rotation graphs place sectors in leading, weakening, lagging and improving quadrants.
  • Top-down: strong market → strong sector → strongest stocks in that sector.
Check yourself 2 questions
  1. What does a rising RS line in a falling market mean?

    Show answer

    The stock is beating the market.

  2. Strongest RS leadership tell?

    Show answer

    The RS line making a new high before price does.

Takeaway RS line = stock ÷ index; an RS high before a price high is a strong leadership tell.

India market data to watch#

DataWhereRead
India VIXNSERising sharply = fear; low and falling = calm trend
Nifty option chain PCR and max OI strikesNSE option chainBig put OI often acts as support, call OI as resistance near expiry
FII / DII cash flowsNSE daily provisional dataPersistent FII selling with DII buying = tug of war
Participant-wise F&O OINSE daily reportsFII index futures long/short ratio as a positioning gauge
Delivery %NSE security-wise delivery dataHigh delivery on up days = genuine buying, not intraday churn
F&O ban listNSE (stocks over 95% of market-wide position limit)No fresh positions; expect erratic moves
Check yourself 2 questions
  1. Near expiry, what does big put OI at a strike often act as?

    Show answer

    Support.

  2. India VIX rising sharply signals what?

    Show answer

    Fear.

Takeaway India VIX, option-chain PCR and max OI strikes, FII/DII flows and breadth round out the Indian picture.

09Strategies and setups

TradingOverview/technical-analysis/handbook/07-trading-strategies · book-summary/how-to-make-money-in-stocks (O'Neil) · getting-started-in-technical-analysis (Schwager)

Strategy styles compared#

StyleHoldingChartsTypical win rateTypical R:RWorks inMain risk
ScalpingSeconds–minutes1m, 5m, tick60%+ needed1:0.5 – 1:1Liquid, active sessionsCosts and slippage eat the edge
Intraday momentumMinutes–hours5m, 15m45–55%1:1.5 – 1:2Stocks in play, news daysFakeouts at the open
SwingDays–weeksDaily, 4H40–55%1:2 – 1:3Trends and clean rangesOvernight gaps
PositionWeeks–monthsWeekly, daily35–50%1:3 – 1:5+Major trendsWide stops, regime change
Trend followingWeeks–monthsDaily35–45%2:1 – 5:1Trending marketsLong drawdowns in chop
Mean reversionHours–daysHourly, daily55–70%1:1 – 1:1.5RangesStrong trends ("oversold gets more oversold")
BreakoutDays–weeksDaily35–50%1:2+After contractionFalse breakouts
Check yourself 2 questions
  1. Main risk of scalping?

    Show answer

    Costs and slippage eating the edge.

  2. What win rate does scalping typically need?

    Show answer

    60% or more, with low reward to risk.

Takeaway Scalping, intraday momentum, swing, position and trend following trade off win rate, reward to risk and costs.

Setup library#

SetupContextTriggerStopExit
Trend pullbackHH/HL, price above rising 50-DMABullish candle at the 20/50 EMA or prior HL; buy over its highBelow the pullback lowPrior high, then trail swing lows
Base breakout5+ week base, tightening, volume drying upClose above the pivot on ≥ 1.5× volumeBelow the base or 7–8%20–25% or trail the 50-DMA
Failed breakdown (spring)Range or supportSweep below support, close back insideBelow the sweep lowRange top
Range fadeADX below 20, tested edgesRejection candle at the edgeBeyond the edgeMidpoint or opposite edge
Opening range breakoutStock in play, gap with newsBreak of the first 15- or 30-minute rangeOther side of the range or VWAP1–2R or end of day
VWAP reclaimIntraday uptrend that dippedClose back above VWAP with volumeBelow the reclaim lowDay high, then trail
RSI(2) pullbackPrice above the 200-DMARSI(2) below 10Time stop or wide stopClose above the 5-DMA
Donchian breakout (Turtle)Any trending marketNew 20- or 55-day high2 × ATR10- or 20-day low
Check yourself 2 questions
  1. Trend pullback trigger?

    Show answer

    A bullish candle at the 20/50 EMA or prior higher low; buy over its high.

  2. Where's the stop on a trend pullback?

    Show answer

    Below the pullback low.

Takeaway Each setup has context, trigger, stop and exit: trend pullbacks, base breakouts, range fades and more.

Which strategy fits right now?#

Read the regime on your trading timeframe
1Clear trend: HH/HL and ADX above 25?
yes
Trend followingpullbacks and BOS entries, trail stops
no
2Clean range with tested edges?
yes
Mean reversionfade the edges, target the midpoint
no
3Volatility contracting: squeeze or inside bars?
yes
Breakoutclose beyond the range on volume
no
4Catalyst with heavy volume, such as an earnings gap?
yes
Momentumfirst pullback or opening-range break
no
No tradecash is a position
Check yourself 2 questions
  1. Clear HH/HL and ADX above 25: which strategy?

    Show answer

    Trend following: pullbacks and break-of-structure entries.

  2. Clean range with tested edges?

    Show answer

    Mean reversion: fade the edges, target the midpoint.

Takeaway Trend with ADX above 25 → trend following; clean range → mean reversion; squeeze → breakout; unclear → stand aside.

Breakout trade plan#

flowchart TD
  B1["Base of 5+ weeks after a prior uptrend"] --> B2["Pullbacks contract, volume dries up"]
  B2 --> B3["Mark the pivot: top of the handle or base"]
  B3 --> B4["Buy the close above the pivot on 1.5x volume"]
  B4 --> B5["Stop under the last contraction, max 7–8%"]
  B5 --> B6["Add only if it holds the pivot on a retest"]
  B6 --> B7["Sell into 20–25% or trail the 50-day line"]
Check yourself 2 questions
  1. What volume confirms the breakout?

    Show answer

    About 1.5× average.

  2. What should pullbacks do inside the base?

    Show answer

    Contract, with volume drying up.

Takeaway A 5+ week base after an uptrend, contracting pullbacks, a pivot, a close above it on 1.5× volume, stop below the pivot.

CAN SLIM (O'Neil)#

LetterRule
CCurrent quarterly EPS up ≥ 20–25% year on year (leaders often 40%+), with sales growth too
AAnnual EPS growth ≥ 25% over 3–5 years; ROE ≥ 17%
NNew product, management or industry change, and price at or near new highs out of a base
SSupply and demand: big volume on up days, share buybacks
LLeader, not laggard: RS rating 80+ (avoid below 70)
IRising institutional sponsorship, not over-owned
MMarket direction: buy only in a confirmed uptrend (follow-through day)

Sell rules: cut every loss at 7–8% below the buy point; take most gains at 20–25%, but hold 8 weeks if a stock gains 20% within 1–3 weeks of breaking out.

Check yourself 2 questions
  1. What does the C stand for?

    Show answer

    Current quarterly EPS up at least 20–25% year on year.

  2. What does the M stand for?

    Show answer

    Market direction.

Takeaway O'Neil's CAN SLIM combines earnings growth, new highs, supply and demand, leadership, institutional support and market direction.

Pyramiding and scaling (Schwager)#

  • Add only to positions that already show a profit.
  • Do not add if the new combined stop would turn the whole position into a loss.
  • Each added unit is no larger than the first (a pyramid, not an inverted one).
  • Add at logical points: a breakout from a consolidation, or a retest of a broken level.
  • Exit adds on tighter conditions than the core position.
  • Never average down a losing trade; scaling in is only for confirmed trades with total risk fixed in advance.
Check yourself 2 questions
  1. Should you add to a losing position?

    Show answer

    No; add only to positions already in profit.

  2. Why should each added unit be no larger than the first?

    Show answer

    A pyramid, not an inverted one, keeps average cost and risk under control.

Takeaway Add only to winners, never so the combined stop turns the position into a loss, and each add no larger than the first.

Exits and trailing stops#

MethodRuleFits
Fixed targetNext level or 2RRanges, mean reversion
Partial + trailTake half at 1–2R, move stop to breakeven, trail the restSwing trades
Structure trailBelow each new higher lowTrends
MA trailClose below the 20 EMA (fast) or 50-DMA (slow)Momentum leaders
Chandelier / ATRHighest high − 3 × ATRVolatile trends
Time stopExit if no progress in N barsBreakouts that stall
Check yourself 2 questions
  1. Partial-plus-trail method?

    Show answer

    Take half at 1–2R, move the stop to breakeven, trail the rest.

  2. Structure trail in a trend?

    Show answer

    Below each new higher low.

Takeaway Fixed targets suit ranges; partial-plus-trail suits swings; structure and MA trails suit trends.

10Risk management and position sizing

TradingOverview/technical-analysis/handbook/08-risk-management · general-trading/risk-management-formulas

Position size from the stop#

risk amount = account × risk %risk per share = |entry − stop|shares = risk amount ÷ risk per share (round down)R:R = (target − entry) ÷ (entry − stop)
Worked exampleValue
Account₹10,00,000
Risk per trade (1%)₹10,000
Entry / stop₹500 / ₹480 → ₹20 per share
Shares10,000 ÷ 20 = 500
Position value₹2,50,000 (25% of capital, but only 1% at risk)
Target ₹540R:R = 40 ÷ 20 = 2

Always pick the stop first, then the size. Futures and options: risk per unit = stop distance × lot size (or point value).

Main card on position sizing: Risk management → Also in OV technicals · Futures · Options basics · Options strategies · Algo trading · Stock basics · AmiBroker AFL.

Check yourself 2 questions
  1. ₹10 lakh account, 1% risk: rupee risk?

    Show answer

    ₹10,000.

  2. R:R formula?

    Show answer

    (Target − entry) ÷ (entry − stop).

Takeaway Shares = account × risk% ÷ |entry − stop|, rounded down.

Win rate needed to break even#

breakeven win rate = 1 ÷ (1 + R)with cost c (in R) per trade = (1 + c) ÷ (1 + R)
Reward : riskBreak-even win rateWith 0.1R costs
0.5 : 166.7%73.3%
1 : 150.0%55.0%
1.5 : 140.0%44.0%
2 : 133.3%36.7%
3 : 125.0%27.5%

Costs hurt small-target styles most: a scalper at 0.5R needs 73% winners once costs reach 0.1R.

Main card on expectancy and win rate: Risk management → Also in this sheet · OV technicals.

Check yourself 2 questions
  1. Break-even win rate at 2:1?

    Show answer

    33.3% (about 36.7% with 0.1R costs).

  2. At 0.5:1 reward to risk?

    Show answer

    66.7%.

Takeaway Break-even win rate = 1 ÷ (1 + R); costs push it higher.

Expectancy and Kelly#

expectancy (R) = win% × avg win (R) − loss% × avg loss (R)Kelly f* = (p·b − q) ÷ b b = avg win ÷ avg loss
Win rateAvg winExpectancyFull Kelly
40%2R+0.20R10%
50%1.5R+0.25R16.7%
60%1R+0.20R20%
35%3R+0.40R13.3%
50%2R+0.50R25%

Full Kelly is far too aggressive for real, uncertain edges. Use ¼–½ Kelly as a ceiling, or simply a fixed 0.5–2% per trade.

Main card on expectancy and win rate: Risk management → Also in this sheet · OV technicals.

Check yourself 2 questions
  1. 40% wins at 2R: expectancy?

    Show answer

    +0.20R.

  2. Kelly formula?

    Show answer

    f* = (p·b − q) ÷ b, with b = average win ÷ average loss.

Takeaway Expectancy in R measures edge; Kelly f* = (p·b − q) ÷ b gives the growth-optimal fraction, usually bet at a fraction.

Drawdowns: the asymmetry#

DrawdownGain needed to recover
10%11.1%
20%25.0%
30%42.9%
40%66.7%
50%100%
60%150%
75%300%
90%900%
gain needed = 1 ÷ (1 − drawdown) − 1

Main card on drawdown recovery: Risk management → Also in Risk management · OV technicals.

Check yourself 2 questions
  1. Gain needed after a 40% drawdown?

    Show answer

    66.7%.

  2. After 75%?

    Show answer

    300%.

Takeaway Gain needed = 1 ÷ (1 − drawdown) − 1: a 50% drawdown needs 100%.

Losing streaks are normal#

Win rate≥ 4 losses≥ 6≥ 8≥ 10≥ 12
35%100%96%69%37%17%
40%100%87%49%20%8%
50%97%55%17%4%1%
60%80%21%4%1%0%

Chance of at least one losing streak of that length somewhere in 100 trades. A 40% trend follower should expect 6+ losses in a row.

Check yourself 2 questions
  1. 40% win rate: chance of at least 8 losses in a row in 100 trades?

    Show answer

    About 49%.

  2. Why does this matter for sizing?

    Show answer

    Size must survive streaks you will certainly meet.

Takeaway Over 100 trades, long losing streaks are near certain at typical win rates.

Ten straight losses at each risk level#

Risk per tradeAfter 10 lossesAfter 20 losses
0.5%−4.9%−9.5%
1%−9.6%−18.2%
2%−18.3%−33.2%
5%−40.1%−64.2%
10%−65.1%−87.8%

Compounded on the remaining balance. At 1% a bad streak is an annoyance; at 5–10% it ends the account.

Check yourself 2 questions
  1. Ten straight losses at 2% risk?

    Show answer

    About −18%.

  2. At 10% risk?

    Show answer

    About −65%.

Takeaway At 1% risk ten losses cost about 10%; at 10% they cost about two-thirds.

Portfolio and daily limits#

RuleTypical settingWhy
Risk per trade0.5–2% (1% common; 0.5% while learning)Survive streaks
Max open risk5–6% across all positionsAll stops can hit on the same day
Correlated positionsTreat as one position (e.g. three IT stocks)They fall together
Max daily loss2–3%; stop trading for the dayPrevents revenge cascades
Drawdown brakeHalve risk after a 10% drawdown until a new equity highShrinks the second leg of a drawdown
LeverageMinimal while learning; F&O only with defined riskLeverage magnifies mistakes faster than skill
Event riskFlat or reduced size into earnings, RBI policy, budget, CPIGaps jump past stops
Check yourself 2 questions
  1. Typical max open risk across positions?

    Show answer

    5–6%.

  2. How should three correlated positions be treated?

    Show answer

    As one position.

Takeaway 0.5–2% per trade, 5–6% max open risk, correlated positions counted as one, plus daily loss caps.

11Trading psychology, plan and journal

TradingOverview/technical-analysis/handbook/09-trading-psychology · general-trading/general-tips

Biases that cost money#

BiasLooks likeCounter
Loss aversionHolding losers, cutting winners earlyStop and target set before entry
ConfirmationReading only bullish views while longWrite the invalidation level first
Recency"Three wins in a row, I'm on a roll"Same size and rules every trade
Anchoring"I'll sell when it gets back to my price"Use levels, not your entry price
OverconfidenceBigger size after a streakFixed risk %
FOMOChasing extended movesNo setup, no trade
Sunk costAveraging down to "get back"Each trade judged on its own
Check yourself 2 questions
  1. Counter to confirmation bias?

    Show answer

    Write the invalidation level first.

  2. Counter to loss aversion?

    Show answer

    Set the stop and target before entry.

Takeaway Loss aversion, confirmation, recency, overconfidence and anchoring each have a rule-based counter.

Fear, greed and revenge#

  • Fear: skipping valid setups, closing winners early, moving the stop to breakeven too soon.
  • Greed: oversizing, adding without a plan, holding past the target hoping for more.
  • Revenge trading: forcing a trade right after a loss, often larger. Rule: 30–60 minutes off after an emotional loss.
  • Overtrading: boredom or FOMO trades. Cap trades per day; "no setup" is a valid outcome.
  • Ask: "Would I have written this exception into my plan when I was calm?" If not, don't.
Check yourself 2 questions
  1. Name a fear behaviour.

    Show answer

    Any of: skipping valid setups, closing winners early, moving the stop to breakeven too soon.

  2. What is revenge trading?

    Show answer

    Forcing a trade right after a loss to win it back.

Takeaway Fear skips setups and cuts winners, greed oversizes, revenge forces trades after losses.

Written trading plan#

  1. Markets and timeframes: what you trade and which charts set trend, setup and trigger.
  2. Setups: exact entry conditions, one sentence each.
  3. Risk: % per trade, max open risk, max daily loss, max trades per day.
  4. Orders: limit at a level or stop on a break; where the stop goes.
  5. Exits: targets, partials, trailing rules, time stops.
  6. When not to trade: first 15 minutes, before major news, after 3 losses, when tired or upset.
  7. Review: weekly journal review; change the plan monthly, with data.
Check yourself 2 questions
  1. Name three risk items in the plan.

    Show answer

    Any three of: % per trade, max open risk, max daily loss, max trades per day.

  2. How long should each setup description be?

    Show answer

    One sentence of exact entry conditions.

Takeaway Markets and timeframes, exact setups, risk limits, order rules and review routines, written down.

Journal and performance metrics#

  • Log every trade: setup, timeframe, entry, stop, target, exit, P&L in ₹ and in R, emotion, rule followed (yes/no), screenshot.
  • Weekly: win rate, average R, number of rule breaks, best and worst trade.
  • Monthly: expectancy, max drawdown, profit factor, results by setup type.
  • Study losers: bad setup, bad execution or bad luck? Only the first two need fixing.
  • Change one thing at a time and judge it over 20+ trades.
profit factor = gross profit ÷ gross loss (above 1 = profitable)
Check yourself 2 questions
  1. Name three fields to log per trade.

    Show answer

    Any three of: setup, timeframe, entry, stop, target, exit, P&L in ₹ and R, emotion, rule followed, screenshot.

  2. What's reviewed monthly?

    Show answer

    Expectancy, max drawdown and similar performance metrics.

Takeaway Log every trade with R, emotion and rule adherence; review weekly and monthly.

12Backtesting, walk-forward and forward testing

TradingOverview/technical-analysis/handbook/10-backtesting

Backtest steps#

  1. Rules: unambiguous entry, stop, exit and size. Every vague word becomes a bug.
  2. Data: enough history (5–10 years daily), adjusted for splits and dividends, survivorship-free if picking stocks.
  3. Simulate: signal on bar t, fill on bar t+1 open; include brokerage, taxes (STT in India), spread and slippage.
  4. Record: every trade, then compute metrics.
  5. Validate: out-of-sample, walk-forward, other symbols, parameter neighbourhoods.
  6. Forward test: paper or minimum size before scaling.
Check yourself 2 questions
  1. How much daily history is enough?

    Show answer

    About 5–10 years, adjusted for splits and dividends.

  2. When should a signal on bar t fill?

    Show answer

    On bar t+1.

Takeaway Unambiguous rules, clean adjusted data, signals on bar t filled on bar t+1, full costs, then metrics.

Backtest pitfalls#

PitfallHow it sneaks inFix
Look-ahead biasSignal and fill on the same closeShift signals one bar
Survivorship biasTesting today's index members onlyPoint-in-time constituents incl. delisted stocks
OverfittingRSI 17, ATR × 2.37 "work best"Few parameters; robust neighbourhoods
Ignoring costsZero brokerage, no slippage1–2 ticks per side plus all charges
Unrealistic fillsFilled at the exact high or lowConservative fills; gap through stops
Data snoopingTrying hundreds of ideas, keeping the bestHold out data from the start; count your trials

Main card on honest backtesting: Quant trading → Also in Algo trading · Algo trading · Quant trading · AmiBroker AFL.

Check yourself 2 questions
  1. Fix for look-ahead bias?

    Show answer

    Shift signals one bar.

  2. Fix for survivorship bias?

    Show answer

    Point-in-time constituents including delisted stocks.

Takeaway Look-ahead, survivorship and overfitting each inflate backtests; each has a fix.

Metrics to report#

MetricFormulaHealthy
CAGR(end ÷ start)^(1/years) − 1Beats buy and hold after costs
Max drawdownmin(equity ÷ running peak − 1)Within your tolerance
Sharpe√252 × mean daily return ÷ stdAbove 1 is good for a single strategy
SortinoSharpe using downside deviationHigher than Sharpe
MAR / CalmarCAGR ÷ |max drawdown|Above 0.5
Profit factorGross profit ÷ gross lossAbove 1.3 out of sample
ExpectancyAverage R per tradePositive with 100+ trades
ExposureShare of time in the marketContext for returns
Check yourself 2 questions
  1. Max drawdown formula?

    Show answer

    min(equity ÷ running peak − 1).

  2. What Sharpe is good for a single strategy?

    Show answer

    Above 1.

Takeaway CAGR, max drawdown, Sharpe and more; a strategy must beat buy-and-hold after costs.

Walk-forward testing#

flowchart TD
  W1["Optimise 2015–2018"] --> T1["Test 2019"]
  T1 --> W2["Optimise 2016–2019"]
  W2 --> T2["Test 2020"]
  T2 --> W3["Optimise 2017–2020"]
  W3 --> T3["Test 2021"]
  T3 --> ST["Stitch the test years"]
  • Rolling windows keep a fixed in-sample length; anchored windows grow from one start date.
  • In-sample : out-of-sample of 3:1 to 5:1; at least 30 trades per test window.
Check yourself 2 questions
  1. After optimising 2015–2018, which year is tested?

    Show answer

    2019.

  2. What do you stitch together at the end?

    Show answer

    The out-of-sample test years.

Takeaway Optimise on a window, test the next period, roll forward and stitch the test years.

Walk-forward efficiency (WFE)#

WFE = annualised out-of-sample return ÷ annualised in-sample return
WFERead
Above 0.7Strong: generalises well
0.5–0.7Acceptable decay
0.3–0.5Weak: suspect overfitting or regime dependence
Below 0.3 or negativeCurve-fit; do not trade

Also require 60–70% of test windows to be profitable and stable best parameters from window to window.

Check yourself 2 questions
  1. WFE formula?

    Show answer

    Annualised out-of-sample return ÷ annualised in-sample return.

  2. WFE of 0.4 suggests what?

    Show answer

    Weak: suspect overfitting or regime dependence.

Takeaway WFE = out-of-sample ÷ in-sample annual return; above 0.7 generalises well, below 0.3 is curve-fit.

Forward testing#

StyleMinimum tradesDuration
Scalping200–5002–4 weeks
Intraday100–2001–2 months
Swing50–1002–4 months
Position30–606–12 months
  • Within 20% of backtest metrics: on track.
  • 20–40% worse: investigate fills, rule breaks, regime.
  • More than 40% worse or negative expectancy: stop.
  • Never retune during the test; a change restarts the clock.
Check yourself 2 questions
  1. Minimum forward-test trades for swing trading?

    Show answer

    About 50–100.

  2. Results 20–40% worse than backtest: what to do?

    Show answer

    Investigate fills and rule adherence.

Takeaway Paper-trade enough trades for the style; results within 20% of the backtest are on track.

A vectorised backtest without look-ahead (pandas)#

import numpy as np
import pandas as pd

def backtest_sma(close, fast=20, slow=50, cost_bps=10):
    """Long when fast SMA > slow SMA. Signal on today's close, trade on the next bar."""
    signal = (close.rolling(fast).mean() > close.rolling(slow).mean()).astype(int)
    position = signal.shift(1).fillna(0)                 # no look-ahead
    ret = close.pct_change().fillna(0)
    trades = position.diff().abs().fillna(0)             # 1 on every entry or exit
    strat = position * ret - trades * cost_bps / 10_000  # cost per side
    equity = (1 + strat).cumprod()
    years = len(close) / 252
    cagr = equity.iloc[-1] ** (1 / years) - 1
    drawdown = equity / equity.cummax() - 1
    sharpe = np.sqrt(252) * strat.mean() / strat.std()
    return {"CAGR": cagr, "MaxDD": drawdown.min(), "Sharpe": sharpe,
            "Trades": int(trades.sum()), "Exposure": position.mean()}

def position_size(account, risk_pct, entry, stop):
    risk_amount = account * risk_pct
    per_share = abs(entry - stop)
    return int(risk_amount // per_share)                 # round down

position_size(1_000_000, 0.01, 500, 480)                 # 500 shares

The single shift(1) is what separates an honest backtest from a fantasy: the signal uses today's close, the position starts tomorrow. Costs are charged on every entry and exit.

Check yourself 2 questions
  1. How do you avoid look-ahead in a vectorised backtest?

    Show answer

    Shift the signal one bar before applying returns.

  2. When are costs charged?

    Show answer

    When the position changes.

Takeaway Compute the signal on today's close, trade on the next bar, and subtract costs on position changes.

Robustness checks#

  • Parameter plateau: SMA 18, 20, 22 should all work; a lone spike is noise.
  • Other markets: the same rules on several stocks or indices.
  • Sub-periods: bull, bear and sideways years separately.
  • Monte Carlo: reshuffle trade order to see the range of drawdowns; permutation tests check for a real edge.
  • Economic logic: prefer rules with a reason behind them.
  • A robust 55%-win, 1:1.5 system beats a fragile 70%-win one.
Check yourself 2 questions
  1. What does a parameter plateau look like?

    Show answer

    Neighbouring values (SMA 18, 20, 22) all work.

  2. What does a Monte Carlo reshuffle test?

    Show answer

    How sensitive drawdowns are to trade order.

Takeaway Parameter plateaus, other markets, sub-periods and Monte Carlo reshuffles separate edge from noise.

Tools#

ToolStyleBest for
TradingView / Pine ScriptVisual, bar-close fillsQuick idea checks
pandas custom loopFull controlLearning exactly how fills work
vectorbtVectorisedParameter scans across many symbols
backtraderEvent-drivenComplex order logic
AmibrokerDesktop, fastPopular with Indian EOD traders
Check yourself 2 questions
  1. Which tool suits parameter scans across many symbols?

    Show answer

    vectorbt.

  2. Which suits learning exactly how fills work?

    Show answer

    A custom pandas loop.

Takeaway TradingView for quick checks, a pandas loop to learn fills, vectorbt for scans, backtrader for event-driven tests.

13Algorithmic trading and automation

TradingOverview/technical-analysis/handbook/11-algorithmic-trading

From hypothesis to live#

flowchart TD
  H["Hypothesis with an economic reason"] --> R["Rules written in plain language"]
  R --> B["Backtest with costs, 200+ trades"]
  B --> W["Walk-forward, WFE above 0.5"]
  W --> P["Paper trade 30–100 trades"]
  P --> L["Live at minimum size"]
  L --> SC["Scale with hard limits and a kill switch"]
Check yourself 2 questions
  1. Minimum backtest trades suggested?

    Show answer

    200 or more.

  2. What WFE should walk-forward reach before paper trading?

    Show answer

    Above 0.5.

Takeaway Hypothesis with a reason, plain-language rules, a costed backtest with 200+ trades, walk-forward WFE above 0.5, paper trading, then small live size.

Quant strategy families#

TypeWin rateWin : lossWorks inBreaks when
Trend following35–45%2:1 – 5:1TrendsRanges
Mean reversion55–70%1:1 – 1.5:1RangesStrong trends
Statistical arbitrage60–75%1:1 – 2:1Any (market-neutral)Pairs decouple
Market making70–85%0.5:1 – 1:1Liquid, calm marketsFast one-way moves

Stat arb tests: cointegration (Engle–Granger, Johansen); trade the z-score of the spread.

Check yourself 2 questions
  1. Typical trend-following win rate?

    Show answer

    About 35–45%, with 2:1 to 5:1 wins.

  2. When does mean reversion break?

    Show answer

    In strong trends.

Takeaway Trend following wins rarely but big; mean reversion wins often but small; stat arb is market-neutral until pairs decouple.

Levels of automation#

  1. Manual with checklist: a script prints signals; you decide and place orders.
  2. Semi-automated: alerts or one-click orders; you supervise each trade.
  3. Fully automated: orders through the broker API; you handle exceptions only.

Move up a level only after the strategy is validated and you understand partial fills, rejects and disconnects.

Check yourself 2 questions
  1. What does semi-automated mean?

    Show answer

    Alerts or one-click orders, with you supervising each trade.

  2. In full automation, what's your job?

    Show answer

    Handling exceptions.

Takeaway Manual with a checklist, semi-automated with alerts, or fully automated with you handling exceptions.

Production safety#

  • Kill switch: flatten all positions and halt at a daily loss limit.
  • Hard limits in code: max position, max orders per minute, max daily loss.
  • Heartbeat: alert if the bot has not logged activity in N minutes.
  • Reconnect logic for data feeds and token refreshes.
  • Run on a server (VPS or cloud), not a laptop.
  • Version control; separate dev, paper and live; never hot-fix a live bot after a loss.
  • Keep API keys out of code and repositories.
Check yourself 2 questions
  1. What does a kill switch do?

    Show answer

    Flattens all positions and halts at a daily loss limit.

  2. What does a heartbeat alert catch?

    Show answer

    A bot that has stopped logging activity.

Takeaway Kill switch, hard limits in code, heartbeats and reconnect logic keep a bot safe.

APIs and data sources#

NeedIndiaGlobal
Broker order APIsZerodha Kite Connect, Upstox, Angel One SmartAPI, Dhan, Fyers, ICICI BreezeInteractive Brokers, Alpaca, OANDA
Historical dataBroker historical APIs, NSE bhavcopy (EOD), paid vendorsyfinance, Alpha Vantage, Polygon
Macro dataRBI DBIE, MoSPI (CPI, IIP, GDP)FRED
Python wrapperskiteconnect, smartapi-pythonib_insync, alpaca-py

India: SEBI's 2025 framework for retail algorithmic trading routes algos through brokers, tags algo orders, and requires registration above an exchange-set orders-per-second threshold, with API access tied to registered static IPs. Check the current circulars before automating.

Check yourself 2 questions
  1. Name two Indian broker order APIs.

    Show answer

    Any two of: Kite Connect, Upstox, Angel One SmartAPI, Dhan, Fyers, ICICI Breeze.

  2. Free end-of-day source for NSE data?

    Show answer

    NSE bhavcopy.

Takeaway Indian broker APIs (Kite, Upstox, SmartAPI, Dhan, Fyers, Breeze) and data from broker history, NSE bhavcopy or vendors.

14Common mistakes and fixes

TradingOverview/technical-analysis/handbook/12-common-mistakes · tips-and-tricks

Mistake → consequence → fix#

MistakeConsequenceFix
No written planRandom, emotional tradesOne page of rules; trade only those setups
No stop, or moving it further awayOne trade erases monthsStop placed before entry; it only moves toward profit
Risking 5–10% per tradeNormal streaks become disasters0.5–2% per trade
Averaging downBigger position in the wrong directionAdd only to winners, within a fixed total risk
Trading against the higher timeframeLow base-rate setupsCheck one or two timeframes up
Chasing extended movesBuying the top of the candleWait for a pullback or skip
Indicator overloadContradictory signals, late entriesOne trend tool, one momentum or volume tool, ATR
Trading into news or earningsGaps through stopsCheck the calendar; reduce or flatten
Ignoring costsGross edge, net lossModel every charge; prefer liquid names
Too many markets and timeframesNo depth anywhereOne or two markets until consistent
Revenge tradingEscalating lossesCool-down rule and max daily loss
No journalSame mistakes repeatedLog every trade; weekly review
Blaming "manipulation"Nothing learnedStops beyond obvious levels with a buffer
Check yourself 2 questions
  1. Consequence of moving the stop further away?

    Show answer

    One trade can erase months of gains.

  2. Fix for having no written plan?

    Show answer

    One page of rules, and trade only those setups.

Takeaway No plan, no stop, oversizing and revenge trading each have a predictable consequence and a simple fix.

Tips worth remembering#

  • Price and volume first; indicators are derived from them.
  • The best trades usually feel uncomfortable to take.
  • A breakout that fails quickly is information: the other side is strong.
  • Most money is made sitting through trends, not entering and exiting.
  • Plan the trade, trade the plan, journal the result.
Check yourself 2 questions
  1. What does a quickly failing breakout tell you?

    Show answer

    The other side is strong.

  2. Where is most trend money made?

    Show answer

    By sitting through the trend.

Takeaway Price and volume first, good trades feel uncomfortable, failed breakouts are information, money is made sitting through trends.

Combining with fundamentals#

  • Fundamentals for what: screen for quality and value; only trade names you would be willing to own.
  • Technicals for when: enter on a pullback or breakout, with a stop and target from the chart.
  • Options for how: express the view or define the risk; never to rescue a weak thesis.
  • See the Fundamental analysis sheet for the business side.
Check yourself 2 questions
  1. What role do fundamentals play here?

    Show answer

    Screening for quality and value: what to trade.

  2. What do technicals decide?

    Show answer

    When to enter and exit, with stop and target from the chart.

Takeaway Fundamentals choose what, technicals choose when, options choose how.

15Last-minute checklists

Run these before every session and every trade.

Before the session#

  • Market regime on my timeframe: trend, range or squeeze?
  • Higher-timeframe bias and key levels marked.
  • Calendar checked: results, RBI policy, CPI, budget, expiry.
  • India VIX, FII/DII flows and global cues noted.
  • Mental state: calm, rested, no revenge or FOMO.
  • Today's max loss and max number of trades set.
Check yourself 2 questions
  1. Name two calendar events to check.

    Show answer

    Any two of: results, RBI policy, CPI, the Budget, expiry.

  2. What should be marked before the open?

    Show answer

    Higher-timeframe bias and key levels.

Takeaway Regime, higher-timeframe bias and levels, the event calendar, VIX and flows, and your own state.

Before each trade#

  • The setup matches my written plan, in one sentence.
  • It sits at a level or structure point, not mid-range.
  • Entry, stop and target are defined before the order.
  • Size = risk amount ÷ |entry − stop|, rounded down.
  • R:R at least 1:1.5 to 1:2 after costs.
  • No major event before the planned exit.
Check yourself 2 questions
  1. Where should the setup sit?

    Show answer

    At a level or structure point, not mid-range.

  2. Minimum reward to risk?

    Show answer

    At least about 2:1.

Takeaway Plan-matching setup at a level, entry, stop and target defined, size from the stop, R:R at least 2.

During and after#

  • Stop order placed immediately; never moved against the trade.
  • No adding to losers; partials and trailing per plan.
  • Stopped out? Accept it; no immediate re-entry from emotion.
  • Log: setup, entry, exit, R multiple, emotion, rule followed.
  • Weekly: win rate, average R, rule breaks. Monthly: expectancy, drawdown, by setup.
Check yourself 2 questions
  1. Can you move a stop further away?

    Show answer

    Never against the trade.

  2. After a stop-out, re-enter immediately?

    Show answer

    No; no emotional re-entry.

Takeaway Stop placed immediately, never moved against you, no adding to losers, accept stops, log everything.

One-line formulas#

shares = (account × risk%) ÷ |entry − stop|R:R = (target − entry) ÷ (entry − stop)breakeven win% = 1 ÷ (1 + R)expectancy = W × avg win − L × avg lossrecovery = 1 ÷ (1 − drawdown) − 1ATR stop = entry − k × ATR k ≈ 1.5–3
Check yourself 2 questions
  1. Break-even win rate formula?

    Show answer

    1 ÷ (1 + R).

  2. Typical ATR stop multiple?

    Show answer

    About 1.5–3 × ATR.

Takeaway Shares, R:R, break-even win rate, expectancy, recovery and ATR stop on one card.

Educational note#

Not investment advice. This sheet is a study reference built from personal study notes and standard textbooks. Pattern statistics are historical averages from US stocks. Trading and investing carry a real risk of loss; check current NSE, BSE and SEBI rules before acting on anything here.

Numbers that expire#

Every figure on this sheet that a regulator, exchange or budget can change, with when it last changed. Last checked 15 Nov 2026; verify before trading.

WhatCurrent valueAs of
Closing auction (F&O stocks) and derivatives hours3 Aug–6 Dec 2026: continuous trading to 15:15, auction to 15:35, derivatives to 15:40 · from 7 Dec 2026: continuous to 15:30, auction 15:30–15:40 (matching to 15:45), derivatives to 15:45 (expiring index contracts stop 15:30)SEBI circular of 15 Oct 2026 · source
No cards match. Try fewer or different words, or press Esc to clear.