Candlestick pattern indicators extendDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/ta4j/ta4j/llms.txt
Use this file to discover all available pages before exploring further.
CachedIndicator<Boolean> and return true when the pattern is detected at a given index, false otherwise. They return false during the warm-up period — never NaN. Most accept a BarSeries constructor and expose tunable thresholds via an overloaded constructor.
Pattern indicators compose naturally with Rule objects:
Helper indicators
Two helper indicators power many pattern checks internally and can be used directly:| Class | Constructor | Returns |
|---|---|---|
RealBodyIndicator | RealBodyIndicator(BarSeries) | close - open (positive = bullish) |
UpperShadowIndicator | UpperShadowIndicator(BarSeries) | high - max(open, close) |
LowerShadowIndicator | LowerShadowIndicator(BarSeries) | min(open, close) - low |
Bullish patterns
HammerIndicator
HammerIndicator
Constructors:
HammerIndicator(BarSeries series)— default ratios: body-to-lower-wick ≥ 2, body-to-upper-wick ≤ 1HammerIndicator(BarSeries series, double bodyToBottomWickRatio, double bodyToUpperWickRatio)
InvertedHammerIndicator
InvertedHammerIndicator
Constructor:
InvertedHammerIndicator(BarSeries series)Single-candle bullish reversal in a downtrend: small body at the bottom, long upper shadow. Opposite shadow structure to a hammer; similar bullish implication after confirmation.BullishEngulfingIndicator
BullishEngulfingIndicator
Constructor: Unstable bars: 1
BullishEngulfingIndicator(BarSeries series)Two-candle bullish reversal: a bearish candle followed by a bullish candle whose body completely engulfs the prior candle’s body (current open below prior open/close, current close above prior open/close).BullishHaramiIndicator
BullishHaramiIndicator
Constructor: Unstable bars: 1
BullishHaramiIndicator(BarSeries series)Two-candle bullish reversal: a large bearish candle followed by a small bullish candle whose body is completely inside the prior body. Indicates indecision after a downtrend.MorningStarIndicator
MorningStarIndicator
Constructors:Unstable bars: 2
MorningStarIndicator(BarSeries series)— defaults: small body 1.5%, big body 3%MorningStarIndicator(BarSeries series, Num smallBodyThresholdPercentage, Num bigBodyThresholdPercentage)
- Large bearish candle
- Small-bodied candle gapping down (the “star”)
- Large bullish candle closing above the midpoint of the first candle
PiercingIndicator
PiercingIndicator
Constructors:
PiercingIndicator(BarSeries series)— uses default body thresholdPiercingIndicator(BarSeries series, Num bigBodyThresholdPercentage)
PiercingLineIndicator
PiercingLineIndicator
Constructors:
PiercingLineIndicator(BarSeries series)— defaults: big body 3%, gap 0%, penetration 50%PiercingLineIndicator(BarSeries series, Num bigBodyThresholdPercentage, Num gapThresholdPercentage, Num penetrationThresholdPercentage)
PiercingIndicator.BullishMarubozuIndicator
BullishMarubozuIndicator
Constructors:
BullishMarubozuIndicator(BarSeries series)— 5-bar body average, body > average, shadows ≤ 5%BullishMarubozuIndicator(BarSeries series, int bodyAveragePeriod, double bodyToAverageBodyRatio, double upperShadowToBodyRatio, double lowerShadowToBodyRatio)
BullishKickerIndicator
BullishKickerIndicator
Constructor:
BullishKickerIndicator(BarSeries series)Two-candle pattern: a bearish candle followed by a bullish candle that opens above the prior open (gap up). One of the most powerful reversal signals; rarely occurs.ThreeWhiteSoldiersIndicator
ThreeWhiteSoldiersIndicator
Constructor: Unstable bars: 4
ThreeWhiteSoldiersIndicator(BarSeries series, int barCount, Num factor)Four-candle pattern: one black (bearish) candle followed by three consecutive white (bullish) soldiers, each opening within the prior body and closing above the prior close with a short upper shadow.ThreeInsideUpIndicator
ThreeInsideUpIndicator
Constructor:
ThreeInsideUpIndicator(BarSeries series)Confirms a Bullish Harami with a third candle closing above the first candle’s close.Bearish patterns
ShootingStarIndicator
ShootingStarIndicator
Constructors:
ShootingStarIndicator(BarSeries series)— default ratios: body-to-upper-wick ≥ 2, body-to-lower-wick ≤ 1ShootingStarIndicator(BarSeries series, double bodyToBottomWickRatio, double bodyToUpperWickRatio)
HangingManIndicator
HangingManIndicator
Constructor:
HangingManIndicator(BarSeries series)Same shape as a hammer (long lower shadow) but occurs in an uptrend, signaling a potential bearish reversal.EveningStarIndicator
EveningStarIndicator
Constructors:Unstable bars: 2
EveningStarIndicator(BarSeries series)— defaults: small body 1.5%, big body 3%EveningStarIndicator(BarSeries series, Num smallBodyThresholdPercentage, Num bigBodyThresholdPercentage)
- Large bullish candle
- Small-bodied candle gapping up (the “star”)
- Large bearish candle closing below the midpoint of the first candle
DarkCloudIndicator
DarkCloudIndicator
Constructors:
DarkCloudIndicator(BarSeries series)— uses default body thresholdDarkCloudIndicator(BarSeries series, Num bigBodyThresholdPercentage)
DarkCloudCoverIndicator for full configurable gap/penetration thresholds.DarkCloudCoverIndicator
DarkCloudCoverIndicator
Constructors:
DarkCloudCoverIndicator(BarSeries series)— defaults: big body 3%, gap 0%, penetration 50%DarkCloudCoverIndicator(BarSeries series, Num bigBodyThresholdPercentage, Num gapThresholdPercentage, Num penetrationThresholdPercentage)
BearishEngulfingIndicator
BearishEngulfingIndicator
Constructor: Unstable bars: 1
BearishEngulfingIndicator(BarSeries series)Two-candle bearish reversal: a bullish candle followed by a bearish candle whose body completely engulfs the prior body.BearishHaramiIndicator
BearishHaramiIndicator
Constructor: Unstable bars: 1
BearishHaramiIndicator(BarSeries series)Two-candle bearish reversal: a large bullish candle followed by a small bearish candle contained entirely within the prior body.BearishMarubozuIndicator
BearishMarubozuIndicator
Constructors:
BearishMarubozuIndicator(BarSeries series)BearishMarubozuIndicator(BarSeries series, int bodyAveragePeriod, double bodyToAverageBodyRatio, double upperShadowToBodyRatio, double lowerShadowToBodyRatio)
BearishKickerIndicator
BearishKickerIndicator
Constructor:
BearishKickerIndicator(BarSeries series)A bullish candle followed by a bearish candle that opens below the prior open (gap down). Strong bearish reversal signal.ThreeBlackCrowsIndicator
ThreeBlackCrowsIndicator
Constructor:
ThreeBlackCrowsIndicator(BarSeries series, int barCount, Num factor)Three consecutive large bearish candles, each opening within the prior body and closing lower. Bearish mirror of Three White Soldiers.ThreeInsideDownIndicator
ThreeInsideDownIndicator
Constructor:
ThreeInsideDownIndicator(BarSeries series)Confirms a Bearish Harami with a third candle closing below the first candle’s close.Doji
DojiIndicator
DojiIndicator
Constructor:
DojiIndicator(BarSeries series, int barCount, double bodyFactor)A candle is Doji when its body height is less than bodyFactor × average(body height over barCount). Doji represents indecision between buyers and sellers; context determines whether it is bullish or bearish.Using patterns in strategies
Pattern indicators check the trend direction (uptrend/downtrend) internally using
UpTrendIndicator and DownTrendIndicator. The warm-up period of those internal indicators contributes to the pattern indicator’s getCountOfUnstableBars().