Fuzzy Logic EA
This EA applies fuzzy logic principles to evaluate multiple technical indicators simultaneously and generate buy/sell trading signals. It uses membership functions to map indicator values into fuzzy sets, then applies fuzzy inference rules to produce a crisp trading decision. The approach aims to handle the uncertainty and ambiguity inherent in market analysis more gracefully than traditional binary threshold systems.
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 concept is based on a fuzzy logic inference system that takes multiple technical indicators (such as RSI, MACD, moving averages) as fuzzy input variables. Each indicator value is converted into fuzzy degrees (e.g., 'bullish', 'neutral', 'bearish') through membership functions, avoiding the rigid binary thresholds of traditional indicator-based systems. Entry conditions are determined by the fuzzy inference engine, which evaluates all fuzzy inputs according to a predefined set of IF-THEN rules, opening positions when the defuzzified output signal exceeds a set threshold. Exit conditions typically rely on reverse fuzzy signals or fixed stop-loss and take-profit levels, with some versions supporting trailing stops. Position sizing generally uses fixed lot sizes or account balance-proportional calculations. Money management may lack dynamic risk adjustment, with relatively simple stop-loss settings that do not adapt position sizes based on market volatility.
Strengths
- Fuzzy logic better handles market uncertainty, avoiding the rigid boundary problems of traditional binary indicator judgments
- Multi-indicator fusion decision-making reduces the risk of single-indicator misjudgment and improves signal reliability
- The smooth transition property of membership functions makes trading signals more robust, reducing frequent open/close cycles
- Fuzzy inference rules have strong interpretability, making it easier for traders to understand and optimize strategy logic
- Parameterized design allows users to adjust fuzzy thresholds and indicator periods to adapt to different market conditions
Weaknesses
- The design of fuzzy rule sets and membership functions relies heavily on subjective experience, lacking data-driven optimization methods
- Fixed stop-loss and take-profit do not dynamically adjust based on market volatility, potentially causing significant losses in highly volatile markets
- Lacks new bar check mechanism, potentially opening duplicate positions on the same bar
- The choice of defuzzification method may affect signal quality, and there is no comparative validation of multiple defuzzification approaches
- Does not account for slippage and spread impact on trading costs, potentially underperforming during low liquidity sessions
Possible improvements
- Introduce adaptive membership functions that automatically optimize fuzzy parameters based on historical data, reducing subjective setting bias
- Add ATR-based dynamic stop-loss and take-profit mechanism that automatically adjusts risk control parameters based on market volatility
- Add new bar detection and time filtering logic to avoid duplicate trades and unfavorable fills during inactive sessions
Risk assessment
Overall risk: Medium
- Fixed stop-loss may be gap-broken during extreme market moves, causing actual losses far exceeding expectations
- Lack of position check and new bar check may lead to duplicate position opening or overexposure risk
- Fuzzy inference rules may produce unexpected signal deviations under extreme market conditions
Evaluation scores
Parameters
| Parameter | Default | Description |
|---|---|---|
LotSize | 0.1 | Fixed lot size per trade |
StopLoss | 50 | Stop loss in points |
TakeProfit | 100 | Take profit in points; close on cumulative profit |
FuzzyThreshold | 0.6 | Fuzzy signal entry threshold |
RSI_Period | 14 | RSI indicator period |
MA_Period | 20 | Moving average period |
MACD_Fast | 12 | MACD fast EMA period |
MACD_Slow | 26 | MACD slow EMA period |
Similar Momentum EAs
Backtests are historical simulations and do not guarantee future results. Not financial advice.