EA-60961 · Trend Following

TuyulUncensored

This EA uses ZigZag indicator swing points combined with fast/slow EMA crossover to identify trend direction, then places pending limit orders at the 57% Fibonacci retracement level of the last ZigZag swing. It manages orders by deleting unfilled pending orders after a configurable number of bars, and includes day-of-week trading filters.

Open the interactive view (equity curve, symbol switch)

Key facts

RiskMedium
Blow-up riskLow
Rating★★☆☆☆
TypeTrading EA
TimeframesM15, H1, H4
IndicatorsZigZag, EMA
Authorzvickyhac

Backtest results (H1, about 1 year)

SymbolP&LAnnualMax DDTradesWin rateSharpeRecoveryLosing streakPer tradeStatus
EURUSD+0.97%+0.84%1.71%10.00%————Too few trades
GBPUSD+0.83%+0.72%2.06%10.00%————Too few trades
USDJPY+0.72%+0.63%2.07%10.00%————Too few trades
XAUUSD+0.28%+0.23%49.46%10.00%————Too few trades

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 combines ZigZag swing points with EMA trend direction to enter at Fibonacci retracement levels. When the fast EMA is above the slow EMA and a new ZigZag high forms, a Buy Limit order is placed at the 57% Fibonacci retracement of the swing; conversely, when the fast EMA is below the slow EMA and a new ZigZag low forms, a Sell Limit order is placed at the 57% retracement. Stop loss is set at the ZigZag extreme (buy SL at the swing low, sell SL at the swing high), and take profit is calculated as the SL distance multiplied by the TPFromSLMultiplier. Position sizing uses a fixed lot size (InitialLot) with no scaling or pyramiding logic. Money management checks free margin via OrderCalcMargin before placing orders and validates lot size against broker minimum, maximum, and step constraints. Unfilled pending orders are automatically deleted after WaitNewSignalZigZagBarCount bars, resetting the system for the next signal.

Strengths

  • Clear strategy logic combining trend identification (EMA crossover) with key retracement entry (57% Fibonacci), designed for favorable risk-reward ratio
  • Complete stop loss and take profit logic with SL at ZigZag extremes providing technical justification, and TP calculated via multiplier for positive expectancy
  • Implements pending order timeout deletion mechanism to avoid stale signals, along with trading day filters and margin checks
  • Uses limit orders instead of market orders for better entry prices, aligning with trend retracement trading philosophy

Weaknesses

  • GetLastZigZagPoints function has contradictory logic: the first half searches from index 5 and sets lastZigZagHigh/Low, but the second half iterates from index 0 and overwrites those results, rendering the first half completely useless
  • Only allows one position at a time (PositionSelect check) and does not distinguish between EA instances, causing interference when running on multiple symbols
  • BreakoutDistancePips parameter is declared but never used (dead code); variable naming mixes Indonesian and English, reducing readability
  • No spread filter, slippage protection, or volatility check — unfavorable fills may occur in high-volatility or wide-spread environments
  • OnTick uses TimeCurrent()==lastCheck to limit execution to once per second, but new bar detection should use Bars or iBars rather than timestamp comparison

Possible improvements

  • Fix GetLastZigZagPoints function: remove redundant iteration logic, clearly separate retrieval of the most recent and previous ZigZag points, ensure prevZigZagHigh/Low are correctly updated
  • Add spread filter and volatility check (e.g., ATR) to avoid entries during wide spreads or extreme volatility; replace the current timestamp-based check with a proper IsNewBar function
  • Remove unused BreakoutDistancePips parameter, unify variable naming to English, add support for multiple EA instances via MagicNumber+Symbol combination filtering
  • Add trailing stop or moving take-profit functionality to protect floating profits, and implement drawdown limits and daily loss caps as money management safeguards

Risk assessment

Overall risk: Medium

  • GetLastZigZagPoints has a logic flaw that may cause incorrect ZigZag point identification, leading to orders placed at wrong levels
  • No spread filter — limit orders may fill at unfavorable prices in wide-spread environments
  • Single position limit using PositionSelect(_Symbol) without MagicNumber filtering may conflict with other EAs
  • Fixed lot sizing with no dynamic adjustment, no maximum drawdown or consecutive loss protection mechanisms

Evaluation scores

Code quality2.0
Strategy logic3.0
Risk management3.0
Robustness2.0
Innovation2.0
Documentation1.0
Overall2.2

Parameters

ParameterDefaultDescription
MagicNumber9291Order magic number to identify this EA's orders
InitialLot0.03Initial order lot size
TPFromSLMultiplier1.2TP to SL distance multiplier ratio
ZigZagDepth12ZigZag indicator depth parameter
ZigZagDeviation5ZigZag indicator deviation parameter
ZigZagBackstep3ZigZag indicator backstep parameter
ZigZagReadBarCount100Number of bars to read ZigZag indicator
WaitNewSignalZigZagBarCount12Bar count before deleting unfilled pending orders
BreakoutDistancePips10Breakout distance in pips (declared but unused)
FastEMA9Fast EMA period
FastEMAMethodMODE_EMAfastEMAcalculation method
FastEMAPricePRICE_CLOSEFast EMA applied price
SlowEMA21Slow EMA period
SlowEMAMethodMODE_EMAslowEMAcalculation method
SlowEMAPricePRICE_CLOSESlow EMA applied price
AllowMondaytrueWhether to allow trading on Monday
AllowTuesdaytrueWhether to allow trading on Tuesday
AllowWednesdaytrueWhether to allow trading on Wednesday
AllowThursdaytrueWhether to allow trading on Thursday
AllowFridaytrueWhether to allow trading on Friday

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.