Hikkake Trading System
The Hikkake pattern (Stocks & Commodities, 2003) is a three-step trap: an inside bar forms, the very next bar breaks the inside bar's range in one direction only, and if price closes back through that range in the OPPOSITE direction within a published confirmation window, the trapped side is caught offside - that close is the signal, fired in the reversal direction. This system runs the identical three-step test already published read-only in this catalogue's HikkakePatternDetector indicator, so a confirmed entry here always lines up with that indicator's arrows on the same chart - useful for visually auditing what the EA is trading without needing to trust a second, silently-different implementation. Two windows are published as explicit inputs rather than left implicit in the code: InpConfirmBars bounds how long after the false breakout the reversal close is allowed to arrive, and InpEntryExpiryBars bounds how many further bars after that confirmation the setup remains tradable before it is discarded as stale. A signal confirmed five bars ago is not the same trade opportunity as one confirmed on the bar that just closed, and this system treats it that way rather than firing on old news. Entry is a market order in the reversal direction. The stop sits beyond the inside bar's opposite extreme - the level the trapped side would need to reclaim to invalidate the trap - plus a small buffer, clamped to the broker's minimum stop distance. The target is a multiple of the inside bar's own range (InpTargetRR), so the trade's sizing is anchored to the pattern's own structure rather than a fixed pip count that ignores how tight or wide the trap actually was. Notes and limitations - One entry per confirmed signal: the confirmation bar's own time is the dedupe key, so a signal already acted on is never re-entered even if it remains inside its entry-expiry window on a later tick. - The pattern test only ever looks at fully closed bars - nothing is evaluated on the currently forming bar, so signals never repaint. - Like any single-pattern breakout system, Hikkake signals are more common in choppy conditions than clean trending ones; the confirmed reversal direction is a statistical edge on the published rule, not a guarantee against a further false move. - No trailing or partial-close management is included - the position runs to its fixed stop or target once entered.
Expert advisor · MT4 · v1.0 · Free
About Hikkake Trading System
Hikkake Trading System is an expert advisor (trading robot) for MetaTrader 4. It has 10 settings, such as Confirm bars, Entry expiry bars and Stop buffer pips. MQL source code included.
Files in the download: HikkakeTradingSystem.ex4, HikkakeTradingSystem.mq4, HikkakeTradingSystem.txt.
Trading robots can lose money. Check every setting and test on a demo account before using real funds.
Settings
| Setting | Default | What it does |
|---|---|---|
| Confirm bars | 3 | Bars allowed, after the false breakout, for the reversal close to confirm (published confirmation wi |
| Entry expiry bars | 2 | Bars after confirmation still valid for entry, after which the setup is discarded (published entry-e |
| Stop buffer pips | 2.0 | Extra buffer, in pips, added beyond the inside bar's opposite extreme |
| Target rr | 1.5 | Take-profit as a multiple of the inside bar's own range, 0 = no target |
| Lots | 0.10 | Fixed lot size per entry |
| Magic number | 20260380 | Magic number for orders placed by this EA |
| Slippage pips | 3 | Slippage tolerance, in pips |
| Max retries | 5 | Attempts per order before giving up |
| Retry wait ms | 500 | Pause between attempts, milliseconds |
| One trade at a time | true | Skip new signals while a position from this EA is already open |
How to install
- Download the ZIP from your PolyMaria library and unzip it.
- In MetaTrader 4 open File → Open Data Folder, then go to MQL4 → Experts.
- Copy the .mq4 file(s) there. Put any .mqh files in MQL4 → Include.
- Open the .mq4 file in MetaEditor and press Compile (F7) if MetaTrader does not show it.
- Drag the expert advisor from the Navigator onto a chart, check the settings, allow Algo/Auto Trading and press OK.
- Test it first on a demo account or in the Strategy Tester.
Tags: Breakout · Candlestick Patterns · Buy/Sell Arrows · MT4 Expert Advisor · MQL4 Source Code