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 · MT5 · v1.0 · Free
About Noise Filtered Breakout System
Noise Filtered Breakout System is an expert advisor (trading robot) for MetaTrader 5 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.ex5, NoiseFilteredBreakout.mq5, NoiseFilteredBreakout.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 |
|---|---|---|
| Breakout lookback | 20 | Donchian breakout lookback, in bars |
| Noise lookback | 20 | Bars back for the Efficiency Ratio noise measure |
| Min efficiency | 0.35 | Minimum Efficiency Ratio (0..1) required to accept the breakout |
| Atr period | 14 | ATR period used for the stop and target |
| Stop atr multiple | 1.5 | Initial stop distance, ATR multiples |
| Target atr multiple | 3.0 | Take profit distance, ATR multiples |
| Use risk sizing | false | Size by percent risk to the initial stop instead of a fixed lot |
| Risk percent | 1.0 | Percent of equity risked per trade, used only when risk sizing is on |
| Fixed lots | 0.10 | Lot size when risk sizing is off, or as a fallback |
| Magic number | 20260366 | 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 5 open File → Open Data Folder, then go to MQL5 → Experts.
- Copy the .mq5 file(s) there. Put any .mqh files in MQL5 → Include.
- Open the .mq5 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: Breakout · Channels & Envelopes · Risk & Lot Size · ATR · MT5 Expert Advisor · MQL5 Source Code