Bat Harmonic Pattern Indicator Access Indicator: XABCD

Written by Dominic Walsh · Published · Last updated

The bat harmonic pattern indicator access indicator hunts one shape. Five pivots form four legs. Each leg gets measured against the one before it. Only ratios inside the four bands earn a mark at point D.

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

Platforms MT4 (.ex4) + MT5 (.ex5)
Chart window Main price chart
Plots 3: XABCD, Buy, Sell
Alerts popup, push notification, email, sound
Inputs 16

What the Bat Harmonic Pattern Indicator Access Indicator draws on the chart

A dark orange `XABCD` zigzag joins the five pivots.

`Buy` uses arrow 233 in lime and `Sell` uses 234 in red.

Text objects label the points on the chart.

Each mark sits `ArrowOffsetPoints` `50` points from the candle at D.

  • XABCD: zigzag, dark orange, width 2
  • Buy: arrow, lime, width 4, arrow code 233
  • Sell: arrow, red, width 4, arrow code 234
Bat harmonic pattern indicator access indicator XABCD legs and arrows on EURUSD H4.
Bat harmonic pattern indicator access indicator XABCD legs and arrows on EURUSD H4.

How the Bat Harmonic Pattern Indicator Access Indicator calculates its values

Fractal pivots first

`Depth` `7` decides a fractal high or low. The code keeps up to `MaxPivots` `40` of them and works backward through that list.

Four ratio bands

AB against XA must land between `AbLo` `0.35` and `AbHi` `0.55`. BC against AB must land between `BcLo` `0.3` and `BcHi` `0.9`. CD against BC must land between `CdLo` `1.6` and `CdHi` `2.65`.

Tolerance widens each band

`RatioTol` `0.12` gets added at both ends of every band. Real price rarely lands on a textbook ratio, so a hard edge would find almost nothing. That slack is why matches appear at all.

How to read the signals

A mark lands at D, the last pivot of the five.

The zigzag shows exactly which legs the ratio test used.

D sitting at a swing low gives the bullish case.

Legs come from fractals, so a pattern completes several bars after D forms.

Alert channels in this build: popup, push notification, email and sound, one message per closed bar.

`EnableAlerts` is the master toggle and starts true, with `EnablePopup` giving the terminal window. `EnablePushNotify` handles mobile, `EnableEmail` handles mail and `EnableSound` plays `SoundFile`. Those three arrive off. Alerts wait for a bar to close.

Every Bat Harmonic Pattern Indicator Access Indicator input

Core settings

Setting What it does Default
Depth Bars either side that confirm a fractal, default `7`. 7
MaxPivots How many pivots stay in the working list, default `40`. 40
AbLo Floor for the AB against XA ratio, default `0.35`. 0.35
AbHi Ceiling for that same ratio, default `0.55`. 0.55
BcLo Floor for the BC against AB ratio, default `0.3`. 0.3
BcHi Ceiling for that same ratio, default `0.9`. 0.9
CdLo Floor for the CD against BC ratio, default `1.6`. 1.6
CdHi Ceiling for that same ratio, default `2.65`. 2.65
RatioTol Slack added to both ends of every band, default `0.12`. 0.12

Display settings

Setting What it does Default
ArrowOffsetPoints Points between the mark and the candle at D, default `50`. 50

Alert settings

Setting What it does Default
EnableAlerts Master toggle for pattern alerts, default `true`. on
EnablePopup Terminal window on a completed pattern, default `true`. on
EnablePushNotify (see inputs panel) off
EnableEmail (see inputs panel) off
EnableSound (see inputs panel) off
SoundFile (see inputs panel) alert.wav
Bat harmonic pattern indicator access indicator inputs panel with Depth and the ratio bands.
Bat harmonic pattern indicator access indicator inputs panel with Depth and the ratio bands.

Settings that fit your chart

The screenshot note picks H4 for clean, well separated legs. Harmonic shapes want room, and a fractal at `Depth` `7` needs seven bars either side. On M5 the legs blur together. Daily bars give very few patterns a year.

When the Bat Harmonic Pattern Indicator Access Indicator fails

A fractal at depth seven confirms seven bars late, so D is history by the time it marks.

`RatioTol` `0.12` is generous, which lets shapes through that a purist would reject.

Only one ratio set ships here, so other harmonic shapes go unmarked.

Copy the compiled Bat Harmonic Pattern Indicator Access 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.

Background reading on the method behind the Bat Harmonic Pattern Indicator Access Indicator: Ultra-low latency direct market access on Wikipedia, Speed Resistance Lines at StockCharts ChartSchool.

Download the Bat Harmonic Pattern Indicator Access Indicator for MT4 and MT5

The zip holds the compiled Bat Harmonic Pattern Indicator Access 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

What does Depth 7 define?

A fractal pivot. The bar has to beat seven bars on each side before it counts as a swing point. That makes pivots reliable and late in equal measure, since seven newer bars must close first.

How wide does RatioTol 0.12 make each band?

It adds twelve hundredths at both ends. So the AB band of `0.35` to `0.55` effectively runs from 0.23 to 0.67. Real swings rarely hit a textbook ratio, and without that slack matches would be extremely rare.

What decides a Buy rather than a Sell?

Where point D sits. A D that is a swing low gives the bullish case and fills the buy plot. A D at a swing high fills the sell plot. The ratio test itself is identical for both.

Why is ArrowOffsetPoints 50 so large?

Because harmonic legs on H4 cover a lot of ground, and a small gap would bury the mark in the candle. Fifty points reads well on a four-hour chart. Reduce it if you drop to a faster timeframe.

Are results guaranteed?

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

Category: this is part of our Support and Resistance collection. Also, still, hence, plainly, truly, browse more Support and Resistance 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