FxMath Harmonic Hunter — MT5 Suite Complete technical documentation
A professional harmonic-pattern trading suite for MetaTrader 5, written in pure MQL5. It consists of three Expert Advisors that work together to scan the market, display results, draw patterns and manage trades — plus a reference sheet for the classic harmonic patterns.
Harmonic Hunter Scanner
Scans a grid of Pairs × Timeframes, detects the highest-accuracy harmonic
pattern per symbol/TF and lists it in an on-chart table with full trade levels.
Writes the shared .Pouya settings file for the Helper.
Scanner Panel (recommended)
Same scanning engine, but results are shown in a scrollable, sortable and filterable panel — mouse-wheel scrolling, click-to-sort on every column and a filter toolbar. Ideal when more patterns exist than fit on screen.
Chart Helper
Attach to any chart to draw the current pattern (triangles, ratios, channel), show Entry / SL / TP levels, open Instant / Stop / Limit orders via CTrade and manage positions with partial close + breakeven.
Pattern Reference
The classic harmonic patterns (Gartley, Bat, Crab, Butterfly, Cypher, Shark…) with their Fibonacci ratio tables, plus the geometric Wolfe Waves rules.
📦 Files in this package
| File | Type | Role |
|---|---|---|
| FxMath_Harmonic_Hunter_Scanner(MT5).mq5 / .ex5 | EA | Classic scanner — fixed grid table, writes the shared settings file. |
| FxMath_Harmonic_Hunter_Scanner_Panel(MT5).mq5 / .ex5 | EA | Panel version of the Scanner — scrollable / sortable / filterable table. |
| FxMath_Harmonic_Hunter_Helper(MT5).mq5 / .ex5 | EA | Chart helper — draws patterns, opens & manages trades, ML filter. |
| Harmonic_Patterns_Reference.txt | Reference | Classic pattern names and Fibonacci ratio tables (incl. Wolfe Waves). |
| README.md | Docs | Project read-me with feature log and session work log. |
🏗️ How the EAs work together
The three EAs form a scanner → helper pipeline. The Scanner (either flavour) discovers patterns and broadcasts its settings; the Helper consumes those settings and turns a pattern into a real trade.
Scanner runs on any chart
Scans the Pairs × TFs grid with an in-EA ZigZag engine, keeps only the
highest-accuracy pattern per symbol+timeframe and draws the result table. On attach it
writes <AccountLogin>.Pouya into MQL5\Files\ with
accuracy, depths, scan window, pattern age, TP level, trading mode, magic number,
colors, etc.
Helper attaches to a trade chart
On attach it reads the same .Pouya file, so its behaviour
(accuracy, depth range, TP level, partial close, breakeven, magic, colors) matches the
Scanner's settings.
Helper finds & draws the pattern
It re-runs the same detection on the chart symbol/timeframe and draws triangles, ratio labels, the AC channel and the trade levels (Open, TP1–3, SL). A 2-second timer keeps it working even when the market is closed.
Trade execution
Click Instant Order (market), Stop Order or
Limit Order (entry at the pattern Open Price) — all via the standard
CTrade class with the Scanner's magic number, comment and expiry.
Position management
The Helper watches its own positions and, when price travels
BE_Ratio_Distance of the entry→TP distance, closes
Close_Partial_Ratio of the volume and/or moves the stop to breakeven.
.Pouya file is
rewritten; the Helper picks up the new values on its next attach. The Helper's
filter/ML settings are the exception — they are live runtime variables controllable from
the on-chart Settings panel.
🧪 Interactive demo — Panel filter behaviour
This small demo mirrors the Panel Scanner's filter toolbar. Click the buttons to see how Type / Pattern / Timeframe / Acc / Age filters combine in real time.
| Pair | TF | Pattern | Type | Open | SL | TP1 | Acc | Age |
|---|---|---|---|---|---|---|---|---|
| EURUSD | H1 | Bearish Bat | SELL | 1.0875 | 1.0911 | 1.0839 | 94% | 3 |
| GBPUSD | M15 | Bullish Gartley | BUY | 1.2712 | 1.2680 | 1.2748 | 88% | 7 |
| XAUUSD | H4 | Bearish Crab | SELL | 2385.4 | 2401.2 | 2369.0 | 91% | 2 |
| USDJPY | H1 | Bullish Butterfly | BUY | 155.82 | 154.90 | 156.66 | 79% | 12 |
| AUDUSD | M30 | Bearish Cypher | SELL | 0.6587 | 0.6612 | 0.6559 | 85% | 5 |
| BTCUSD | D1 | Bullish Shark | BUY | 61200 | 59800 | 62400 | 73% | 21 |
| EURJPY | M5 | Bullish AB=CD | BUY | 169.24 | 168.91 | 169.60 | 97% | 1 |
Filters apply instantly to stored results without a re-scan, combine with sorting and scrolling, and are fully implemented in the Panel version of the Scanner.
✨ Key features at a glance
🔍 In-EA ZigZag
Faithful port of MetaQuotes' Examples\ZigZag
(deviation 5×point, backstep 3), cached per (symbol, timeframe, depth) — no external indicator needed.
🎯 Best-accuracy selection
When several patterns match one Pair+TF, only the single highest-accuracy candidate is emitted (ties broken by the newest D point).
📊 Graded accuracy
The Acc column is graded against unscaled table bounds: 100% = exact table match, lower toward the tolerance edges — not always 100.
🛰️ Timer-driven scans
Real EventSetTimer updates (minutes), so
results stay fresh even with a closed market / quiet chart / zero ticks.
🔔 Notifications
Alert, Email, Push and optional Telegram (WinInet
httpGET) on every emitted signal, with a signature line.
🧠 ML signal filter
The Helper trains an in-EA logistic-regression model on its
own chart history (pure MQL5 — no ONNX/DLL) and shows a ML % badge.
🛠️ Installation
- Copy the
.mq5/.ex5files toMQL5\Experts\of your MetaTrader 5 data folder. - Copy
Harmonic_Hunter_Scanner(MT5).tpl(if you use it) toMQL5\Profiles\Templates\. - In the terminal, enable Tools → Options → Expert Advisors → Allow DLL imports
(required only for the Telegram/version-check
httpGETcalls — the core scan works without it). - Drag the Scanner onto any chart (it scans the configured list, not the chart itself).
- Drag the Helper onto the chart of a symbol you want to trade.
- Press Scan Market on the Scanner, then use the View buttons to open charts, or the Helper's Trading Options panel to trade.