Candle Patterns
Most published candlestick scanners plot a single generic arrow and leave you to work out which pattern actually fired. This one tags each signal with a short label - Hammer, Bull Engulf, Evening Star and so on - drawn next to the arrow, so the chart is readable without opening the code. Patterns are tested in a fixed priority order on every closed bar: three-bar patterns (Morning Star, Evening Star) first, then two-bar patterns (Engulfing, Harami), then one-bar patterns (Doji, Hammer, Shooting Star). The search stops at the first match, so a single bar never receives two conflicting tags even when more than one loose definition would technically apply. The trend context that Hammer and Shooting Star need - "did price just come down" or "did price just go up" - is read with a single comparison against a bar a fixed number of periods back, not a moving average. That keeps the file self-contained with no external calculation, at the cost of being a cruder trend read than a proper filter. It is documented here rather than hidden, because a scanner that silently mislabels its own trend filter as something more sophisticated than it is would be the more misleading choice. Notes and limitations - Every signal is confirmed on the bar's close - nothing is plotted on the forming bar, so nothing here repaints. - The nine patterns covered are a curated common set, not an exhaustive candlestick encyclopaedia; obscure or highly parameter-sensitive patterns (Three White Soldiers, Abandoned Baby, and similar) are intentionally left out to keep the false-positive rate manageable. - Dedicated single-pattern indicators elsewhere in this catalogue (Pin Bar Marker, Inside Bar Marker, Outside Bar Marker, Engulfing Marker, Three Bar Reversal) use their own thresholds and logic, coded independently - they will not always agree with this scanner bar for bar, by design. - Text labels are ordinary chart objects prefixed "CPX_" and are removed in OnDeinit; they do not survive a terminal restart without recalculation, which is normal indicator behaviour.
Indicator · MT5 · v1.0 · Free
About Candle Patterns
Candle Patterns is an indicator for MetaTrader 5. It draws buy and sell arrows on the chart, can alert you with a pop-up, sound, email or push message and marks candlestick patterns. It has 6 settings, such as Doji body ratio, Pin wick ratio and Opp wick ratio. MQL source code included.
Files in the download: CandlePatterns.ex5, CandlePatterns.mq5, CandlePatterns.txt.
Settings
| Setting | Default | What it does |
|---|---|---|
| Doji body ratio | 0.10 | Doji: body as a fraction of range, maximum |
| Pin wick ratio | 2.00 | Hammer/Star: dominant wick as a multiple of body |
| Opp wick ratio | 0.50 | Hammer/Star: opposite wick as a multiple of body, maximum |
| Trend lookback | 5 | Bars back compared against to judge the prior trend |
| Show labels | true | Draw a small text tag naming the pattern |
| Alerts | true | Alert once per closed bar on a new pattern |
How to install
- Download the ZIP from your PolyMaria library and unzip it.
- In MetaTrader 5 open File → Open Data Folder, then go to MQL5 → Indicators.
- Copy the .mq5 file(s) there. Put any .mqh files in MQL5 → Include.
- Open the .mq5 file in MetaEditor and press Compile (F7) if MetaTrader does not show it.
- Drag the indicator from the Navigator onto a chart and adjust the settings.
Tags: Candlestick Patterns · Dashboards & Scanners · Buy/Sell Arrows · Alerts · MT5 Indicator · MQL5 Source Code