Real Author
Dmitry Kalyuzhny. FuzzyNet project website  http://sourceforge.net/projects/fuzzynet/
Unzip the archive into the terminal_data_folder.
The library codes are located in the <terminal_data_folder>\MQL5\Include\Math\FuzzyNet\
Sample test scripts can be found in the <terminal_data_folder>\MQL5\Scripts\FuzzyNet\
FuzzyNet is one of the most popular mathematical libraries for creating fuzzy models
Fuzzy Logic Library for Microsoft.Net (FuzzyNet) is an easy to use component that implements Mamdani and Sugeno fuzzy inference systems.
FuzzyNet includes:
The following additions have been made when converting the library into MQL5:
Using the Library
Note: The Mamdanitype inference system can be configured at any stage after its creation before the system calculation function is called. If the system settings have not been changed after its creation, the system works with default settings:
Conversion of the FuzzyNet library (v. 1.2.0) is displayed below.
To work with the library, include MamdaniFuzzySystem.mqh or SugenoFuzzySystem.mqh file depending on the system you are creating.
Below is more detailed information about FuzzyNet ported library packages:Packages 
Description 

Dictionary.mqh 
The package contains additional classes necessary for other packages. 
FuzzyRule.mqh 
Classes for creating fuzzy rules:
The package also contains auxiliary classes for implementing fuzzy rules. 
FuzzyTerm.mqh  Package for creating fuzzy terms. 
FuzzyVariable.mqh  Package for creating fuzzy variables. 
GenericFuzzySystem.mqh  The class implements the common functionality for Mamdani and Sugeno systems. 
Helper.mqh  The package contains additional classes necessary for other packages. 
InferenceMethod.mqh  The package contains additional classes necessary for other packages. 
MamdaniFuzzySystem.mqh  The class for creating a Mamdanitype fuzzy system. 
MembershipFunction.mqh  Classes of membership functions:

RuleParser.mqh  Class for analyzing fuzzy rules. 
SugenoFuzzySystem.mqh  Class for creating a Sugenotype fuzzy system. 
SugenoVariable.mqh  The package contains the following classes:
Sugenotype fuzzy variables are used when developing rules for a Sugenotype system. 
Using FuzzyNet Library in MQL5
Before writing a fuzzy system, you should have a clear vision of its elements, including:
The system development and calculation:
For a Mamdanitype system:
MamdaniFuzzySystem *fuzzy_system=new MamdaniFuzzySystem();For a Sugenotype system:
SugenoFuzzySystem *fuzzy_system=new SugenoFuzzySystem();
FuzzyVariable *fuzzy_variable=new FuzzyVariable(const string name,const double min,const double max);
fuzzy_variable.Terms().Add(new FuzzyTerm(const string name,new IMembershipFunction());
fuzzy_system.Input().Add(FuzzyVariable fuzzy_variable);
SugenoVariable *sugeno_variable=new SugenoVariable(const string name);Linear functions interpreting the linear combination of input values are added to a Sugenotype fuzzy variable instead of fuzzy terms. A name and a coefficient array are used as linear function parameters. A linear equation is formed based on that array, therefore, it is important to comply with the order of elements in the array. A coefficient array length should be equal to the amount of input values or exceed it by one. If the lengths are equal, an absolute term of an equation is equal to zero. If the array length exceeds the amount by one, an absolute term is equal to the last element value. All other array elements beginning from the first one are assigned to fuzzy input variables in the order they were entered into the system.
sugeno_varriable.Functions().Add(fuzzy_sytem.CreateSugenoFunction(const string name, const double &coeffs[]));
For a Mamdanitype system:
fuzzy_system.Output().Add(FuzzyVariable fuzzy_variable);
For a Sugenotype system:
fuzzy_system.Output().Add(FuzzyVariable fuzzy_variable);
For a Mamdanitype system:
MamdaniFuzzyRule *fuzzy_rule = fuzzy_system.ParseRule(const string rule_text);
For a Sugenotype system:
SugenoFuzzyRule *fuzzy_rule = fuzzy_system.ParseRule(const string rule_text);
For a Mamdanitype system:
fuzzy_system.Rules().Add(MamdaniFuzzyRule fuzzy_rule);
For a Sugenotype system:
fuzzy_system.Rules().Add(SugenoFuzzyRule fuzzy_rule);
Dictionary_Obj_Double *p_od_in=new Dictionary_Obj_Double;The class implements the SetAll(CObject *key, const double value) method accepting two parameters  a fuzzy variable and a numerical value. This element is an input variable of the system.
p_od_in.SetAll(FuzzyVariable fuzzy_variable,const double value);All other input values are filled the same way. Create the list and add all values to it:
CList *in=new CList; in.Add(p_od_in);
Dictionary_Obj_Double *p_od_out=new Dictionary_Obj_Double; CList *out=new CList;
out=fuzzy_system.Calculate(in);After that, the out list stores all calculated output values in the order they were entered into the system. We only need to receive them:
p_od_out=out.GetNodeAtIndex(int index); double result=p_od_out.Value();Now, the result variable stores the system calculation result for an output value entered into the system under a number specified in index.
Sample Scripts
Tips Sample (Mamdani)
Tips_Sample_Mamdani.mq5 calculates the tip percentage you need to pay depending on the quality of service and food.
Enter the input parameters:
Calculation results:
Cruise Control Sample (Sugeno)
Cruise_Control_Sample_Sugeno.mq5 sample script is an example of a fuzzy regulator. It represents a car cruise control system that calculates the necessary acceleration using the data on the current deviation and the deviation rate of change in order for the car to reach a desired speed.
Enter the input parameters:
Calculation results:
Translated from Russian by MetaQuotes Software Corp.
Original code: https://www.mql5.com/ru/code/13697
This file replaces the WndContainer.mqh original file. It prevents the chart from being affected when you click and hold the mouse inside a container area.
DonchianChannels_HTFThe DonchianChannels indicator with the timeframe selection option available in the input parameters.
Bug fixed versions of CRect and CCanvas which are part of the standard library.
FlatTrend_HTFThe FlatTrend indicator with the timeframe selection option available in the input parameters.