Home System Trading Post

Harnessing Fuzzy Logic for Trading Success with MetaTrader 5

Attachments
17502.zip (6.15 KB, Download 0 times)

Author of the ideaAlexey Kiyanitsa, author of the MQL5 codebarabashkakvn.

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 arGator[8] = {0.010,0.020,0.030,0.040,0.040,0.030,0.020,0.010};
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:

Fuzzy logic tester

Related Posts

Comments (0)