Japanese Candlestick Pattern Rules and Filters
Summary
This Pine library defines candle measurements and recognition rules for a broad set of Japanese candlestick patterns. It calculates body and wick sizes, candle range, gaps, and an EMA-based average body, then uses these quantities to identify formations such as doji, engulfing candles, hammers, and shooting stars. The exposed functions return pattern conditions, while companion functions can place chart labels and alerts.
Several detectors accept adjustable thresholds. For example, doji recognition compares body size with the full candle range and constrains the relative wick lengths; engulfing rules can limit the new candle’s rejection wick or require it to cover the prior candle’s full range. The library’s description cautions that some patterns lack filters for average candle size or trend context, leaving those choices to the developer. It provides implementation rules and visualization helpers, but no performance evidence or claim that detected patterns predict profitable trades.
Key ideas
- The library measures candle bodies, wicks, ranges, and gaps to support pattern recognition.
- Doji detection uses a configurable body-to-range limit and a balance condition between the two wicks.
- Engulfing detectors offer optional rejection-wick and full-range engulfing constraints.
- Some patterns omit average-size or trend filters, so developers must decide whether to add context.
- Pattern labels and alerts help display detections but do not establish trading value.
Tags
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.