Discussion of article "Fuzzy Logic in trading strategies"

 

New article Fuzzy Logic in trading strategies has been published:

The article considers an example of applying the fuzzy logic to build a simple trading system, using the Fuzzy library. Variants for improving the system by combining fuzzy logic, genetic algorithms and neural networks are proposed.

The resulting membership functions at the output, after optimization (the inputs remain unchanged since they were not optimized):

Before the changes:

Author: Maxim Dmitrievsky

 

Well the ERUUSD raises from Jan 1, 2017 to Aug 31, 2017 from 1.05093 to 19083, (thanks to Donald Trump).


The resulting membership function shows exactly this as the strategy of the RSI is kind of counter trend: practically no Buys, only sells. So do I have to assume that the result is overfitted to that market condition:


 

So interesting! I need to read over this again and again to fully get my head around it though! I'll get there!


I hope this gets the interest that you require in order to be able to write more like this.  Many thanks!

 
Carl Schreiber:

Well the ERUUSD raises from Jan 1, 2017 to Aug 31, 2017 from 1.05093 to 19083, (thanks to Donald Trump).


The resulting membership function shows exactly this as the strategy of the RSI is kind of counter trend: practically no Buys, only sells. So do I have to assume that the result is overfitted to that market condition:



Hi, yes, its just a simple example how to optimize strategies with fuzzy. Maybe next time I describe more complex strategy.

 
Maxim Dmitrievsky:

Hi, yes, its just a simple example how to optimize strategies with fuzzy. Maybe next time I describe more complex strategy.

Well there is nothing to say against your timespan but it would have been more interesting if you have checked the result against a different market behaviour like e.g.

Jul 2014 (1.34832) until Mar 2015 (1.07388) (stricly downtrend) or May 2015 (1.12108) until Sep, 2016 (1.12390) (flat market).

What if you optimize it separately on all of the three timespans and check it against the remaining two others.

 

Extremely interesting article, unfortunately I am still weak in programming, but like the article that gives an example of neural networks, where I used the base code of the article to make my EAs, I will try to do the same with the basic codes presented.


This article is one of the clearest and most interesting I have ever read.


It would be interesting to make an interpolation between this article and the article that talks about AUTOMATA (use of the "case" function) I think the two would have a good interaction.

 

I could not do it. Accuses critical error of a library

 
Joao Luiz Sa Marchioro:

I could not do it. Accuses critical error of a library


pls download this version https://www.mql5.com/ru/forum/63355#comment_5729505 (in attach)

Библиотеки: FuzzyNet - библиотека для работы с нечеткой логикой
Библиотеки: FuzzyNet - библиотека для работы с нечеткой логикой
  • 2015.08.26
  • www.mql5.com
8 новых функций принадлежности.
 

With this new library your EA worked perfectly, however, the EA I'm doing altering its structure does not work, the point is that I did not make any substantial changes, so I do not know where the error is.


I'm changing to 4 indicators and I put the 81 possible variations "Parserule", but it does not work.

 

It's possible you check the reason for not working, I could not find the error, mainly because I do not understand much of the library. Maantive the whole structure that you set up, but it does not work. With it working, I intend to put some trend indicator so EA can change the sigma alone without being reminiscent of a trend of the past, I think this solves the EA addiction in historical data.

 
Joao Luiz Sa Marchioro:

It's possible you check the reason for not working, I could not find the error, mainly because I do not understand much of the library. Maantive the whole structure that you set up, but it does not work. With it working, I intend to put some trend indicator so EA can change the sigma alone without being reminiscent of a trend of the past, I think this solves the EA addiction in historical data.


Hi, the problem is that once you add rules, you made a couple of mistakes :)

