EA-114 · Trend Following

expHA_ (Heiken_Ashi based EA)

This EA trades based on Heiken Ashi candlestick direction, opening positions when a consistent three-bar trend acceleration pattern is detected. It uses a custom Heiken Ashi indicator to derive open and close buffer values, comparing successive differences to confirm strengthening momentum before entering. Positions are managed with a fixed lot size and a stop loss derived from the current Heiken Ashi open price, while opposing signals trigger position reversal.

Open the interactive view (equity curve, symbol switch)

Key facts

RiskMedium
Rating★★☆☆☆
TypeTrading EA
TimeframesH1, H4, D1
IndicatorsHeiken Ashi
Authorkurl

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.

Strategy analysis

The strategy concept is trend following based on Heiken Ashi smoothed candlesticks, analyzing the progressive relationship of open prices across three consecutive HA bars and the relative position of close versus open prices to determine both trend direction and strength. Entry conditions for a long require three consecutive HA closes above their respective opens (e>a, f>b, g>c), with open price differences increasing bar over bar (w>x>y>0), signaling accelerating uptrend momentum; short conditions are the mirror opposite. Exit conditions include position reversal on opposing signals and a stop loss set at the latest HA open price. Position sizing uses a fixed lot of 0.1, with the P parameter capping the maximum number of same-direction positions (default 3). Money management only blocks new entries when the margin level falls below 120%, lacking independent risk controls such as maximum drawdown limits or dynamic position sizing.

Strengths

  • Heiken Ashi smoothing filters market noise effectively, yielding more stable trend signals and fewer false entries
  • Requires three consecutive bars of accelerating momentum before entry, providing strict confirmation that avoids frequent trading in ranging markets
  • Automatic position reversal on opposing signals enables quick response to trend changes

Weaknesses

  • Fixed lot sizing with no dynamic adjustment prevents adaptation to account risk or market volatility
  • Stop loss placed at the HA open price with a minimum distance check (Spp) can be too tight early in a trend, leading to premature stop-outs
  • Extremely terse variable naming (V, D, Cnt, xP, etc.) makes the code nearly unreadable and very difficult to maintain

Possible improvements

  • Add dynamic position sizing based on ATR or account equity percentage to improve money management
  • Implement take-profit logic and a trailing stop mechanism; currently there is only a stop loss with no take-profit, limiting profit potential
  • Improve code readability by replacing single-letter variables with meaningful names and adding detailed comments

Risk assessment

Overall risk: Medium

  • Stop loss distance may be too small (Spp*Point is only 300 points), easily stopped out during high volatility
  • No maximum drawdown or daily loss limit; the EA will keep opening positions during sustained losses
  • Position count (Cnt) relies on a global variable rather than recalculating from actual positions, causing potential state inconsistency after program restart

Evaluation scores

Code quality1.0
Strategy logic3.0
Risk management2.0
Robustness2.0
Innovation2.0
Documentation1.0
Overall1.8

Parameters

ParameterDefaultDescription
P3Maximum positions per direction
Lots0.1Fixed trade lot size
MAGIC300510020EA magic number for order identification
Slp50Slippage tolerance in points
Spp300Stop loss buffer in points for minimum distance check

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.