Where an indicator stops at plotting a line or sounding an alert, an Expert Advisor goes one step further and sends the trade itself. This free EA trades a breakout strategy built entirely around confirmed Fractals: it tracks the most recently confirmed swing high and swing low on the chart, enters when price closes beyond one of them, sizes its Stop Loss, Take Profit, and position automatically, and manages one position at a time. One thing sets it apart from most other EAs on this site: its Stop Loss isn't ATR-based at all — it's the broken Fractal level itself, for reasons explained below.
How the Strategy Works
A Fractal marks a confirmed local swing high or swing low — a five-bar pattern where the middle bar's high (or low) stands higher (or lower) than the two bars on either side of it, exactly as the site's own Fractals lesson describes. This EA runs that same detection on every completed bar and keeps two running values in memory: the most recently confirmed up-fractal price and the most recently confirmed down-fractal price. Each time a new fractal confirms, it overwrites the stored value; between confirmations, the EA simply holds onto the last one it saw.
The entry logic is a straightforward breakout against those two stored levels. A BUY fires when the most recently completed bar's close crosses above the stored up-fractal price — price breaking out above a known, confirmed swing high. A SELL fires on the mirror condition: the completed bar's close crossing below the stored down-fractal price, a breakout below a known swing low. Critically, this EA inherits the same confirmation lag the Fractals indicator itself carries: because a fractal can't be confirmed until two bars after the candidate swing point, the level the EA is trading against was always locked in a couple of bars before the breakout attempt, never in real time. The code reflects this directly — both the MT4 and MT5 versions read iFractals(...) at shift 2, the identical lag used by the site's Fractals alert indicator, so the stored level is always a genuinely confirmed swing point rather than a guess at one still forming.
Stop Loss, Take Profit, and Position Sizing
This is the section that matters most for understanding this particular EA. Most other EAs on this site size their Stop Loss from ATR — a volatility-adaptive stop that widens on volatile pairs and tightens on calm ones. This EA does not do that, and it's not an oversight. A Fractal is already a concrete, price-anchored level created by the market's own structure — it marks the exact price at which a real swing high or swing low actually formed, confirmed by five real bars of price action, not a statistical estimate of how far price tends to move. Layering ATR on top of a Fractal-based system would just add a second, disconnected opinion about a stop distance the fractal has already defined directly.
So when the EA opens a BUY on a confirmed breakout, the Stop Loss is placed exactly at the broken up-fractal level — the swing high that price just closed above, now reinterpreted as new support underneath the trade. The mirrored logic applies to a SELL: the Stop Loss sits at the broken down-fractal level, the swing low that price just closed below, now treated as new resistance above the trade. Take Profit is then set at a multiple of that Stop Loss distance — RiskRewardRatio, default 2.0 — so a 2.0 setting means the target sits twice as far from entry as the stop, keeping every trade's risk and reward in a fixed, known proportion regardless of how wide or narrow that particular fractal-based stop happens to be.
Position size is calculated the same way as every other EA on this site: a RiskPercent of account balance (default 1.0%) divided by the Stop Loss distance, converted through the symbol's tick value and normalized to the broker's lot step — the exact worked-example method from Risk Management Basics. A wider fractal-based stop produces a smaller lot size, and a tighter one produces a larger lot size, so the dollar risk per trade stays consistent even though the stop distance itself varies from breakout to breakout depending on how far the broken swing point sits from the entry price. A UseFixedLot input with a FixedLotSize value is available as an escape hatch for traders who'd rather trade a constant lot size regardless of risk. There's also a built-in safety check: if the computed Stop Loss distance comes out to zero or negative, the EA skips the trade entirely rather than opening a position with no meaningful stop.
Entry Conditions
- BUY — the most recently completed bar's close crosses from at-or-below to above the stored up-fractal level. The Stop Loss is placed at that up-fractal level.
- SELL — the most recently completed bar's close crosses from at-or-above to below the stored down-fractal level. The Stop Loss is placed at that down-fractal level.
The EA evaluates these conditions once per new bar only (tracked against the time of the current bar's open), never on every tick, so a single breakout can't fire multiple trades within the same candle. It opens at most one position at a time, counted and filtered by its own magic number (MagicNumber, default 20260730), so it never confuses a position it opened with one you opened manually or one belonging to a different EA on the same account. Before opening anything, it also checks the current spread against MaxSpreadPoints and skips the entry entirely if the market is too illiquid at that moment. Finally, the degenerate-stop guard described above means a trade is only ever sent when the computed Stop Loss distance is a genuinely positive number — a signal that technically fires but produces a zero-distance or negative stop is discarded rather than sent to the broker.
Parameters
The other inputs are the site's standard risk engine (ATRPeriod, ATRMultiplier, RiskRewardRatio, RiskPercent, UseFixedLot, FixedLotSize, MaxSpreadPoints, EnableTrading, MagicNumber), and each default is explained once in the risk-engine section of the EA hub. This EA's own magic number is 20260730.
Notice what's missing compared to most of the site's other EAs: there is no ATRPeriod and no ATRMultiplier here, and there's no lookback period at all for the fractal detection itself, since (as the Fractals lesson explains) the pattern is fixed at five bars by definition and isn't tunable. That's not a simplification or an oversight — it's the direct consequence of the design choice explained in the next section.
Why This EA Uses the Broken Fractal Instead of ATR
Most other EAs on this site — ea-trend-following included — calculate their Stop Loss as ATRMultiplier × ATR, a fixed distance recalculated fresh at the moment each trade opens, entirely from volatility statistics with no reference to any actual price level nearby. This EA works differently on purpose, the same way Parabolic SAR Trend EA and Ichimoku Breakout EA do, and the reasoning is worth walking through concretely.
ATR answers one question: given recent volatility, how far away should a stop sit? It has no opinion at all about where support or resistance actually is on the chart — it's a distance derived purely from a statistical average, blind to the market's own structure. A Fractal answers a completely different, and in this case more relevant, question: where did the market itself actually turn last time? The broken up-fractal on a BUY trade isn't an estimate — it's the literal price at which five real bars of price action already proved a swing high was there. Placing the Stop Loss at that exact level means the stop sits precisely where the trade's own thesis would be proven wrong: if price falls back through the level it just broke out above, the breakout has failed and the level that was supposed to act as new support didn't hold, which is exactly the moment to be out regardless of what an ATR-derived distance happens to say.
Running ATR on top of a fractal-based stop here wouldn't make the stop meaningfully better — it would just be a second, disconnected opinion about a stop distance the fractal has already defined directly, using the same price structure that produced the entry signal in the first place. There would be nothing for ATR to add: the fractal is concrete and price-anchored, while ATR is abstract and derived from an average, and reconciling the two whenever they disagreed would only add complexity without adding protection. This is precisely why the EA reuses the fractal level itself rather than reaching for a second, separate calculation.
A Word of Caution
Put it through a demo account across quiet and volatile markets before risking capital; what it did in the past, in a tester or live, says nothing certain about what it will do next. No trading system wins every position; expect this EA to lose on individual trades as a matter of course. Breakout EAs like this one whipsaw badly in choppy or ranging markets: a market that isn't trending throws off a steady stream of small, low-value fractals, and a shallow break above a weak up-fractal (or below a weak down-fractal) can trigger an entry that reverses within a few bars, stopping the trade out for a quick loss before any real move develops. A fractal formed during a quiet, narrow-range pullback is not the same quality of level as one formed at the top of a genuine multi-bar swing, even though both print an identical arrow — the EA itself can't tell the difference, since it trades every confirmed fractal level the same way. Consider combining it with a read of trend vs range before enabling it on a live account, and keep in mind the confirmation lag covered above: because a fractal locks in two bars after the fact, the level being traded is always slightly dated by the time a breakout attempt occurs. Since both versions are open source files, read the code yourself — every parameter should make sense to you before it ever touches a live chart. Nothing on this page is personalized investment advice; it is general education about how the tool works.