EA-197 · Trend Following

YTG ADX v1

This EA uses the ADX Wilder indicator to generate trading signals. It opens a buy position when the +DI line crosses above a configurable level and a sell position when the -DI line crosses above its level. Only one position per symbol is allowed at a time, controlled by magic number filtering.

Open the interactive view (equity curve, symbol switch)

Key facts

RiskMedium
Blow-up riskLow
Rating★★☆☆☆
TypeTrading EA
TimeframesH1, H4, D1
IndicatorsADX Wilder, +DI, -DI
AuthorYuriy Tokman

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 core strategy of this EA is based on the ADX Wilder indicator's DI lines crossing above configurable threshold levels. Entry conditions: a buy signal (+1) is generated when the +DI line crosses above the level_p threshold from below at the specified shift bars ago; a sell signal (-1) is generated when the -DI line crosses above the level_m threshold from below. Exit conditions rely solely on fixed stop loss and take profit values (SL and TP in points), with no trailing stop or partial closing mechanism. Position sizing uses a fixed lot size (Lots parameter) without any dynamic adjustment based on account balance or risk percentage. In terms of money management, the EA checks for existing positions with the same magic number via the ExtPos function to prevent duplicate entries, but only allows one position at a time per symbol regardless of direction. The overall strategy logic is simple and straightforward, representing a typical trend-following EA that relies on DI line breakouts above threshold levels to identify trend initiation.

Strengths

  • Clear and concise strategy logic based on ADX DI line breakout signals, easy to understand and verify
  • Magic number filtering prevents position conflicts with other EAs
  • ExtPos function checks existing positions to prevent duplicate entries
  • Configurable stop loss and take profit parameters provide a basic risk control framework

Weaknesses

  • Fixed lot sizing ignores account equity changes and lacks dynamic position management
  • No new bar check mechanism, signal is calculated every tick which may cause redundant triggers
  • SL/TP calculation using Point() may be inaccurate on non-5-digit broker platforms
  • No trailing stop mechanism, profitable positions may turn into losses during pullbacks
  • DI line crossing a low threshold level (5) can generate many false signals
  • Position check prevents opposite direction entry, missing trend reversal opportunities

Possible improvements

  • Add new bar check mechanism to avoid recalculating signals and redundant orders on every tick
  • Implement dynamic position sizing based on account balance and risk percentage
  • Add trailing stop functionality to protect profits and trail gains during trend continuation
  • Use SymbolInfoDouble for point value in SL/TP calculation to improve compatibility across different quote precision brokers
  • Add ADX main line filter to only enter trades when trend strength is sufficient, reducing false signals

Risk assessment

Overall risk: Medium

  • No new bar check, signal evaluation runs every tick which may attempt multiple entries on the same bar
  • DI line crossing low threshold levels (level_p=5, level_m=5) easily produces false signals leading to frequent losses
  • Fixed lot size does not adjust with account equity changes, potentially leading to excessive risk exposure after losses
  • Using ORDER_FILLING_FOK fill type may not be supported by some brokers, causing order rejection

Evaluation scores

Code quality2.0
Strategy logic2.0
Risk management2.0
Robustness2.0
Innovation1.0
Documentation1.0
Overall1.7

Parameters

ParameterDefaultDescription
Copyright"Yuriy Tokman"Copyright information string
WritingExpertAdvisors"Indicators_Scripts"Description string
e_mail"yuriytokman@gmail.com"Author email
Skype"yuriy.g.t"Author Skype
TimeFrames0 (PERIOD_CURRENT)Trading timeframe
shift1Signal bar shift offset
adx_period28ADX indicator period
MAGIC2899Magic number for identifying EA positions
Lots0.1Fixed trade lot size
SL500Stop loss in points
TP500Take profit in points
dev30Slippage tolerance
level_p5+DI line breakthrough level threshold
level_m5-DI line breakthrough level threshold

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.