Hammer and Shooting Star
- Indicators
- Version: 2.0
Hammer & Shooting Star — Precise Pattern Detector
Detects hammer and shooting star patterns with full control over body size, wicks, ratios, candle color, Bollinger Band filter, and N-candle confirmation. All symbols and timeframes.
Full Description
Hammer & Shooting Star is a professional candlestick pattern indicator for MetaTrader 5. It detects bullish hammers and shooting stars using a multi-layer filter system that provides precise control over every structural component of the candle — far beyond what a standard pattern detector offers.
Bullish Hammer → blue arrow below the candle low
Shooting Star → red arrow above the candle high
Works on all symbols and all timeframes.
How the Filters Work
All parameters apply symmetrically to both patterns. The indicator uses two direction-independent wick terms:
- Long wick = the dominant shadow (lower wick for hammer / upper wick for shooting star)
- Short wick = the small counter-shadow (upper wick for hammer / lower wick for shooting star)
You configure a single parameter set, and both patterns are filtered consistently.
Filter Groups
Body
Minimum and maximum body size in points. Filters out doji candles (body too small) and large engulfing candles (body too large).
Long Wick
Minimum and maximum length of the dominant shadow in points. The minimum enforces the characteristic spike; the maximum is unlimited by default.
Short Wick
Minimum and maximum length of the small counter-shadow. A classic hammer has almost no upper wick — a tight maximum enforces exactly that.
Ratios (set to 0 to disable)
Four independent ratio filters:
- Long wick / body ≥ X — dominant wick must be at least X times the body size
- Long wick / (body + short wick) ≥ X — dominant wick must outweigh the entire rest of the candle
- Short wick / body ≤ X — limits the relative size of the counter-shadow
- Body / short wick ≥ X — enforces body dominance over the short wick
Candle Color
Optional restriction of allowed body color:
- Hammer: allow or reject bearish (red) body
- Shooting Star: allow or reject bullish (green) body
Both body colors are allowed by default — patterns are defined purely by structure.
Previous Candles Filter
Defines how many preceding candles the hammer low (or shooting star high) must undercut:
- 0 = disabled
- 1 = low must be below the direct previous candle's low (default)
- N = low must undercut the lowest low of the last N candles
Bollinger Band Filter
Four independent checkboxes control whether the pattern candle must touch or break the Bollinger Band. Default:
- Hammer low touches/breaks below the lower band → ON
- Shooting Star high touches/breaks above the upper band → ON
Default Values
| Parameter | Default |
|---|---|
| Body | 100 – 800 points |
| Long Wick Minimum | 300 points |
| Short Wick Maximum | 600 points |
| Long Wick / Body | ≥ 1.5 |
| Long Wick / (Body + Short Wick) | ≥ 1.5 |
| Previous Candles Lookback | 1 |
| BB Period / Deviation | 18 / 1.8 |
| BB Filter | Low/High touches the band |
Technical Notes
- MetaTrader 5 (MQL5) only — not compatible with MT4
- No repainting on closed candles
- Lightweight: one internal Bollinger Band sub-indicator, two plot buffers
- Input validation on start — invalid min/max combinations are detected and reported
- Compatible with the Strategy Tester in visualization mode
For questions or feature requests please use the MQL5 comments section.
🤖 More Products
Use this indicator as an entry signal – or discover my fully automated Expert Advisors:
📈 Simple Range Breakout MT5 – Daily range breakout EA for all instruments
🔲 SimpleGridBot MT5 – Automatic bidirectional grid system
