
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
If someone has used the library in MT4, please tell me what extension the FCL file should have and where to put it.
Ihave written an indicator. The sequence is as in the article.
1. create a model (no error)
IDm=ffll_new_model(); // create model returns model index
if(IDm<0){
string txt=ffll_get_msg_textA(IDm); // get error message.
Alert("No model created "+txt);return(0);}
2.Load the file with the programme (it gives an error). The file is located in the dir. \{Expert\File . I tried with the extension .fcl .txt.
h=ffll_load_fcl_file(IDm, "Histo.txt"); // load the fuzzy modelling language program
if(h<0){
txt=ffll_get_msg_textA(IDm); // get error message.
Alert("Program file not loaded "+txt);return(0);}
3.Create a daughter.
ID1=ffll_new_child(IDm); // create a child model for the given model returns the model index
if(ID1<0){
txt=ffll_get_msg_textA(IDm); // get error message.
Alert("No daughter created "+txt);return(0);}
4.Feed the input data piece by piece. Ie.
IN=ffll_set_value(IDm,ID1,0,X); // set the value for the first input variable
IN=ffll_set_value(IDm,ID1,1,Y); // set the value for the second input variable
etc.
5. Get the output.
Res=ffll_get_output_value(IDm,ID1); // get the value for the output variable
Share your experience.
Similar problem in MT5. Does not open the file. Example code:
#property tester_file "model.fcl"
int OnInit()
{
string filename = "model.fcl";
// Считываю строку из файла и убеждаюсь, что его можно открыть.
int filehandle = FileOpen(filename,FILE_READ|FILE_ANSI);
if(filehandle < 0)
{
Print("Error code ",GetLastError());
Print(filename);
}
else
{
Print("Open success");
Print(FileReadString(filehandle));
FileClose(filehandle);
}
// FFCL
int model = ffll_new_model();
if(model < 0)
{
Print("Ошибка создания модели!");
}
int ret_val = ffll_load_fcl_file(model,filename);
if(ret_val < 0)
{
string txt = ffll_get_msg_textW(model);
Print("Ошибка: " + txt);
}
ffll_close_model(model);
return(0);
}
void OnDeinit(const int reason){}
void OnTick(){}
I get the following output:
FUNCTION_BLOCK
Open success
Why does it generate an error? As I understand, the problem is in passing a parameter to the ffll_load_fcl_file function. (probably something with encodings or type conversion).
A big request to those who have worked with this library, please answer.
It may be related to the structure of the .fcl file/ I have not found a programme to check if it is correct. The link in the text does not work. Maybe someone who has already gone through this rake, please write me back.
The library in principle is very interesting (and if also working). The author unfortunately glimpsed and disappeared. On questions does not want to answer. Not understandable mystery (or employment).
TO: SergeyVP/ The daughter model was not created and variables were not entered. So I understand you checked the possibility of loading?
Shall we exchange programmes for checking?
It will take more time to deal with the library than to write three elementary fuzzy logic functions in the code yourself:
Well, not only that. Accessory functions, defuzzification, etc. No easier.
Not really. The function returns -1, which means that it does not find the file. I thought the problem was in the library itself, I checked in C++ with dll - everything works. I took the sample code and model from the example on the site(in the sample downloads). As for the structure of the fcl file, if there is an error in the logic, the model will not be loaded and there will be something like a critical error. At least in C++, if I specified a model with an explicit error, the programme would crash:
what(): basic_string::_S_construct null not valid
TO: SergeyVP/ No child model was created and no variables were entered. So I understand you were testing the possibility of loading?
Yes, only loading for now. There is no point in creating a child model if the model is not loaded.
Shall we exchange programmes to check?
It will take more time to deal with the library than to write three elementary functions of fuzzy logic in the code myself:
Not exactly. The function returns -1, which means that it does not find the file. I thought the problem was in the library itself, I checked in C++ with dll - everything works. I took the sample code and model from the example on the site(in the sample downloads). As for the structure of the fcl file, if there is an error in the logic, the model will not be loaded and there will be something like a critical error. At least in C++, if I specified a model with an explicit error, the programme would crash, issuing:
what(): basic_string::_S_construct null not valid
Yes, only loading for now. There is no point in creating a child if the model is not loaded.
I don't check the fcl model for correctness in any way. I make a model in MATLAB, get fis file. Then I convert fis to fcl using fuzzylite programme.Unfortunately, it looks like this is how it will be. I'll have to write it myself.
Got it. Thank you.
"I took the sample code and model from the example on the site(in the sample downloads)".
I don't understand here, from which site? Please point me.
Well, maybe it is easier to link MATLAB with MT4/MT5? All the more solutions have already been offered.
I will probably move in this direction, if this library does not work.
Тут не понял, с какого сайта? Ткните плз.
From the official site of the library - ffll.sourceforge.net.
More precisely: http://ffll.sourceforge.net/downloads.htm -> Download a sample application that uses FFLL.
There is C++ code and a simple fcl model.
Well, maybe it is easier to link MATLAB with MT4/MT5? Especially the solutions have already been proposed.
From the official site of the library - ffll.sourceforge.net.
More precisely: http://ffll.sourceforge.net/downloads.htm -> Download a sample application that uses FFLL.
There is C++ code and a simple fcl model.
Where to read this?I would like to hear the "head of the transport shop" who announced this topic and wrote that everything worked wonderfully in MT4.
The problem is that the .fcl file is not loaded.
By the way: the library does not fully support the standard. There are exceptions, limitations, etc. And the output is only single-element sets.