EA-17112 · Trend Following

ExpHAWaves

This EA trades based on the confluence of Heiken Ashi candle direction and a StepUpDown trend filter derived from the relationship between a fast SMA(2) and a slow SMMA(30). It opens buy positions when both indicators confirm an uptrend and sell positions when both confirm a downtrend, with configurable trailing stops, risk-based lot sizing, and opposite-signal position closing.

Open the interactive view (equity curve, symbol switch)

Key facts

RiskMedium
Blow-up riskLow
Rating★★☆☆☆
TypeTrading EA
TimeframesM15, H1, H4, D1
IndicatorsSMA, SMMA, Heiken Ashi
AuthorRoberto Jacobs (3rjfx) ~ By 3rjfx ~ Created: 2016/12/05

Backtest results (H1, about 1 year)

SymbolP&LAnnualMax DDTradesWin rateSharpeRecoveryLosing streakPer tradeStatus
EURUSD0.00%0.00%0.00%0—————Not convertible yet
GBPUSD0.00%0.00%0.00%0—————Not convertible yet
USDJPY0.00%0.00%0.00%0—————Not convertible yet
XAUUSD0.00%0.00%0.00%0—————Not convertible yet

Why this EA never traded: no entry rule survived the conversion.

Converted from MQL5 to Python and run with the same rules for every EA. Positions use MT5 lot sizes (100,000 units per FX lot, 100 oz per gold lot) with 1:100 leverage, one order at a time, and a stop-out below 10% of the starting balance. Sharpe is computed from the equity curve. Results marked as unreliable are shown for completeness only.

Blow-up risk: No blow-up pattern found

None of the usual blow-up patterns were found in the code, and the account was not stopped out in our backtests. That is not a guarantee: any EA can lose money.

High: stopped out in our backtest, or martingale/grid sizing without a stop loss. Elevated: martingale or grid sizing with a stop loss, or several positions at once without a stop loss. What the label means and what we found →

Strategy analysis

The strategy concept is based on dual confirmation from Heiken Ashi smoothed candles and a StepUpDown trend filter, constituting a typical trend-following system. Entry conditions require both Heiken Ashi candle direction (haOpen<haClose for bullish, haOpen>haClose for bearish) and StepUpDown trend direction (determined by SMA(2) vs SMMA(30) divergence and highest/lowest point positions) to align before opening a position. Exit conditions include three methods: closing on opposite signal (CloseByOppositeSignal), trailing stop tracking for exit, and profitable exit based on current profit and reverse StepUpDown signal when trailing stop is disabled. Position sizing supports both fixed lot and dynamic lot modes, with the dynamic mode calculating lots based on account balance, risk percentage, leverage, and contract size, then dividing by the number of open positions plus one. Money management controls per-trade risk via the RiskPercentage parameter, with stop loss distance calculated from a risk formula and take profit set as a multiple (TPvsSLRatio) of the stop loss, with a minimum stop distance of 38 pips. Additionally, the EA implements a same-hour re-entry restriction by checking historical order close times to avoid overtrading.

Strengths

  • Dual indicator confluence confirmation reduces the probability of entering on false signals
  • Supports dynamic lot calculation and risk percentage control with relatively sound money management
  • Provides trailing stop functionality to effectively lock in profits and follow trends
  • Implements same-hour re-entry restriction to avoid overtrading
  • Minimum 38-pip stop loss distance protects against stops being too tight and getting swept

Weaknesses

  • SMA(2) period is extremely short, making StepUpDown trend judgment prone to frequent false reversal signals
  • Timer triggers every minute but trading logic depends on minute change, potentially lagging in fast markets
  • Object pointers (CTrade etc.) are created with 'new' every minute in OnTimer but never deleted, causing memory leaks
  • ModifySLTP uses 'break' to exit the loop, only modifying the first matching position, which is incomplete for multi-position scenarios
  • CheckOrderCloseTime uses order_ID as the ticket parameter in HistoryOrderGetInteger, which is a logical error
  • ClosePosition calls PositionGetInteger outside the loop, potentially retrieving incorrect position information

Possible improvements

  • Fix memory leaks: move CTrade etc. object creation to OnInit, or delete them promptly after use
  • Optimize StepUpDown trend logic by increasing SMA period or adding trend strength filters to reduce false signals
  • Fix the incorrect parameter passing of HistoryOrderGetInteger in CheckOrderCloseTime
  • Remove break statements in ModifySLTP to allow iterating and modifying all matching positions
  • Add spread filter and slippage protection to avoid opening positions in high-spread environments

Risk assessment

Overall risk: Medium

  • SMA(2) period is too short causing unstable trend judgment, potentially generating frequent false signals leading to consecutive losses
  • Memory leak issue can cause resource exhaustion during long-term operation
  • Logical error in CheckOrderCloseTime may cause the same-hour re-entry restriction to fail
  • Trailing stop of only 10 pips (1 pip) is too tight and easily triggered in volatile markets

Evaluation scores

Code quality2.0
Strategy logic2.0
Risk management3.0
Robustness2.0
Innovation1.0
Documentation2.0
Overall2.0

Parameters

ParameterDefaultDescription
TimeFramesPERIOD_H1Timeframe for EA operation
RiskPercentage3.0Risk percentage for dynamic lot and stop-loss calculation
TPvsSLRatio3.0Take-profit to stop-loss multiplier ratio
MoneyManagementTypeDynamicLotSizeMoney management: fixed lot or dynamic lot
TradeLotSize0.1Manual lot size in fixed lot mode
CloseByOppositeSignalYesClose position on opposite signal
UseTrailingStopYesEnable trailing stop
Trailing_FixedPipsSL10Trailing stop value in points
Magic1234EA unique identifier ID (max 8 digits)

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.