OurFuzzy.Rules().Add(rule1);
   OurFuzzy.Rules().Add(rule2);
   OurFuzzy.Rules().Add(rule3);
   OurFuzzy.Rules().Add(rule4);
   OurFuzzy.Rules().Add(rule5);
   OurFuzzy.Rules().Add(rule6);
   OurFuzzy.Rules().Add(rule7);
   OurFuzzy.Rules().Add(rule8);
   OurFuzzy.Rules().Add(rule9);
   OurFuzzy.Rules().Add(rule10);
   OurFuzzy.Rules().Add(rule11);
   OurFuzzy.Rules().Add(rule12);
   OurFuzzy.Rules().Add(rule13);
   OurFuzzy.Rules().Add(rule14);
   OurFuzzy.Rules().Add(rule15);
   OurFuzzy.Rules().Add(rule16);
   OurFuzzy.Rules().Add(rule17);
   OurFuzzy.Rules().Add(rule18);
   OurFuzzy.Rules().Add(rule19);
   OurFuzzy.Rules().Add(rule20);
   OurFuzzy.Rules().Add(rule21);
   OurFuzzy.Rules().Add(rule22);
   OurFuzzy.Rules().Add(rule23);
   OurFuzzy.Rules().Add(rule24);
   OurFuzzy.Rules().Add(rule25);
   OurFuzzy.Rules().Add(rule26);
   OurFuzzy.Rules().Add(rule27);
   OurFuzzy.Rules().Add(rule28);
   OurFuzzy.Rules().Add(rule29);
   OurFuzzy.Rules().Add(rule30);
   OurFuzzy.Rules().Add(rule31);
   OurFuzzy.Rules().Add(rule32);
   OurFuzzy.Rules().Add(rule33);
   OurFuzzy.Rules().Add(rule34);
   OurFuzzy.Rules().Add(rule35);
   OurFuzzy.Rules().Add(rule36);
   OurFuzzy.Rules().Add(rule37);
   OurFuzzy.Rules().Add(rule38);
   OurFuzzy.Rules().Add(rule39);
   OurFuzzy.Rules().Add(rule40);
   OurFuzzy.Rules().Add(rule41);
   OurFuzzy.Rules().Add(rule42);
   OurFuzzy.Rules().Add(rule43);
   OurFuzzy.Rules().Add(rule44);
   OurFuzzy.Rules().Add(rule45);
   OurFuzzy.Rules().Add(rule46);
   OurFuzzy.Rules().Add(rule47);
   OurFuzzy.Rules().Add(rule48);
   OurFuzzy.Rules().Add(rule49);
   OurFuzzy.Rules().Add(rule50);
   OurFuzzy.Rules().Add(rule51);
   OurFuzzy.Rules().Add(rule42);
   OurFuzzy.Rules().Add(rule43);
   OurFuzzy.Rules().Add(rule54);
   OurFuzzy.Rules().Add(rule55);
   OurFuzzy.Rules().Add(rule56);
   OurFuzzy.Rules().Add(rule57);
   OurFuzzy.Rules().Add(rule58);
   OurFuzzy.Rules().Add(rule59);
   OurFuzzy.Rules().Add(rule60);
   OurFuzzy.Rules().Add(rule61);
   OurFuzzy.Rules().Add(rule62);
   OurFuzzy.Rules().Add(rule63);
   OurFuzzy.Rules().Add(rule64);
   OurFuzzy.Rules().Add(rule65);
   OurFuzzy.Rules().Add(rule66);
   OurFuzzy.Rules().Add(rule67);
   OurFuzzy.Rules().Add(rule68);
   OurFuzzy.Rules().Add(rule69);
   OurFuzzy.Rules().Add(rule70);
   OurFuzzy.Rules().Add(rule71);
   OurFuzzy.Rules().Add(rule72);
   OurFuzzy.Rules().Add(rule73);
   OurFuzzy.Rules().Add(rule74);
   OurFuzzy.Rules().Add(rule75);
   OurFuzzy.Rules().Add(rule76);
   OurFuzzy.Rules().Add(rule77);
   OurFuzzy.Rules().Add(rule78);
   OurFuzzy.Rules().Add(rule79);
   OurFuzzy.Rules().Add(rule80);
   OurFuzzy.Rules().Add(rule81);
Reason: