Japanese Candlestick Secrets & Pattern Recognition
Deconstruct candlestick anatomy (OHLC), decode liquidity wicks and institutional rejection bars, and write programmatic candle pattern detectors.
1. The Four Pillars of Every Candle (OHLC)
Every candlestick represents a compressed battle between buyers and sellers over a specific timeframe (e.g. 1m, 5m, 1h, 1D):
- Open (O): Price at the start of the period.
- High (H): The highest price reached during the period.
- Low (L): The lowest price reached during the period.
- Close (C): Price at the conclusion of the period.
2. High-Probability Candlestick Formations
The Pinbar / Hammer (Rejection Candle)
Features a small real body and a long lower or upper wick (at least 2x the body size). Indicates that aggressive sellers pushed price down, but strong institutional limit orders absorbed all selling pressure and violently pushed price back up.
The Bullish / Bearish Engulfing
A multi-candle reversal pattern where the body of the second candle completely covers or "engulfs" the body of the previous opposite candle, signaling a decisive shift in market control.
3. Programmatic Candlestick Pattern Detector
Python (Candle Pattern Detection)
def is_bullish_pinbar(open_p, high, low, close_p):
body = abs(close_p - open_p)
candle_range = high - low
lower_wick = min(open_p, close_p) - low
upper_wick = high - max(open_p, close_p)
# Rules: Lower wick must be >= 60% of total range, upper wick < 15%
if candle_range == 0: return False
return (lower_wick / candle_range >= 0.60) and (upper_wick / candle_range <= 0.15)
# Example check
candle = {"O": 1.0820, "H": 1.0825, "L": 1.0780, "C": 1.0822}
print("Is Bullish Pinbar:", is_bullish_pinbar(candle['O'], candle['H'], candle['L'], candle['C'])) # True
4. Knowledge Check Exam
📝 Chapter 04 Certification Quiz
100 XP
What does a long lower wick on a daily candlestick typically signal to a quantitative algorithm?