Loading…

Noise Filtered Breakout System

A plain N-bar Donchian breakout - the previous closed bar's close clearing the highest high or lowest low of the last InpBreakoutLookback bars - fires on price level alone, and price level says nothing about how the market got there. A level can be reached by a clean directional run or by a market thrashing sideways that happens to touch a new extreme; the breakout looks identical either way, but the odds of it continuing are not. This system measures that distinction directly with Kaufman's Efficiency Ratio: net directional travel over InpNoiseLookback bars, divided by the sum of every bar-to-bar absolute change across the same window. A ratio near 1.0 means price walked in close to a straight line - low microstructure noise. A ratio near 0 means the same net distance was covered by a lot of back-and-forth, cancelling itself out along the way - high noise, and any breakout produced under those conditions is treated as more likely a fake. A breakout is only traded when the Efficiency Ratio at that moment is at or above InpMinEfficiency; otherwise the level is acknowledged in the log and declined. Notes and limitations - One position at a time. New breakouts are only evaluated while flat. - The Efficiency Ratio gate can decline every breakout for long stretches in a genuinely choppy market - fewer trades is the intended effect of the filter, not a malfunction. - The stop and target are fixed at entry with no trailing management. - A ratio of exactly 0 (pathLength computing to zero, which needs a perfectly flat window) is treated as maximally noisy and always declines the breakout. - Lot sizing uses MODE_TICKVALUE/MODE_TICKSIZE, not a hardcoded contract size.

Expert advisor · MT4 · v1.0 · Free

About Noise Filtered Breakout System

Noise Filtered Breakout System is an expert advisor (trading robot) for MetaTrader 4 based on ATR. It can size trades from your balance and risk percent and trades breakouts. It has 13 settings, such as Breakout lookback, Noise lookback and Min efficiency. MQL source code included.

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

Trading robots can lose money. Check every setting and test on a demo account before using real funds.

Settings

SettingDefaultWhat it does
Breakout lookback20Donchian breakout lookback, in bars
Noise lookback20Bars back for the Efficiency Ratio noise measure
Min efficiency0.35Minimum Efficiency Ratio (0..1) required to accept the breakout
Atr period14ATR period used for the stop and target
Stop atr multiple1.5Initial stop distance, ATR multiples
Target atr multiple3.0Take profit distance, ATR multiples
Use risk sizingfalseSize by percent risk to the initial stop instead of a fixed lot
Risk percent1.0Percent of equity risked per trade, used only when risk sizing is on
Fixed lots0.10Lot size when risk sizing is off, or as a fallback
Magic number20260366Magic 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: Breakout · Channels & Envelopes · Risk & Lot Size · ATR · MT4 Expert Advisor · MQL4 Source Code

Expert advisors (EA) for MT4 & MT5 · PolyMaria