EA-1424 · Trend Following

Exp_TrendEnvelopes

This EA trades based on the TrendEnvelopes custom indicator, opening buy positions when an upward trend signal is detected and sell positions when a downward trend signal is detected. It uses configurable money management with lot sizing or deposit share, and applies fixed Stop Loss and Take Profit levels to all trades. The strategy processes signals only on new bars to avoid redundant calculations.

Open the interactive view (equity curve, symbol switch)

Key facts

RiskMedium
Rating★★★☆☆
TypeTrading EA
TimeframesH1, H4, D1
IndicatorsTrendEnvelopes, EMA, ATR
AuthorCopyright © 2012, Nikolay Kositsin

Backtest results (H1, about 1 year)

Not backtested yet — this EA could not be converted automatically.

Strategy analysis

The core strategy of this EA is to follow trend direction using the TrendEnvelopes indicator for trading decisions. The TrendEnvelopes indicator is built on a moving average (supporting multiple MA methods, defaulting to EMA) with an ATR-based adaptive deviation to construct upper and lower envelopes. Entry conditions: a buy position is opened when the UpSignal buffer contains a valid value (non-zero and not EMPTY_VALUE), and a sell position is opened when the DnSignal buffer contains a valid value. When price is merely within the trend envelope (UpTrend or DnTrend valid without a new signal), only the opposite position is closed without opening a new one. Exit conditions include fixed Stop Loss and Take Profit in points, plus closing on reverse signals. Position sizing is controlled by the MM parameter, where negative values represent a fixed lot size and positive values represent a share of the deposit. Money management is handled through the BuyPositionOpen and SellPositionOpen functions from TradeAlgorithms.mqh, which incorporate signal timestamps, slippage control, and stop loss/take profit settings. The strategy only recalculates signals on new bar formations or when SignalBar is set to 0, reducing unnecessary frequent trading activity.

Strengths

  • Uses new bar detection to avoid redundant signal processing and excessive trading, reducing overtrading risk
  • Provides flexible money management via MM parameter, supporting both fixed lot size and deposit share modes
  • Allows independent control of buy/sell open and close permissions via boolean parameters, offering high flexibility
  • Uses ATR-adaptive deviation to construct trend envelopes, automatically adjusting channel width based on market volatility

Weaknesses

  • Depends on external TradeAlgorithms.mqh library and TrendEnvelopes custom indicator with no fallback logic; EA cannot run if these files are missing
  • Stop Loss and Take Profit are fixed point values without dynamic ATR-based adjustment, which may perform inconsistently across different volatility environments
  • Lacks spread filter and trading session filter, potentially opening positions during high-spread periods or unfavorable trading hours
  • No explicit position check logic in the main code, relying entirely on external library functions to prevent duplicate openings

Possible improvements

  • Add ATR-based dynamic Stop Loss/Take Profit calculation instead of fixed points, making risk management more adaptive to market volatility changes
  • Add spread filter and trading session filter to avoid opening positions under unfavorable conditions

Risk assessment

Overall risk: Medium

  • Depends on external library and indicator files; missing files may cause runtime errors or inability to trade properly
  • Fixed Stop Loss/Take Profit does not account for market volatility changes; SL may be too wide in low volatility and too tight in high volatility
  • No spread filter mechanism, potentially resulting in unfavorable fills during low liquidity or widened spread conditions

Evaluation scores

Code quality3.0
Strategy logic3.0
Risk management3.0
Robustness3.0
Innovation2.0
Documentation2.0
Overall2.7

Parameters

ParameterDefaultDescription
MM-0.1Deposit ratio or fixed lot size (negative=fixed lots)
StopLoss_1000Stop loss in points
TakeProfit_2000Take profit in points
Deviation_10Maximum price deviation in points (slippage tolerance)
BuyPosOpentrueAllow buy position opening
SellPosOpentrueAllow sell position opening
BuyPosClosetrueAllow buy signal to close sell positions
SellPosClosetrueAllow sell signal to close buy positions
InpInd_TimeframePERIOD_H4MomentumCandleSign indicator timeframe
MA_Period14Moving average period
MA_MethodMODE_EMAMoving average method
Applied_PricePRICE_CLOSEApplied price type
Deviation0.2Trend envelope deviation
ATRPeriod15ATR indicator period
ATRSensitivity0.5ATR offset sensitivity
SignalBar1Bar index for trade signal

Similar Trend Following EAs

Backtests are historical simulations and do not guarantee future results. Not financial advice.

Get the weekly Arena report

One email a week: ranking changes, new signals and new research. No spam; unsubscribe any time.