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
Backtest results (H1, about 1 year)
| Symbol | P&L | Annual | Max DD | Trades | Win rate | Sharpe | Recovery | Losing streak | Per trade | Status |
|---|---|---|---|---|---|---|---|---|---|---|
| EURUSD | 0.00% | 0.00% | 0.00% | 0 | — | — | — | — | — | Not convertible yet |
| GBPUSD | 0.00% | 0.00% | 0.00% | 0 | — | — | — | — | — | Not convertible yet |
| USDJPY | 0.00% | 0.00% | 0.00% | 0 | — | — | — | — | — | Not convertible yet |
| XAUUSD | 0.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
Parameters
| Parameter | Default | Description |
|---|---|---|
MM | 0.1 | Deposit ratio per trade |
MMMode | LOT | Lot sizing method (free margin/balance/loss ratio/fixed lots) |
StopLoss_ | 1000 | Stop loss in points |
TakeProfit_ | 2000 | Take profit in points |
Deviation_ | 10 | Maximum price deviation in points (slippage tolerance) |
BuyPosOpen | true | Allow long entry |
SellPosOpen | true | Allow short entry |
BuyPosClose | true | Allow close long positions |
SellPosClose | true | Allow close short positions |
InpInd_Timeframe | PERIOD_H4 | Indicator timeframe |
Periods | 4 | Filter bandwidth parameter (1/(2*Periods)) |
Taps | 21 | FIR filter taps (must be odd) |
Window | Blackman | Window function type |
SignalBar | 1 | Entry signal bar index |
Similar Trend Following EAs
Backtests are historical simulations and do not guarantee future results. Not financial advice.