Quasimodo Pattern Detector
The Quasimodo pattern - also called over-and-under, or head-and- shoulders-in-reverse depending on which trading community teaches it - is defined by a specific five-point sequence and one detail that separates it from an ordinary head-and-shoulders: the right shoulder fails to reach the left shoulder's level before reversing. A bearish Quasimodo runs low, higher high (left shoulder), lower low (head, the deepest point), lower high than the left shoulder (right shoulder - the failure), then a close below the low between the left shoulder and the head (the neckline break). A bullish Quasimodo is the same shape inverted. This indicator confirms alternating swing points with the standard K-bars-each-side fractal test, then walks every consecutive five-point window checking the shape rule - including the right-shoulder-fails- to-reach-left-shoulder condition explicitly, since that is exactly the detail most "Quasimodo" scripts skip, drawing an ordinary head-and-shoulders instead and calling it the wrong name. Nothing is marked until a later CLOSED bar's close actually trades through the neckline price; a pattern shape that never breaks its neckline is never drawn, the same wait-for-confirmation discipline used elsewhere in this catalogue's pattern detectors (compare DoubleTopBottom). The naive version of this pattern detector marks the pattern the moment the fifth swing point prints, before the neckline has broken - plenty of shapes that look like a Quasimodo never actually break their neckline and are not the pattern a discretionary trader would call complete. This version waits for that break. Notes and limitations - Nothing is drawn until the neckline breaks - a shape matching the five-point rule that never breaks its neckline is never marked, by design. - Swing confirmation carries an InpSwingLookback-bar delay before each of the five points is known, on top of however long the market takes to break the neckline afterward - both delays are inherent to using confirmed swings rather than live, unconfirmed price action. - The pattern search checks every consecutive five-swing window independently, so overlapping candidate windows sharing swing points can both qualify and both draw if their shapes both pass - this is not filtered down to "one pattern per swing cluster". - No trade or stop-loss logic - visual and alerting only.
Indicator · MT4 · v1.0 · Free
About Quasimodo Pattern Detector
Quasimodo Pattern Detector is an indicator for MetaTrader 4. It can alert you with a pop-up, sound, email or push message. It has 6 settings, such as Swing lookback, Max pattern bars and Show labels. MQL source code included.
Files in the download: QuasimodoDetector.mq4, QuasimodoDetector.txt.
Settings
| Setting | Default | What it does |
|---|---|---|
| Swing lookback | 4 | Bars required on each side to confirm a swing point |
| Max pattern bars | 200 | Maximum bars allowed from left shoulder to neckline break |
| Show labels | true | Draw text labels on the shoulder/head points |
| Alerts | true | Alert once when a neckline actually breaks |
| Bearish color | clrOrangeRed | Colour on the chart |
| Bullish color | clrLime | Colour on the chart |
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 → Indicators.
- 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 indicator from the Navigator onto a chart and adjust the settings.
Tags: Price Action · Alerts · MT4 Indicator · MQL4 Source Code