LearnForexHub
EA

EA: Aroon Trend Expert Advisor

Written by , Founder & EditorLast updated How we write and review lessons

An indicator only plots a line or fires an alert — an Expert Advisor (EA) actually sends orders on your behalf. This free EA trades the Aroon indicator's Up/Down crossover, but only when the winning line is already reading above a configurable threshold — the moment a fresh high or low crosses into control and is convincing enough to trust, it opens a trade in that direction, with Stop Loss, Take Profit, and position size all calculated automatically from ATR and account risk.

How the Strategy Works

The entry signal starts with the same Aroon Up/Aroon Down crossover covered in the Aroon Indicator lesson: Aroon Up crossing above Aroon Down signals a fresh high has become more recent than any recent low, and Aroon Down crossing above Aroon Up signals the mirrored condition on the downside. Both lines are calculated internally by the EA using the same method as the standalone indicator — bars since the highest high and lowest low of a look-back period, converted to a 0-100 scale — since there's no built-in Aroon function in either MetaTrader 4 or MetaTrader 5 for the EA to call.

Unlike this site's Vortex Crossover EA, which deliberately trades its indicator's raw crossover with no strength filter, this EA adds one: the crossing line must already be at or above AroonThreshold (default 70) at the moment it crosses. Aroon's own 0-100 scale makes this possible in a way Vortex's unbounded lines don't — a crossover with the winning line already near 100 means the high or low behind it is genuinely fresh, while a marginal cross with both lines hovering near 50 is exactly the kind of weak, range-bound signal this filter is built to skip.

Stop Loss, Take Profit, and Position Sizing

PriceTake Profit (TP)Stop Loss (SL)BUY70Aroon Up / Aroon Down (0–100)Aroon UpAroon Down
Entry conditions: BUY when Aroon Up crosses above Aroon Down while Aroon Up is above 70 — SELL on the mirrored cross — SL and TP are placed automatically from ATR

Both Stop Loss and Take Profit are sized from ATR rather than a fixed pip distance, so the stop always reflects how much the pair is actually moving right now. Stop Loss distance is ATRMultiplier × ATR (default multiplier 2.0, ATR calculated over ATRPeriod, default 14), and Take Profit is then set at RiskRewardRatio × Stop Loss distance (default 2.0) — every trade this EA opens, on any pair or timeframe, carries the same fixed reward-to-risk proportion.

Position size follows the exact worked-example method from Risk Management Basics: RiskPercent (default 1.0%) of account balance is divided by the Stop Loss distance to produce a lot size, keeping the dollar amount at risk roughly constant even as the ATR-based stop distance changes with volatility. See Lot Sizes Explained for how this lot size is then normalized to the broker's minimum, maximum, and step lot size before the order is sent. UseFixedLot is available as an escape hatch for a constant lot size regardless of account risk.

Entry Conditions

  • BUY — Aroon Up crosses above Aroon Down on the just-closed bar, and Aroon Up is at or above AroonThreshold (default 70) at that moment.
  • SELL — Aroon Down crosses above Aroon Up on the just-closed bar, and Aroon Down is at or above AroonThreshold — the mirrored condition.

Three safety mechanics govern every trade this EA can place, matching the standard used across every EA on this site: it evaluates entry conditions once per new bar only, tracked via the bar's open time, so a single qualifying bar can't trigger repeated entries within the same candle; it opens only one position at a time, checked by counting open trades filtered to this EA's own symbol and magic number before any new entry is considered; and it checks the current spread against MaxSpreadPoints (default 30) before sending an order, skipping the entry if the spread is too wide to trade at a reasonable price. Every order is tagged with MagicNumber (default 20260814), so the EA's position-counting logic never touches a trade opened manually or placed by a different EA running on the same account.

Parameters

  • AroonPeriod (default 14) — the look-back window Aroon Up and Aroon Down are calculated over. A shorter period reacts to new highs/lows faster and produces more crossovers; a longer period smooths both lines and reduces how often marginal highs/lows trigger a signal.
  • AroonThreshold (default 70) — the minimum reading the crossing line must already show for the cross to count as a valid entry. Raising it (toward 85-90) demands an especially fresh high or low and trades less often; lowering it toward 50 accepts weaker, more marginal crossovers.

The remaining parameters aren't specific to this strategy: they belong to the risk engine shared across the whole EA collection, explained in one place on the EA hub. This EA identifies its own trades with magic number 20260814.

Why This EA Filters the Crossover by a Threshold

Aroon Up and Aroon Down are bounded between 0 and 100 by design, which makes them unusually well suited to a threshold filter that most other crossover indicators can't offer directly — ADX's +DI/-DI lines, for comparison, are also bounded, but the strength reading that filters them (the ADX line itself) is a separate calculation from the crossing lines. With Aroon, the crossing line's own value already tells you how convincing the cross is: a value near 100 means the underlying high or low was set on the current or a very recent bar, while a value near 50 could just as easily belong to a market where highs and lows keep swapping back and forth with no real trend. Filtering on AroonThreshold means this EA only acts on crossovers with real conviction behind them, at the cost of skipping some genuine but marginal trend shifts where the crossing line never quite reaches the threshold before price starts moving.

This is a different design trade-off from an unfiltered crossover EA: fewer signals, but each one backed by a fresher high or low rather than a borderline reading. Traders who find this EA trades too rarely can lower AroonThreshold toward 50-60 to accept more marginal crossovers; traders who still see too many false signals during choppy conditions can raise it toward 80-90 to demand an even fresher, more decisive read before entering.

A Word of Caution

Test on a demo account first, across different market conditions and multiple pairs, before risking real money — a good backtest or demo run never guarantees future results. This EA can and will lose on individual trades, and even with the AroonThreshold filter in place, a market that keeps making shallow new highs and lows in alternating directions can still produce a cluster of losing entries. Consider combining this EA with a higher-timeframe bias check — see Trend vs Range — rather than running it unfiltered through every market condition. Both the MT4 and MT5 files below are source code — open and read them fully, and understand exactly what every parameter does, before attaching this EA to a live account. Treat everything here as general education rather than personalized investment advice.

Download aroon-trend-ea.mq4

For MetaTrader 4 — this is source code (.mq4), open and review it fully before using it.

Download File

Download aroon-trend-ea.mq5

For MetaTrader 5 — this is source code (.mq5), open and review it fully before using it.

Download File

How to install

An EA installs into the Experts folder, not Indicators — this is the step people miss most often.

MetaTrader 4

  1. Download aroon-trend-ea.mq4 above.
  2. Open MetaTrader 4FileOpen Data Folder.
  3. Place the file in the MQL4/Experts folder.
  4. Restart MetaTrader 4, then drag it from the Navigator window onto a chart.
  5. Enable AutoTrading (MT4) or Algo Trading (MT5) in the toolbar — the EA places no trades while this is off, even when attached to a chart.
  6. Review and adjust the input parameters in the settings dialog before confirming.

MetaTrader 5

  1. Download aroon-trend-ea.mq5 above.
  2. Open MetaTrader 5FileOpen Data Folder.
  3. Place the file in the MQL5/Experts folder.
  4. Restart MetaTrader 5, then drag it from the Navigator window onto a chart.
  5. Enable AutoTrading (MT4) or Algo Trading (MT5) in the toolbar — the EA places no trades while this is off, even when attached to a chart.
  6. Review and adjust the input parameters in the settings dialog before confirming.

Both files are source code. Open and read them in MetaEditor before running them on any account.