Candle Pattern
Detect candlestick patterns automatically from price data, including Doji variants, Spinning Top, Pin Bar, Hammer, Inverted Hammer, Engulfing, and more. The Candle Pattern rule analyses the shape and structure of individual and multi-bar candlestick formations, outputting an execution count each time a configured pattern is identified. This enables you to build strategies that react to classic price action signals without manual chart analysis.
How It Works
The Candle Pattern rule examines incoming candle data (Open, High, Low, Close) and evaluates each new bar against the configured pattern definitions. When a pattern match is detected, the rule increments its execution count, which can be used as a trigger for downstream rules.
The rule supports a wide range of candlestick patterns, each identified by the relationship between the candle body (the distance between open and close) and its wicks (the distance the high and low extend beyond the body):
- Doji — A candle where the open and close are nearly equal, indicating market indecision. Variants include the standard Doji, Long-Legged Doji (with extended upper and lower wicks), Dragonfly Doji (long lower wick, no upper wick), and Gravestone Doji (long upper wick, no lower wick).
- Spinning Top — A candle with a small body and relatively equal upper and lower wicks, suggesting indecision but with slightly more conviction than a Doji.
- Pin Bar — A candle with a very small body at one end and a long wick extending from the other, indicating a sharp rejection of a price level. Bullish pins have a long lower wick; bearish pins have a long upper wick.
- Hammer — A bullish reversal pattern found at the bottom of a downtrend, with a small body near the top and a long lower wick showing buying pressure.
- Inverted Hammer — A potential bullish reversal pattern with a small body near the bottom and a long upper wick, found at the bottom of a downtrend.
- Engulfing — A two-bar pattern where the second candle's body completely engulfs the first candle's body. A bullish engulfing occurs after a downtrend; a bearish engulfing occurs after an uptrend.
The pattern configuration allows you to select which specific patterns to scan for, so the rule only triggers on the formations that are relevant to your strategy. You can configure multiple patterns in a single rule to detect any of several formations, or use separate Candle Pattern rules for each pattern if you need different downstream logic for each.
Inputs
| Input | Description | Required | Default |
|---|---|---|---|
| Source | The candle data source providing Open, High, Low, and Close values for pattern analysis. Connect this to a Price Data rule output configured to deliver candle data. | Yes | — |
| Pattern | The candlestick pattern or patterns to detect. Select one or more patterns from the available set including Doji, Long-Legged Doji, Dragonfly Doji, Gravestone Doji, Spinning Top, Pin Bar, Hammer, Inverted Hammer, Bullish Engulfing, Bearish Engulfing, and others. The rule triggers its execution count whenever any of the selected patterns is matched. | Yes | — |
Outputs
| Output | Description | List |
|---|---|---|
| Execution Count | The number of times a configured pattern has been detected. This value increments each time a pattern match occurs and can be connected to condition or comparison rules to trigger actions when a pattern is found. Use a Compare Switch rule to detect when the count changes (i.e., a new pattern has just been identified). | No |
Tips
Candlestick patterns are most effective when combined with other technical indicators for confirmation. For example, use a Hammer pattern detected at a Bollinger Band lower band or a key support level identified by a Donchian Channel to build a high-probability reversal entry. Connect the Execution Count output to a Compare Switch rule that compares the current count to the previous count (using an Offset of 1 on a Capture Value rule), and trigger a trade only when the count has increased. For trend-following strategies, use Engulfing patterns as entry signals but only when a Moving Average confirms the trend direction, filtering out counter-trend pattern signals that are more likely to fail.
Was this helpful? Let us know