Make the marubozu and gap rules measurable
TradingView describes bullish kicking as a bearish marubozu followed by a bullish marubozu that gaps above the first open. With zero shadows, that also separates the full ranges. To retain separation when allowing small shadows, this example uses the stricter full-range tests below. Let A be the previous candle and B the current candle. O, H, L and C are ordinary open, high, low and close prices.
- Reject zero-range candles, doji bodies, missing prices and OHLC records whose open or close lies outside the high-low range.
- The 5% tolerance permits at most 10% total shadow, so the body occupies at least 90% of the range. Set the tolerance to zero for exact marubozu.
- The 5% and 10-tick settings are illustrative choices, not TradingView defaults or optimized values. Ten ticks is an absolute size filter; it does not prove that a body is large relative to recent volatility.
- Equal gap endpoints fail: touching ranges leave no empty interval. An opening jump above the previous close alone is insufficient.
| Rule | Bullish kicking | Bearish kicking |
|---|---|---|
| Body directions | A-close < A-open; B-close > B-open | A-close > A-open; B-close < B-open |
| Each upper shadow | H - max(O, C) <= 5% of H - L | Same rule |
| Each lower shadow | min(O, C) - L <= 5% of H - L | Same rule |
| Each body size | abs(C - O) >= 10 minimum ticks | Same rule |
| Full gap | B-low > A-high | B-high < A-low |
| Decision time | B closes with every test true | B closes with every test true |