Unlike the indicators on this site, which only draw on the chart or fire alerts, an Expert Advisor places real orders for you. This free EA trades a single, transparent trend-following strategy end to end: entry, Stop Loss, Take Profit, and position size, all calculated automatically from the same tools taught elsewhere on this site.
How the Strategy Works
The entry signal is a Moving Average crossover — a fast MA (default 20-period) crossing above or below a slow MA (default 50-period) — but the crossover alone isn't enough to trigger a trade. It's filtered by ADX: the crossover only fires if ADX is above a configurable threshold (default 25), confirming the market is actually trending rather than chopping sideways. This is the exact filter taught in the ADX lesson — a moving-average signal is far more reliable when there's a real trend behind it, and far noisier when the market is range-bound.
Stop Loss, Take Profit, and Position Size
Both Stop Loss and Take Profit are sized from ATR rather than a fixed pip distance — a volatile pair or session gets a wider stop automatically, and a calm one gets a tighter stop, so the stop always reflects what the market is actually doing right now. Take Profit is then set at a multiple of the Stop Loss distance (the Risk:Reward ratio), keeping every trade's risk and reward in a fixed, known proportion.
Position size is calculated from a Risk % input against your account balance and the Stop Loss distance — the exact worked-example method from Risk Management Basics: risk amount ÷ Stop Loss distance = lot size. This means the EA automatically trades smaller on wider stops and larger on tighter ones, rather than using a fixed lot size that ignores how far away the stop actually is.
Entry Conditions
- BUY — fast MA crosses above slow MA while ADX is above the threshold.
- SELL — fast MA crosses below slow MA while ADX is above the threshold.
The EA only evaluates these conditions once per new bar (not on every tick), only opens one position at a time, and only manages positions tagged with its own magic number — so it won't interfere with trades you open manually on the same account, and it won't stack additional trades on top of an open one.
Parameters
- FastMAPeriod / SlowMAPeriod (default 20 / 50) — the two Moving Average periods that form the crossover signal.
- ADXThreshold (default 25) — minimum ADX reading required before a crossover is allowed to trigger a trade.
The rest of the inputs belong to the shared risk engine every EA here uses: stop and target sizing, position sizing, the spread filter, and the master switch. They are documented once on the EA hub page rather than repeated on every lesson.
Why a Trend Filter on a Crossover Strategy
A plain moving-average crossover, on its own, is one of the noisiest signals in trading — in a ranging market, price whipsaws back and forth across both MAs repeatedly, firing crossover after crossover with no real trend to ride. Requiring ADX confirmation before acting on a crossover is a direct, mechanical version of the advice given throughout this site's trend vs range lesson: know what kind of market you're in before picking a strategy for it. The tradeoff is that this EA will sit out ranging markets entirely, taking no trades — which is the correct behavior for a trend-following system, even though it can feel like the EA is "doing nothing" during quiet periods.
A Word of Caution
Run it on a demo account first, through different market conditions, before real money is involved; past results, whether from backtests or live trading, guarantee nothing about the future. No strategy, automated or manual, wins every trade, and this EA can and will lose money on individual trades; the ADX filter reduces how often it trades in a poor-fit market, it doesn't eliminate losing trades. The files ship as readable source, so open them in MetaEditor and satisfy yourself about what every parameter does before running them. Take this page as classroom material: an explanation of a method, not advice directed at you.