EA-2288 · Trend Following

Exp_AFIRMA

This EA trades based on the AFIRMA (Adaptive FIR Moving Average) custom indicator, entering long when the indicator slopes upward and short when it slopes downward. It uses a windowed FIR filter with configurable taps and window functions to smooth price data and generate trend-following signals. Positions are managed with fixed Stop Loss and Take Profit levels, and trades are executed only on new bars to avoid over-trading.

Open the interactive view (equity curve, symbol switch)

Key facts

RiskMedium
Blow-up riskLow
Rating★★★☆☆
TypeTrading EA
TimeframesH1, H4, D1
IndicatorsAFIRMA (Adaptive FIR Moving Average)
AuthorCopyright © 2014, Nikolay Kositsin

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 a trend-following system based on the AFIRMA (Adaptive FIR Moving Average) custom indicator. Entry conditions are: a long position is opened when the indicator values increase across consecutive bars (Value[0]>Value[1] and Value[1]<Value[2]), and a short position is opened when values decrease (Value[0]<Value[1] and Value[1]>Value[2]). Exit conditions rely on fixed Stop Loss and Take Profit levels in points, with reverse-signal exits also supported (e.g., closing long positions when a sell signal appears). Position sizing supports multiple modes including dynamic calculation based on free margin, balance, loss share ratios, or fixed lot size. Money management is controlled by the MM parameter which determines the share of deposit per deal, defaulting to 0.1 or 10%. The strategy leverages window functions (Rectangular, Hanning, Blackman, Blackman-Harris) to optimize the FIR filter, reducing spectral leakage and improving signal smoothness for more reliable trend detection.

Strengths

  • Uses FIR filter with multiple window functions for high signal smoothness, effectively reducing false signals
  • Executes trades only on new bar formation, avoiding over-trading on every tick
  • Supports multiple position sizing modes, flexibly accommodating traders with different risk preferences

Weaknesses

  • As a trend-following strategy, it is prone to frequent false signals and consecutive losses in ranging markets
  • Lacks trailing stop functionality; fixed SL/TP may not adapt to changing market volatility
  • Depends on the custom AFIRMA indicator file; EA will fail to run if the indicator is missing
  • No trading session filter, potentially leading to unfavorable fills during low-liquidity periods

Possible improvements

  • Add a ranging market filter (e.g., ADX indicator) to pause trading during non-trending conditions and reduce false signals
  • Implement trailing stop and volatility-adaptive stops (e.g., ATR-based) to better protect profits

Risk assessment

Overall risk: Medium

  • Trend-following strategy may produce consecutive losses in ranging markets; lacks a ranging market filter
  • Fixed SL/TP does not adapt to market volatility changes; stop may be too close or take-profit too far during sharp moves

Evaluation scores

Code quality3.0
Strategy logic3.0
Risk management3.0
Robustness3.0
Innovation4.0
Documentation2.0
Overall3.0

Parameters

ParameterDefaultDescription
MM0.1Deposit ratio per trade
MMModeLOTLot sizing method (free margin/balance/loss ratio/fixed lots)
StopLoss_1000Stop loss in points
TakeProfit_2000Take profit in points
Deviation_10Maximum price deviation in points (slippage tolerance)
BuyPosOpentrueAllow long entry
SellPosOpentrueAllow short entry
BuyPosClosetrueAllow close long positions
SellPosClosetrueAllow close short positions
InpInd_TimeframePERIOD_H4Indicator timeframe
Periods4Filter bandwidth parameter (1/(2*Periods))
Taps21FIR filter taps (must be odd)
WindowBlackmanWindow function type
SignalBar1Entry signal bar index

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.