Download MetaTrader 5

Problem with f2M_save of Fann2MQL library

To add comments, please log in or register
What is a social trading? Read the article to find that out!
danarag
27
danarag 2013.05.26 15:10 
Hello,

I am not able to get saved the ann files under Fann2MQL.dll.

I succesfully can create 2 anns (from my EA) with f2M_create_standard(int num_layers, int l1num, int l2num, int l3num, int l4num). I receive handles 0 and 1 and the EA can use them to access the anns. I can train them with historic data from the tester.

I can also create (from my EA) 2 empty destination files:

C:\Users\usuario\AppData\Roaming\MetaQuotes\Tester\5B0470693C09A8183E1208BF54BDB9BB\Agent-127.0.0.1-3000\MQL5\Files\torero25\fann-0-long.net

and

C:\Users\usuario\AppData\Roaming\MetaQuotes\Tester\5B0470693C09A8183E1208BF54BDB9BB\Agent-127.0.0.1-3000\MQL5\Files\torero25\fann-1-short.net

But when later invoking twice f2M_save(int ann, string path) for each handle and path, I only get a 12 k text file named  C:\Alpari5\C. (C:\Alpari5 is the installation folder that contains terminal.exe in Windows 7.) This file starts like this:

FANN_FLO_2.1
num_layers=4
.....

The writing rights to the directory C:\Users\usuario\AppData\Roaming\MetaQuotes\Tester\5B0470693C09A8183E1208BF54BDB9BB\Agent-127.0.0.1-3000\MQL5\Files\ are granted, because the EA can create and modify there a couple of record files.

This problem occurs either with the original Fann2MQL.dll and a recompiled beta version with Visual Studio Express 2012. Occurs also without the existence of the destination files and also targeting any other directory either in C:\ or D:\. Even in AppData\Roaming\Metaquotes\.

Any sugestion will be very appreciated.

Alain Verleyen
Moderator
30754
Alain Verleyen 2013.05.26 16:36  
danarag:
...
What is Fann2MQL.dll ? What is a "ann" ?
GBWT094114
3343
GBWT094114 2013.05.26 16:52  
Try creating the file in your original directory of the terminal, and make sure you define the location properly in your MQL5 file.
danarag
27
danarag 2013.05.26 17:59  
angevoyageur:
What is Fann2MQL.dll ? What is a "ann" ?

Hello,

Fann2MQL.dll is a library documented in fann2mql.wordpress.com/‎ that gives access to Artificial Neuronal Networks libraries documented in leenissen.dk/ 

danarag
27
danarag 2013.05.26 18:16  
PCWalker:
Try creating the file in your original directory of the terminal, and make sure you define the location properly in your MQL5 file.

Hello,

 

This was one of that my first trys, but also failed. The location is properly defined in the program, otherwise my EA would be incapable to save other files in it.

Moreover, MT5 uses 2 different locations to save files depending whether you run it in testing mode or in forward mode. You have to use these locations.

 

The problem, I think, stems from the fact that is the *.dll file who gives the order to save the files. The operation is then outside the control of terminal.exe. One clue to it can be the resulting file with the suspicious simple name of "C" that appears inside the installation directory.

 

So, your suggestion to use this directory is the choice that the *.dll file follows to put there that mysterious "C" file. And surprisingly, the function f2M_save returns 0 indicating success.

 

I think that is important to note the fact that while the EA has forbidden access to write to the installation directory, the *.dll file has free write access to it.

 

Also, the path required for the *.dll file to write the file is quite long, and maybe with such a length the operation fails to process the path correctly, and puts the file in the installation directory (where terminal.exe is) with the name shortened to the first letter. 

 

If I try to give the path relative to ...MQL5\Files\ (which is the canonical place to put files under MT5), the problem continues with a small diference: instead of "C", the file is named "t", which is the first letter of the relative path. In that case, I think it fails because the *.dll file is fed with a path that is wrong as an absolute one. 

Mariusz Woloszyn
76
Mariusz Woloszyn 2013.05.29 15:57  

Hi!

 

It's trivial. You are running terminal.exe as a regular user. You can either run it as administrator and overcome many other wirdnesses of Vista virtual store (applies to Windows 7 as well) or justcreate C:\ANN folder as a user that runs the terminal in the first place. Doing so it will have sufficient access rights for the terminal.exe app running as the smae uswer to create files.

danarag
27
danarag 2013.05.29 16:09  
emsi:

Hi!

 

It's trivial. You are running terminal.exe as a regular user. You can either run it as administrator and overcome many other wirdnesses of Vista virtual store (applies to Windows 7 as well) or justcreate C:\ANN folder as a user that runs the terminal in the first place. Doing so it will have sufficient access rights for the terminal.exe app running as the smae uswer to create files.

Thank you!
gjrexach
68
gjrexach 2014.09.06 07:10  

HI... I am having the same Problem with FANN2MQL ann_save  in MQ4. Running as Administrator does not work. MT4 is installed in Program Files (86) and FANN is installed within MQL4\Experts.

I have copied the MT4 Folder outside of Program Files and tried to run it from there, but still fails to Place the file in the ANN folder. It creates the file with the name "E" within the Terminal directory, which is where my Operating system drive is,

Would anyone have any other suggestions? 

laz
13
laz 2015.07.16 18:59  

solution ...

https://fann2mql.wordpress.com/feedback/#comment-1578 ;)

Feedback
Feedback
  • fann2mql.wordpress.com
Please leave your feedback here or join Fann2MQL group on Facebook.
To add comments, please log in or register