An indicator only plots a line or fires an alert — an Expert Advisor (EA) actually sends orders on your behalf. This free EA trades a single, transparent trend-following strategy built entirely around SuperTrend: it enters the moment the SuperTrend line flips sides, sizes its Take Profit and position automatically, and manages one position at a time. Like this site's Parabolic SAR Trend EA, its Stop Loss isn't ATR-based at all — it's the SuperTrend line value itself, for reasons explained below.
How the Strategy Works
SuperTrend plots a single line that sits either below or above price, trailing the current trend — below and green during an uptrend, above and red during a downtrend. A "flip" happens when a closed bar's price crosses through the line and it switches to the other side; this EA treats that flip as its entire entry signal, exactly the way the site's own SuperTrend lesson describes it: a flip from above price to below price suggests the downtrend just ended and a new uptrend is starting, and the mirrored flip suggests the reverse.
There's no built-in SuperTrend function in either MetaTrader 4 or MetaTrader 5, so this EA reconstructs the full recursive band-and-trend calculation internally from High, Low, Close, and ATR — the same sequence covered in the indicator lesson — on every new bar, and checks the two most recently closed bars for a flip. It doesn't add any separate trend-strength filter on top of the flip; the flip itself, plus the risk controls covered below, is the entire signal.
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 a separate ATRMultiplier × ATR calculation — a volatility-adaptive stop, but one frozen at the moment the trade opens. This EA does not do that, and it's not an oversight: SuperTrend's line is already an ATR-based, ratcheting trail by construction — it's built directly from Multiplier × ATR, and its ratchet logic already only tightens toward price, never widens away from it. Layering a second, separate ATR calculation on top would be redundant, answering a question SuperTrend's own line has already answered as part of the same calculation that produced the entry signal.
So when the EA opens a BUY on a bullish flip, the Stop Loss is placed exactly at the SuperTrend line value that triggered the flip — a level that's already positioned below the entry price by a distance shaped by current volatility. The mirrored logic applies to a SELL: the Stop Loss sits at the SuperTrend line value above the entry price. 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 SuperTrend-based stop happens to be.
Position size is calculated the same way as every other EA on this site: 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 SuperTrend-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 trade to trade. Traders who want an unchanging lot size can switch on UseFixedLot and set FixedLotSize instead.
Entry Conditions
- BUY — the SuperTrend line flips from above price to below price on a newly completed bar; the Stop Loss is placed at that flipped line value.
- SELL — the SuperTrend line flips from below price to above price on a newly completed bar; the Stop Loss is placed at that flipped line value.
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 flip 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, so it never confuses a position it opened with one you opened manually or one belonging to a different EA on the same account. It also refuses to enter when the market is too thin, comparing the live spread to MaxSpreadPoints before any order goes out.
Parameters
- Multiplier (default 3.0) — how many ATR-widths the SuperTrend line sits from the (High+Low)/2 midpoint before the ratchet logic is applied. A smaller value flips sides more often; a larger value holds a trend longer before flipping.
Everything else — stop sizing, the risk-reward target, the risk-percent lot calculation, the spread filter, and the master switch — is the standard risk engine shared by all EAs on this site, documented in full on the EAs page. This EA marks its orders with magic number 20260727.
Notice what's missing compared to most of the site's other EAs: there is no separate ATRMultiplier for the Stop Loss itself. That's not a simplification or an oversight — it's the direct consequence of the design choice explained above and in the next section.
Why This EA Uses the SuperTrend Line Itself as the Stop, Not a Separate ATR Multiple
Most other EAs on this site — ea-trend-following included — calculate their Stop Loss as an independent ATRMultiplier × ATR, a fixed distance recalculated fresh at the moment each trade opens and then left alone for the rest of the trade's life. This EA works differently on purpose, and the difference is worth walking through concretely.
An independent ATR-based stop measures average volatility over a lookback period and gives you one number: how far away, in current market conditions, a stop "should" be at this instant, set once at entry. SuperTrend's own line does something similar but goes a step further — it produces a whole sequence of stop levels, one per bar, that ratchets tighter as the trend matures, since the Final Upper/Lower Band logic only ever moves in the direction that shrinks the trail. That's the entire mechanical idea behind the indicator: a fresh trend gets a band shaped by that moment's volatility, and as the trend runs, the ratchet locks in more of the open profit bar by bar without any separate trailing-stop routine layered on top. Reusing that same line as the Stop Loss means a trader managing the trade manually inherits a tightening stop for free — no extra ATR recalculation to keep in sync, no second indicator disagreeing with the first about how far away the stop should sit.
A Word of Caution
Trial it on demo first, over multiple pairs and differing conditions, before real funds are at stake — a strong backtest or demo run guarantees nothing going forward. Losing trades are part of any strategy, human or automated, and this EA is no exception. Like Parabolic SAR, SuperTrend whipsaws badly in ranging or choppy markets: because the line is always positioned on one side of price and always flips when crossed, a sideways market forces it to flip back and forth repeatedly, generating a steady drip of false entries and small losses with no trend-strength filter to sit those periods out on its own. Consider combining it with a read of Trend vs Range or an ADX filter before enabling it on a live account. Both downloads are plain source files — read them end to end and make sure you understand each input before trusting them with an order. None of the above is personal financial advice — it is a technical explanation, nothing more.