Tool
Candlestick Patterns
market.patterns
Inputs
No typed inputs.
Outputs
An event list, not a true/false line: one event on each bar where the chosen pattern forms, carrying the bar index and the pattern's name (it does not say whether the shape is bullish or bearish). For a true/false signal or the shape's direction, use market.candlestick_patterns with interpretor.candlestick_pattern instead.
A focused candlestick detector for three of the most-used single- and two-candle shapes: engulfing, doji and hammer. You pick which one to watch and it flags every bar where that shape appears.
How it works
It reads each bar's open, high, low and close, measures the body and the upper and lower wicks, and tests those proportions against the rule for the pattern you selected. When a bar (or pair of bars) matches, it emits one event naming the pattern on that bar; it does not record whether the shape is bullish or bearish.
Modes
Flags a two-candle reversal where the second candle's body fully swallows the first candle's body in the opposite direction — a bullish engulfing after a fall, a bearish engulfing after a rise.
When to use: When you want a strong, momentum-style reversal cue that confirms a clear shift of control between buyers and sellers.
Flags an indecision candle whose open and close are almost equal, leaving a tiny body with wicks on one or both sides — a sign that neither side won the bar.
When to use: When you want to spot stalling momentum or a potential turning point, especially after an extended move into support or resistance.
Flags a single candle with a small body near the top and a long lower wick, showing that price was pushed down during the bar but rejected back up before the close — a bullish rejection of lower prices.
When to use: When you want a bottom-fishing reversal cue at support after a decline, where a long lower wick signals buyers stepping in.
Configuration
Which candlestick shape to detect: 'engulfing' (a two-candle body-swallow reversal), 'doji' (an open≈close indecision candle), or 'hammer' (a small body with a long lower rejection wick). Only the selected pattern is reported.
Connects to
Examples
- Reversal trigger: select 'engulfing' and fire a long when a bullish engulfing prints after a pullback.
- Indecision filter: select 'doji' and avoid new entries on bars where price stalls into a key level.
Common mistakes
- Treating every hammer or doji as an automatic reversal — without trend or location context (e.g. at support) these single candles fire often and fail often.
- Expecting more shapes than the three offered: for the full library of named formations (stars, dark-cloud, tweezers, marubozu, …) use market.candlestick_patterns instead.