EA-16231 · Mean Reversion

FibonacciRetracement

This EA uses ZigZag indicator to identify swing highs and lows, then constructs Fibonacci retracement levels on the most recent ZigZag leg. It enters buy trades when price crosses above Fibonacci support levels in an uptrend, and sell trades when price crosses below Fibonacci resistance levels in a downtrend, with stop-loss and take-profit based on Fibonacci extension.

Open the interactive view (equity curve, symbol switch)

Key facts

RiskHigh risk
Blow-up riskLow
Rating★☆☆☆☆
TypeTrading EA
TimeframesH1, H4, D1
IndicatorsZigZag, Fibonacci Retracement
AuthorOschenker

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 Fibonacci retracement theory, assuming that price retraces to specific Fibonacci ratio levels within a trend before continuing in the original direction. Entry conditions: in an uptrend, buy when the close price breaks above the 23.6%, 38.2%, 61.8%, or 76.4% retracement level while the previous bar's close was below that level; in a downtrend, sell when the close price breaks below those retracement levels while the previous bar's close was above. Exit conditions: stop-loss is set at a fixed point distance (StopLossLevel parameter) from the entry price, and take-profit is set at the Fibo00 level plus TakeProfitAt multiplied by FiboBASE (Fibonacci extension). Position sizing uses a fixed lot size (TradeValue parameter) with no dynamic position adjustment mechanism. Money management lacks maximum drawdown control, maximum position limits, and risk-per-trade percentage calculation, relying solely on fixed stop-loss and take-profit. Trend determination is performed by the CheckTrend function comparing the relative heights of the four most recent ZigZag pivot points.

Strengths

  • Based on the classic Fibonacci retracement theory with clear and understandable logic
  • Uses ZigZag indicator to automatically identify swing pivots, avoiding subjective judgment
  • Has explicit stop-loss and take-profit mechanisms, not leaving risk entirely naked
  • Trend filter mechanism avoids frequent trading in ranging markets
  • Trade pause control (CloseBarPause) prevents immediate re-entry after stop-loss

Weaknesses

  • CheckTrend function is declared as returning bool but actually returns int values (-1, 0, 1), a serious type mismatch bug
  • In the sell condition block, the print message says 'Buy condition is TRUE' instead of 'Sell', a copy-paste error
  • TradeCheck function case 2 (sell) is never reachable because the passed parameter is -1 not 2
  • Fixed lot sizing with no dynamic adjustment based on account equity or volatility
  • Stop-loss of only 15 points is extremely tight and prone to being stopped out in volatile markets
  • OnTrade function's StringFind return value check is incorrect - should compare with -1, not use as boolean

Possible improvements

  • Fix CheckTrend return type to int, fix TradeCheck sell branch case value from 2 to -1, and correct all copy-paste errors
  • Add dynamic position sizing based on ATR or account risk percentage, and implement maximum drawdown protection and maximum position limits
  • Add spread filter and slippage protection to avoid entering trades in high-spread environments, and add new bar detection to prevent duplicate trades on the same bar

Risk assessment

Overall risk: High risk

  • CheckTrend returns int but is declared as bool, potentially causing trend detection failure or undefined behavior
  • TradeCheck's sell branch (case 2) is unreachable, so sell signals will never actually place orders
  • Fixed 15-point stop-loss is too tight and easily triggered by normal market noise
  • No spread filter means entering during high-spread conditions significantly increases trading costs
  • No new bar check means duplicate trade requests could be sent on the same bar

Evaluation scores

Code quality1.0
Strategy logic2.0
Risk management2.0
Robustness1.0
Innovation2.0
Documentation1.0
Overall1.5

Parameters

ParameterDefaultDescription
ExtDepth12ZigZag indicator depth parameter
ExtDeviation5ZigZag deviation parameter
ExtBackStep3ZigZag backstep parameter
TradeValue1Trading lot size
StopLossLevel15Stop loss distance in points
TakeProfitAt0.2Take profit at Fibonacci extension multiple
SafetyBuffer1Safety buffer from bar close to Fibonacci level (points)
TrendPrecision-5Distance threshold between current and previous high/low
CloseBarPause5Minimum bar interval between close and next trade
LevelColorclrBlackFibonacci level line color

Similar Mean Reversion 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.