Impulse Correction Sequence System
"Wait for an impulse, then a correction, then trade the next impulse" is a common discretionary pattern that is usually applied by eye, which makes it unautomatable and inconsistent between traders. This system reuses the objective classifier from the ImpulseCorrectionSegmenter indicator (reimplemented here so this file stays a self-contained submission): a leg is judged impulsive against the leg immediately before it purely from three measurements - speed (price moved per bar), overlap (how much of the prior leg's price range this leg re-enters) and retracement (how much of the prior leg's length it gives back). No wave-count or Elliott-degree claim is made anywhere in this file, deliberately - it is a heuristic classifier built from three numbers, not a wave-counting engine. The system rebuilds a confirmed-swing list each new bar and looks at the last two completed legs: the first must classify as impulsive against the leg before IT, and the second must classify as NOT impulsive against the first (i.e. genuinely slower and/or more overlapping - a real correction, not just a smaller impulse in the same direction). Once that two-leg sequence is confirmed, the system watches for a closed bar clearing the first leg's own extreme again - the objective "the correction ended and the sequence resumed" signal this file uses to enter the third leg. The stop sits beyond the correction leg's own extreme; the target is the entry plus a configurable multiple of the measured first leg's length, the natural "another leg like the first one" extension the sequence implies. Notes and limitations - This is a heuristic classifier built from three measured numbers, not an Elliott Wave engine - it makes no wave-count or degree claim, and a genuine three-wave or five-wave structure by any other method may classify differently here. - Legs are classified only after InpSwingLookback bars confirm each swing point, so both the sequence check and the entry lag the market by that many bars - inherent to any swing-confirmation approach. - Only one position at a time. - Lot sizing uses MODE_TICKVALUE/MODE_TICKSIZE, not a hardcoded contract size. - A sequence that "resumes" briefly and then reverses (a failed continuation) is traded like any other entry and stopped out at the correction leg's extreme - this is inherent to the method.
Expert advisor · MT4 · v1.0 · Free
About Impulse Correction Sequence System
Impulse Correction Sequence System is an expert advisor (trading robot) for MetaTrader 4. It can size trades from your balance and risk percent. It has 15 settings, such as Swing lookback, History bars and Impulse speed ratio. MQL source code included.
Files in the download: ImpulseCorrectionSystem.ex4, ImpulseCorrectionSystem.mq4, ImpulseCorrectionSystem.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 |
|---|---|---|
| Swing lookback | 5 | Bars required on each side to confirm a swing point |
| History bars | 500 | Bars of history scanned to rebuild the swing list each new bar |
| Impulse speed ratio | 1.30 | A leg counts as impulsive 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 still allowed to call a leg impulsive |
| Max impulse retrace pct | 61.8 | Max retracement of the prior leg's length still allowed to call a leg impulsive |
| Min leg len pips | 20.0 | Legs shorter than this are excluded as noise |
| Extension multiple | 1.0 | Take-profit distance beyond entry, as a multiple of the measured impulse leg's length |
| Stop buffer pips | 5.0 | Extra buffer beyond the correction leg's own extreme for the stop |
| Use risk sizing | true | Size by percent risk to the stop instead of a fixed lot |
| Risk percent | 1.0 | Percent of equity risked per trade, when risk sizing is on |
| Fixed lots | 0.10 | Lot size when risk sizing is off, or as a sizing fallback |
| Magic number | 33501 | Magic number for orders opened by this EA |
| Slippage pips | 3 | Slippage tolerance, in pips |
| Max retries | 5 | Attempts per trade action before giving up |
| Retry wait ms | 500 | Pause between attempts, milliseconds |
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: Risk & Lot Size · MT4 Expert Advisor · MQL4 Source Code