Marubozu Detector
A Marubozu is a candle where the open and close sit at (or almost at) the extremes of the bar: a bullish Marubozu opens near the low and closes near the high, a bearish one opens near the high and closes near the low. Either way, buyers or sellers were in control from the first tick to the last with no meaningful wick to show a fight back. The test compares each wick separately against the bar's full high-low range, so a bar with one long wick and one short wick is correctly rejected even if its average wick looks small - both sides have to be tight for it to count. 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 verdict is a plain fact about that bar's own high/low/open/close - it never gets revised on a later tick. Notes and limitations - A zero-range bar (high equals low, which can happen on illiquid symbols or during a feed gap) is skipped outright rather than treated as a perfect Marubozu. - This is a single-bar pattern with no trend or volume filter attached - it flags shape only. Combine with your own context (session, prior structure, volatility regime) before treating it as a trade signal. - Uses no chart objects - both plots are ordinary indicator buffers, so the markers survive a template change and there is nothing to clean up in OnDeinit.
Indicator · MT5 · v1.0 · Free
About Marubozu Detector
Marubozu Detector is an indicator for MetaTrader 5. It draws buy and sell arrows on the chart and can alert you with a pop-up, sound, email or push message. It has 2 settings, such as Max wick ratio and Alerts. MQL source code included.
Files in the download: MarubozuDetector.ex5, MarubozuDetector.mq5, MarubozuDetector.txt.
Settings
| Setting | Default | What it does |
|---|---|---|
| Max wick ratio | 0.05 | Each wick, maximum, as a fraction of the bar's range |
| Alerts | true | Alert once per closed bar on a new Marubozu |
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: Buy/Sell Arrows · Alerts · MT5 Indicator · MQL5 Source Code