Japanese Candlestick Patterns Indicator for MT4 and MT5

Written by Dominic Walsh · Published · Last updated

Ask five traders what counts as a doji and you get five answers. The japanese candlestick patterns indicator removes the argument by turning each definition into a number: body against range for one shape, shadow against body for another, and a tolerance for the third.

This build ships as a compiled .ex4 for MT4 and .ex5 for MT5; the screenshots below come from EURUSD H1.

Platforms MT4 (.ex4) + MT5 (.ex5)
Chart window Main price chart
Plots 2: Bullish Pattern, Bearish Pattern
Alerts popup
Inputs 9

What you see once it loads

Two arrow plots plus text labels.

`Bullish Pattern` prints lime using arrow 233.

`Bearish Pattern` prints red using arrow 234.

`InpShowLabels` names the shape beside each mark.

Marks stand `InpArrowOffsetPts` `80` clear of the bar.

Every object name starts with `InpObjPrefix` `”JCP_”`.

  • Bullish Pattern: arrow, lime, width 2, arrow code 233
  • Bearish Pattern: arrow, red, width 2, arrow code 234
japanese candlestick patterns indicator: A labelled bullish shape on the EURUSD H1 chart.
A labelled bullish shape on the EURUSD H1 chart.

How the values come out

What counts as a doji

`InpBodyToRangeMax` `0.30` is the ceiling. A bar whose body takes up less than thirty percent of its full range counts, which is a generous definition rather than a strict one.

What counts as a hammer

`InpShadowRatio` `2.0` demands one shadow be at least twice the body. Raise it and only the most pronounced examples qualify; lower it and ordinary bars start counting.

The two-bar test

`InpEngulfTolerance` `0.0` asks the body to cover the one before it exactly. Give it a value and a near miss gets through, which loosens the rule a good deal.

Reading the result

Every shape is a ratio test, not a judgement.

A mark reports the shape, not a direction to trade.

Labels name which pattern was found.

Eighty points is a generous gap from the bar.

All three definitions are yours to tighten.

Marks confirm on closed bars only.

Alert channels in this build: popup, one message per closed bar.

`InpAlertOnPattern` `true` raises a terminal message when a fresh shape appears on a closed bar. The terminal is the only destination in this build, with no phone, mail or audio setting anywhere in the panel.

Every Japanese Candlestick Patterns Indicator input

Core settings

Setting What it does Default
InpBodyToRangeMax max body/range for Doji. Largest body share a doji may have, `0.30`. 0.30
InpShadowRatio shadow >= ratio * body for Hammer/Star. Shadow multiple a hammer needs, `2.0`. 2.0
InpEngulfTolerance engulfing body extension tolerance. Slack allowed on an engulfing body, `0.0`. 0.0
InpObjPrefix object name prefix. Prefix on every object name, `”JCP_”`. JCP_

Display settings

Setting What it does Default
InpShowLabels show text labels. Name each shape in text, `true`. on
InpArrowOffsetPts arrow offset in points. Points between a mark and its bar, `80`. 80
InpBullColor (see inputs panel) lime
InpBearColor (see inputs panel) red

Alert settings

Setting What it does Default
InpAlertOnPattern alert on new pattern. Speak when a new shape appears, `true`. on
japanese candlestick patterns indicator: Inputs panel, the three ratio settings together.
Inputs panel, the three ratio settings together.

Choosing where it lives

Candlestick shapes mean most where each bar represents real trading activity. EURUSD H1 is the reference chart. On M1 the shapes are mostly spread artefacts. On D1 a hammer is the kind of bar people actually write about.

Where the logic runs out

A thirty percent body is a loose doji rule.

A shape means little without the trend around it.

Zero slack makes the two-bar test a rare one.

Marks report the shape and nothing more.

Copy the compiled Japanese Candlestick Patterns Indicator file into your MQL4/Indicators folder, and the MT5 build into MQL5/Indicators, then restart the terminal and drag it onto a chart. The step-by-step guide with screenshots is at how to install MT4 and MT5 indicators.

Download the Japanese Candlestick Patterns Indicator for MT4 and MT5

The zip holds the compiled Japanese Candlestick Patterns Indicator build for MT4 and MT5, plus a short README. Compiled files only, no source. Enter your email below and the download link arrives in your inbox.

Download this indicator free

Enter your email and the file is yours. You also get the full MT4 and MT5 library.

  • 1,380+ indicators
  • MT4 and MT5 files
  • No spam, unsubscribe any time

FAQ

Is InpBodyToRangeMax 0.30 a tight doji rule?

No, it is loose on purpose. A textbook doji has almost no body, while thirty percent of the range lets through bars most traders would just call small. Try ten as a first change.

What does InpShadowRatio 2.0 compare?

The length of one shadow against the length of the body. Twice the body is the common threshold for a hammer, and raising it leaves only the most pronounced examples earning a mark.

Why does InpEngulfTolerance start at zero?

It asks the current body to cover the one before it with no slack at all. That is the strict reading of the shape, so raise it a little if you want near misses to count as well.

What does InpShowLabels add beside a mark?

The name of the shape that was found. Without it a lime arrow could be any of several bullish shapes, and knowing which one appeared is usually what decides whether it matters.

Are results guaranteed?

No. Trading involves risk. Results are not guaranteed; past performance is not indicative of future results. Use the Japanese Candlestick Patterns Indicator as one input. Always backtest before trading live.

Category: this is part of our Candle Sticks collection. Then, plainly, browse more Candle Sticks for MetaTrader, or explore every MT4 indicator and MT5 indicator on the site.

External references

Dominic Walsh - Forex trader and MT4/MT5 developer

About the author

Written by Dominic Walsh, a Forex trader and MT4/MT5 indicator, Expert Advisor and script developer. Every tool on forexmt4systems.com is tested on live charts before release and ships with ready-to-use compiled MT4 (.ex4) and MT5 (.ex5) files. Learn more about the trader and developer behind this site.

How we build, test and correct every tool: Editorial & Testing Policy. Trading carries risk; see the disclaimer.

Leave a Comment