Patterns
Every pattern here is a rule over stored candles, written out step by step below. Pick a name and a candle size, then one pattern to test — or let the library look for anything in progress. A hit is an observation of what the candles just did; what followed the earlier hits on the same name is counted and shown beside it, every hit included. For what the candles in progress say about the coming hours and days, open the outlook; to be told when a pattern completes, sign in and tap Alert me on any card.
Test a name
Sign in to sweep your whole watchlist in one go.The library, rule by rule
What each pattern checks, in the order the code checks it, with the parameters and their defaults for daily candles. The "meaning" is the convention the pattern is named for, stated as a convention; whether it held on a given name is what the test above measures.
Runs, breaks and structure
Rules on closes, highs and lows alone. Plain to state, plain to check.N consecutive rising candles · reading up · any candleA momentum run: every close above the one before it for N candles. The owner's first example. Conventionally read as buyers in control for as long as it lasts.
- Walk the candles in order.
- Count a streak: +1 when this close is above the previous close, back to 0 otherwise.
- The pattern completes on the candle where the streak first reaches N.
- Report the move from the close before the run to the close that completed it.
- Progress: how long the current streak is against N, and whether the last close is still rising.
- n = 5
- Consecutive rising closes (N) — The owner's momentum-run example uses 20.
N consecutive falling candles · reading down · any candleThe mirror: every close below the one before it for N candles. Read as sellers in control while it lasts.
- Walk the candles in order.
- Count a streak: +1 when this close is below the previous close, back to 0 otherwise.
- The pattern completes on the candle where the streak first reaches N.
- Report the move from the close before the run to the close that completed it.
- Progress: the current streak against N.
- n = 5
- Consecutive falling closes (N)
Higher highs and higher lows · reading up · any candleUptrend structure: each swing high above the last and each swing low above the last. Read as a trend that is still being confirmed by its pullbacks.
- Find swing highs and lows with the zigzag: a pivot is confirmed once price has moved swing_pct against it.
- Take every window of 2×swings+1 consecutive confirmed pivots.
- Require each swing high in the window above the previous swing high, and each swing low above the previous swing low.
- The pattern completes on the candle where the last pivot in the window was confirmed.
- The last swing low is reported as the level the structure stands on.
- swings = 2
- Higher highs / higher lows required
- swing_pct = 3
- Minimum swing size, % — Smaller on intraday candles.
Lower highs and lower lows · reading down · any candleDowntrend structure: each swing high below the last and each swing low below the last.
- Find swing highs and lows with the zigzag (pivot confirmed after a swing_pct move against it).
- Take every window of 2×swings+1 consecutive confirmed pivots.
- Require each swing high below the previous swing high, and each swing low below the previous swing low.
- The pattern completes on the candle where the last pivot was confirmed.
- The last swing high is reported as the level the structure hangs from.
- swings = 2
- Lower highs / lower lows required
- swing_pct = 3
- Minimum swing size, %
Gap at the open · reading up or down · any candleThe session opened at least X% away from the previous close. Read as news or flow arriving overnight.
- At the first candle of each session, compare its open with the last close of the previous session.
- Gap % = open / previous close − 1.
- The pattern completes when |gap %| ≥ pct; direction is the gap's sign.
- On daily candles this is simply open vs the previous day's close.
- pct = 1
- Minimum gap, %
Move of X% within M candles · reading up or down · any candleA fast move: the close is at least X% away from where it was M candles ago. Read as a burst of one-sided flow.
- For each candle, take the close M candles earlier.
- Move % = close now / close then − 1.
- The pattern completes when |move %| ≥ pct; direction is the sign.
- Consecutive candles that all qualify in the same direction count once, at the first of them.
- pct = 2
- Minimum move, %
- candles = 3
- Within this many candles (M)
Cross of a level you set · reading up or down · any candleThe close went through a price you chose. Read however you meant the level.
- Take the level you entered.
- The pattern completes on a candle whose close is at or above the level while the previous close was below it (up), or at or below it while the previous close was above (down).
- Nothing is reported until a level is set.
- level = 0
- Your level, ₹ — Required — leave at 0 and this pattern reports nothing.
Inside bar, then a breakout · reading up or down · any candleA candle whose whole range sat inside the one before it (a pause), then a close outside the mother candle's range. Read as a pause resolving.
- Take three consecutive candles: mother, inside, break.
- Inside: its high ≤ mother high and its low ≥ mother low.
- The pattern completes when the third candle closes above the mother high (up) or below the mother low (down).
Indicator-based
Rules on a derived line: moving averages, VWAP, volume, RSI, Bollinger bands.Moving-average cross · reading up or down · any candleThe faster simple average crossed the slower one. Read as the near-term average price overtaking (or falling behind) the longer one.
- Compute SMA(fast) and SMA(slow) of the closes.
- The pattern completes on a candle where fast was ≤ slow on the previous candle and is > slow now (up), or ≥ before and < now (down).
- fast must be smaller than slow, else nothing is reported.
- fast = 9
- Fast average, candles
- slow = 21
- Slow average, candles
Volume spike · reading up or down · any candleOne candle traded many times the recent average volume. Read as attention arriving; the candle's colour says which way it leaned.
- Average the volume of the previous M candles (those that reported one).
- The pattern completes when this candle's volume ≥ times × that average.
- Direction is the candle's own: up if it closed above its open, down if below, neutral if flat.
- times = 3
- Multiple of the average
- candles = 20
- Average over this many candles (M)
RSI into overbought / oversold · reading up or down · any candleWilder's RSI crossed into the overbought zone (reported as a 'down' observation: stretched) or the oversold zone ('up': washed out).
- Compute RSI(n) from the closes (Wilder smoothing).
- The pattern completes when RSI moves from below `high` to at or above it (overbought → down), or from above `low` to at or below it (oversold → up).
- Only the crossing candle is a hit, not every candle spent inside the zone.
- n = 14
- RSI length
- high = 70
- Overbought above
- low = 30
- Oversold below
Bollinger squeeze, then a break · reading up or down · any candleThe bands had narrowed to their tightest in a while, then the close left them. Read as a quiet stretch ending.
- Compute Bollinger bands: SMA(n) ± k × standard deviation of the last n closes; bandwidth = (upper − lower) / middle.
- Squeeze: the smallest bandwidth in the last 6 candles is within 5% of the smallest over the last `squeeze` candles.
- The pattern completes on a candle that closes above the upper band having been at or below it the candle before (up), or the mirror below the lower band (down), while squeezed.
- n = 20
- Band length
- k = 2
- Standard deviations
- squeeze = 60
- Tightest in this many candles
Trend and waves
The fitted trend line and the swing count. A wave count is a reading of the swings, not a prophecy.Trend line: slope, length, strength · reading up or down · any candleThe straight-line fit through the last N closes: how steep, how long, how clean. This is the slope/length/strength reading (R6) and a version of the 20-candle rule that fires on a clean run even when one close in the middle dipped.
- Fit a least-squares line through the last N closes (x = candle index).
- Slope % = slope / mean close × 100, per candle. R² = share of the variance the line explains (1 = a ruler, 0 = chop).
- Length = candles since the window's low (for a rising line) or high (falling). Magnitude = % from that extreme to the last close.
- Continuing = the last close is on the slope's side of the fitted line, or the last three closes all moved with the slope.
- The pattern completes when |slope %| ≥ min_slope_pct and R² ≥ min_r2; consecutive qualifying candles count once, at the first.
- Progress always reports the current slope, R², length, magnitude and whether it is continuing.
- n = 20
- Candles in the fit (N)
- min_slope_pct = 0.25
- Minimum slope, % per candle
- min_r2 = 0.8
- Minimum R²
Impulse wave (five swings, Elliott-style) · reading up or down · any candleFive alternating swings that obey the three classical impulse rules. A count, not a prophecy: the same swings can be counted more than one way, and this is the plain mechanical reading.
- Find swings with the zigzag at swing_pct.
- Take six consecutive confirmed pivots L-H-L-H-L-H (up) or H-L-H-L-H-L (down).
- Rule 1: wave 2 does not retrace past the start of wave 1.
- Rule 2: wave 3 is not the shortest of waves 1, 3 and 5.
- Rule 3: wave 4 does not enter the price territory of wave 1.
- Each wave must make progress: 3 beyond 1, 5 beyond 3.
- The pattern completes when the sixth pivot is confirmed. Progress reports 'wave 5 under way' when the first five pivots hold and the live swing is the fifth wave.
- swing_pct = 4
- Minimum swing size, %
Multi-candle shapes
Two- and three-candle shapes from the classical catalogue.Bullish engulfing · reading up · any candleA down candle followed by an up candle whose body covers it, after a decline. Read as the decline being rejected in one candle.
- Take two consecutive candles.
- First closes below its open; second closes above its open.
- Second's open ≤ first's close and second's close ≥ first's open (its body covers the first's body).
- Context: the net move over the `context` candles before the pair is negative (set 0 to skip).
- context = 5
- Decline measured over this many candles before
Bearish engulfing · reading down · any candleAn up candle followed by a down candle whose body covers it, after a rise.
- Take two consecutive candles.
- First closes above its open; second closes below its open.
- Second's open ≥ first's close and second's close ≤ first's open.
- Context: the net move over the `context` candles before the pair is positive (set 0 to skip).
- context = 5
- Rise measured over this many candles before
Morning star · reading up · any candleA long down candle, a small-bodied candle, then an up candle closing above the midpoint of the first. Read as a decline stalling and turning.
- Take three consecutive candles.
- First: a down candle with a body at least the average body of the ten candles before it.
- Second: a body no bigger than small_pct of the first's body.
- Third: an up candle closing above the midpoint of the first candle's body.
- small_pct = 30
- Middle candle body, % of the first's
Evening star · reading down · any candleA long up candle, a small-bodied candle, then a down candle closing below the midpoint of the first.
- Take three consecutive candles.
- First: an up candle with a body at least the average body of the ten candles before it.
- Second: a body no bigger than small_pct of the first's body.
- Third: a down candle closing below the midpoint of the first candle's body.
- small_pct = 30
- Middle candle body, % of the first's
Three white soldiers · reading up · any candleThree up candles in a row, each opening inside the previous body and closing higher, with little upper wick.
- Take three consecutive candles, all closing above their opens.
- Each close above the previous close.
- Each open inside the previous candle's body.
- Each upper wick no more than wick_pct of its body.
- wick_pct = 30
- Maximum upper wick, % of body
Three black crows · reading down · any candleThree down candles in a row, each opening inside the previous body and closing lower, with little lower wick.
- Take three consecutive candles, all closing below their opens.
- Each close below the previous close.
- Each open inside the previous candle's body.
- Each lower wick no more than wick_pct of its body.
- wick_pct = 30
- Maximum lower wick, % of body
Single-candle shapes
One candle's body and wicks. Weak on their own; shown with what followed on this name.Doji · reading neutral · any candleOpen and close almost equal: the candle ranged but ended where it began. Read as indecision.
- Body = |close − open|; range = high − low.
- The pattern completes when range > 0 and body ≤ body_pct of the range.
- body_pct = 10
- Body no more than this % of the range
Hammer · reading up · any candleA long lower wick and a small body near the top, after a decline: the candle went well below and was pulled back up. Read as a low being rejected.
- Lower wick ≥ wick_times × body.
- Upper wick ≤ other_wick_pct of the range.
- Context: the net move over the `context` candles before is negative (set 0 to skip).
- The wick's low is reported as the level rejected.
- wick_times = 2
- Lower wick at least this many × body
- other_wick_pct = 15
- Upper wick at most this % of range
- context = 5
- Decline measured over this many candles before
Shooting star · reading down · any candleA long upper wick and a small body near the bottom, after a rise: the candle went well above and was pushed back down. Read as a high being rejected.
- Upper wick ≥ wick_times × body.
- Lower wick ≤ other_wick_pct of the range.
- Context: the net move over the `context` candles before is positive (set 0 to skip).
- The wick's high is reported as the level rejected.
- wick_times = 2
- Upper wick at least this many × body
- other_wick_pct = 15
- Lower wick at most this % of range
- context = 5
- Rise measured over this many candles before
Marubozu · reading up or down · any candleAlmost no wicks: the candle opened at one end of its range and closed at the other. Read as one side in control for the whole candle.
- Body = |close − open|; range = high − low.
- The pattern completes when range > 0 and body ≥ body_pct of the range.
- Direction is the candle's colour.
- body_pct = 90
- Body at least this % of the range
Indicator definitions: SMA(n) is the mean of the last n closes. RSI(n) is Wilder's — average gain over average loss, smoothed by (previous × (n−1) + now) / n. ATR(n) is the Wilder-smoothed mean of the true range. Bollinger bands are SMA(n) ± k standard deviations of the same n closes. VWAP is Σ(typical price × volume) / Σ volume within the session, typical price = (high + low + close) / 3. The trend line is ordinary least squares on close against candle index. Swings come from a zigzag that confirms a pivot once price has moved the swing size against it.