Impulse Correction Segmenter
Discretionary structure traders talk about "impulsive" and "corrective" legs constantly, but almost nothing in the standard MT4 indicator set tries to label that distinction objectively. This indicator confirms alternating swing highs and lows with the usual K-bars-each-side fractal test, then for every leg after the first compares it against the immediately preceding leg on three measures: speed (price moved per bar, versus the prior leg's price-per-bar), overlap (how much of the prior leg's price range this leg re-enters), and retracement (what fraction of the prior leg's length this leg gives back). A leg is drawn as Impulse only when it clears all three bars at once - faster than the prior leg by a configurable ratio, and staying reasonably clear of the prior leg's price territory. Anything else is drawn as Correction. This is stated plainly because it needs to be: this is a heuristic classifier built from OHLC bar geometry, not an Elliott Wave engine. It makes no wave-count, no wave-degree, and no rule-of-alternation claim beyond the three numbers behind each label. A fast, low-overlap countertrend leg inside a larger corrective structure will still be labelled Impulse here, because by the measures used it behaves like one locally - the label describes leg character relative to its immediate predecessor, not a position in some larger count. The naive version of this only checks speed, which mislabels a fast leg that barely moves price because it never leaves the prior leg's range - real impulsive legs both move quickly and cover new price territory. Checking overlap and retracement alongside speed catches that case. Notes and limitations - Not an Elliott Wave counter. No wave numbering, degree, or rule of alternation is implied - each label reflects only the three measured comparisons against the immediately preceding leg. - The very first leg in the loaded history has no prior leg to compare against and is left unlabelled. - Swing confirmation carries the usual InpSwingLookback-bar delay before a leg's endpoint is finalised - nothing here repaints once drawn, but a leg's far end is only known that many bars after it actually happened. - Overlap and retracement are computed identically here since both measure how much of the prior leg's price length this leg re-enters - the description separates them conceptually but the calculation is the same overlap figure used both ways. - No trade or stop-loss logic - visual structure labelling only.
Indicator · MT4 · v1.0 · Free
About Impulse Correction Segmenter
Impulse Correction Segmenter is an indicator for MetaTrader 4. It has 7 settings, such as Swing lookback, Impulse speed ratio and Max impulse overlap pct. MQL source code included.
Files in the download: ImpulseCorrectionSegmenter.ex4, ImpulseCorrectionSegmenter.mq4, ImpulseCorrectionSegmenter.txt.
Settings
| Setting | Default | What it does |
|---|---|---|
| Swing lookback | 5 | Bars required on each side to confirm a swing point |
| Impulse speed ratio | 1.30 | A leg is a speed-impulse if its price-per-bar exceeds the prior leg's by this ratio |
| Max impulse overlap pct | 40.0 | Max overlap with the prior leg's range, as a percentage, still allowed to call this leg impulsive |
| Max impulse retracee pct | 61.8 | Max retracement of the prior leg's length still allowed to call this leg impulsive |
| Show labels | true | Draw the Impulse/Correction text label on each leg |
| Impulse color | clrLime | Colour on the chart |
| Correction color | clrOrangeRed | 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: Fractals · Elliott Wave · MT4 Indicator · MQL4 Source Code