Loading…

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

SettingDefaultWhat it does
Swing lookback5Bars required on each side to confirm a swing point
History bars500Bars of history scanned to rebuild the swing list each new bar
Impulse speed ratio1.30A leg counts as impulsive if its price-per-bar exceeds the prior leg's by this ratio
Max impulse overlap pct40.0Max overlap with the prior leg's range still allowed to call a leg impulsive
Max impulse retrace pct61.8Max retracement of the prior leg's length still allowed to call a leg impulsive
Min leg len pips20.0Legs shorter than this are excluded as noise
Extension multiple1.0Take-profit distance beyond entry, as a multiple of the measured impulse leg's length
Stop buffer pips5.0Extra buffer beyond the correction leg's own extreme for the stop
Use risk sizingtrueSize by percent risk to the stop instead of a fixed lot
Risk percent1.0Percent of equity risked per trade, when risk sizing is on
Fixed lots0.10Lot size when risk sizing is off, or as a sizing fallback
Magic number33501Magic number for orders opened by this EA
Slippage pips3Slippage tolerance, in pips
Max retries5Attempts per trade action before giving up
Retry wait ms500Pause between attempts, milliseconds

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 → Experts.
  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 expert advisor from the Navigator onto a chart, check the settings, allow Algo/Auto Trading and press OK.
  6. Test it first on a demo account or in the Strategy Tester.

Download the PDF guide

Tags: Risk & Lot Size · MT4 Expert Advisor · MQL4 Source Code

Expert advisors (EA) for MT4 & MT5 · PolyMaria