Author of the idea — Alexey Kiyanitsa, author of the MQL5 code — barabashkakvn.
Fuzzy logic can be a game changer in trading, especially when integrated into your MetaTrader 5 platform. This Expert Advisor (EA) evaluates market conditions using five key indicators: Gator, WPR, AC, DeMarker, and RSI. It employs trapezoidal membership functions to assess the data, ensuring that you only make trades when your account has sufficient funds.
Parameters
double arWPR[8] = {-95,-90,-80,-75,-25,-20,-10,-5};
double arAC[8] = {0.05,0.04,0.03,0.02,0.02,0.03,0.04,0.05};
double arDeMarker[8] = {0.15,0.2,0.25,0.3,0.7,0.75,0.8,0.85};
double arRSI[8] = {25,30,35,40,60,65,70,75};
double Weight[5] = {0.133,0.133,0.133,0.268,0.333};
This EA is designed for the H1 time-frame.
From the author of the idea:
There's a wealth of theoretical material on fuzzy systems, so let's break down how this EA works:
- The EA evaluates market conditions using five indicators: Gator, WPR, AC, DeMarker, and RSI, utilizing trapezoidal membership functions.
- You can easily tweak the rankings and weights of these indicators directly in the code.
- Feel free to incorporate other methods for assessment—don't feel limited to just the indicators mentioned!
The EA's code serves as a practical introduction to fuzzy evaluation techniques in trading. It’s advisable to explore or modify it after getting familiar with the theory. A great starting point is A. Nedosekin's materials on fuzzy evaluation fundamentals. While they cover different technologies, they provide an excellent foundation in the theory.
Note:
- To include your own evaluation criteria, consider dividing them into fuzzy value boundaries (check the code for arrays like arGator[7]).
- Be cautious about over-optimizing the membership function parameters, as they won't be available as external parameters in the code, and excessive tweaking may not yield significant improvements.
- Experimentation is key! Fuzzy logic offers unique advantages in decision-making.
The optimal results were achieved on the EURUSD pair with the H1 timeframe:

Related Posts
- Mastering the Moving Average EA for MetaTrader 5: A Trader's Guide
- Creating an Expert Advisor for Dark Cloud Cover and Piercing Line Patterns with CCI Confirmation
- Harnessing MQL5 Wizard for Trading Signals: 3 Black Crows & 3 White Soldiers with MFI
- Harnessing MQL5 Wizard for Bullish and Bearish Harami Signals with CCI Confirmation
- Mastering Trading Signals with MQL5 Wizard: Bullish and Bearish Engulfing Strategies