Loading…

Broadening Formation Detector

A broadening formation is the opposite of a triangle: instead of the range contracting, each new swing high is higher than the last AND each new swing low is lower than the last, so the two boundary lines fan apart rather than converge. Most manual chart-pattern scripts only look for CONVERGING lines (triangles, wedges, flags), so a genuine megaphone either gets missed entirely or gets mislabelled as a messy triangle that "isn't converging properly." This indicator scans confirmed swing pivots (a strict fractal test, the same alternating-swing construction used across this catalogue's other pattern indicators) and tests every new five-swing sequence for the diverging shape directly: three same-side pivots moving monotonically one way, two opposite-side pivots moving monotonically the other way. InpMinExpansionRatio then rejects sequences that technically alternate but barely widen - a near-parallel channel that happens to tick the boxes is not a real broadening top or bottom. The pattern is genuinely symmetric: a "Broadening Top" completing on a fresh high is treated as the bearish/exhaustion side, and a "Broadening Bottom" completing on a fresh low as the bullish/exhaustion side, matching how the pattern is usually read in practice (the last spike being the one most likely to fail). Notes and limitations A swing pivot only confirms InpSwingBars bars after it forms, so the pattern is identified with that much built-in lag by design - it does not repaint once plotted, but it also cannot flag the pattern before the confirming bars exist. This is a shape detector only: it does not predict which way price breaks out of the formation, and it does not manage a trade. Very short InpSwingBars values on tick or M1 charts will find broadening shapes that are mostly noise; the pattern is better suited to swing-level timeframes (M15 and above).

Indicator · MT4 · v1.0 · Free

About Broadening Formation Detector

Broadening Formation Detector is an indicator for MetaTrader 4. It draws buy and sell arrows on the chart and can alert you with a pop-up, sound, email or push message. It has 4 settings, such as Swing bars, Min expansion ratio and Show lines. MQL source code included.

Files in the download: BroadeningFormationDetector.ex4, BroadeningFormationDetector.mq4, BroadeningFormationDetector.txt.

Settings

SettingDefaultWhat it does
Swing bars5Bars each side required to confirm a swing
Min expansion ratio1.15Latest edge-to-edge width must exceed the earliest by this ratio
Show linestrueDraw the two diverging trendlines
AlertstrueAlert once when a new formation completes

How to install

  1. Download the ZIP from your PolyMaria library and unzip it.
  2. In MetaTrader 4 open File → Open Data Folder, then go to MQL4 → Indicators.
  3. Copy the .mq4 file(s) there. Put any .mqh files in MQL4 → Include.
  4. Open the .mq4 file in MetaEditor and press Compile (F7) if MetaTrader does not show it.
  5. Drag the indicator from the Navigator onto a chart and adjust the settings.

Download the PDF guide

Tags: Trend · Buy/Sell Arrows · Alerts · MT4 Indicator · MQL4 Source Code

MetaTrader 4 & 5 indicators · PolyMaria