Doji Detector
A Doji is a candle whose open and close finished almost equal, so the body is negligible next to the bar's own high-low range. On its own that just means indecision - but the shape of the wicks around that tiny body tells a more specific story, and this indicator reads it: - Dragonfly: a long lower wick with little or no upper wick. Price was pushed well below the open/close and rejected back up - a lower-wick rejection. - Gravestone: the mirror image, a long upper wick with little or no lower wick - an upper-wick rejection. - Standard: wicks on both sides, neither long enough alone to call it directional - genuine indecision. Only fully closed bars are tested. The bar currently forming has an unknown final range, so it is never marked, and once a closed bar is marked the classification is a plain fact about that bar's own open/high/low/close - it never gets revised on a later tick. Notes and limitations - A zero-range bar (high equals low) is skipped outright rather than treated as a perfect Doji. - No trend or volume context is attached - a Dragonfly at the bottom of a decline and a Dragonfly in the middle of a range are marked identically. Read the label against your own chart context. - Removes its own text tags in OnDeinit; the diamond marker itself is an ordinary indicator buffer and survives a template change on its own.
Indicator · MT5 · v1.0 · Free
About Doji Detector
Doji Detector 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 4 settings, such as Max body ratio, Long wick ratio and Show labels. MQL source code included.
Files in the download: DojiDetector.ex5, DojiDetector.mq5, DojiDetector.txt.
Settings
| Setting | Default | What it does |
|---|---|---|
| Max body ratio | 0.10 | Body, maximum, as a fraction of the bar's range |
| Long wick ratio | 0.60 | Wick, minimum, as a fraction of range to count as "long" |
| Show labels | true | Draw a small text tag naming the sub-type |
| Alerts | true | Alert once per closed bar on a new Doji |
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 · Buy/Sell Arrows · Alerts · MT5 Indicator · MQL5 Source Code