Examples: Using Neural Networks In MetaTrader - page 10

 
Stephen Davies :
Hello, and thank you for your great tutorial! Im looking to learn more about ANN's using this tutorial and code, however I cant seem to get it to compile. Metaeditor4 seems to complain that at line 88 & 116 "path" parameter conversion is not allowed. I have never experienced this error, and after some googling am still at a loss on how to fix it to be able to test out the code. Does anyone have any ideas what might be causing this?

I have the same problem. Is this code compatible with the current version of metatrader? my build(1090, v4.00)

 

This code works for the problem, change it

int ann_load (string path)   //Inicialización de las Neuroredes
{
    int ann = -1; uchar p[];StringToCharArray(path,p,0,-1,CP_ACP);         
    ann = f2M_create_from_file (p);   // Cargar neurored ANN 
    if (ann != -1) {debug (1," Neurored ANN: '" + path + "' cargada con éxito. Su manejador: " + ann);}
    if (ann == -1) {ann = f2M_create_standard (4, AnnInputs, AnnInputs, AnnInputs / 2 + 1, 1);
         
         f2M_set_act_function_hidden (ann, FANN_SIGMOID_SYMMETRIC_STEPWISE);  //Activación neuronas de la capa oculta
         f2M_set_act_function_output (ann, FANN_SIGMOID_SYMMETRIC_STEPWISE);
         f2M_randomize_weights (ann, -0.4, 0.4);    //Inicialización de los pesos de las conexiones de las neuronas dentro de la red. Valores aleatorios.
         debug (1," Neurored ANN: '" + path + "' creada con éxito. Su manejador: " + ann);}

    if (ann == -1) {debug (0, "ERROR ¡INICIALIZANDO NEURORED!");}
    return (ann);
}

void ann_save (int ann, string path)       //FUNCION GRABAR DATOS
{
    int ret = -1; uchar p[];StringToCharArray(path,p,0,-1,CP_ACP); ret = f2M_save (ann, p);
    debug (1, "f2M_save(" + ann + ", " + path + ") resultado: " + ret);
}
 
pmorphy :

This code works for the problem, change it

This way it worked. Thank you.

 
Bruno Souza:

This way it worked. Thank you.

Replace in Fann2MQL.mqh

int f2M_create_from_file(string path);
int f2M_save(int ann,string path);

to 

int f2M_create_from_file(char &path[]);
int f2M_save(int ann,char &path[]);
 

thank you very much for creating this valuable tool .

 

Hi Mariusz,

After downloading your EA-fixed or not fixed, I tried compiling it.

It comes out many errors such as

1) can't open C:\Users\....... Fann2MQL.MQH

2) 'F2m_parallel_init" -function not defined.

There are a total of 17 errors.

Please inform how to solve it.


Thanks

 

I really would like to test how this works. But I can't compile the given MQL-Files in MetaEditor throwing these Errors on compilation:

(Warning, uncritical) return value of 'OrderSelect' should be checked -> Line 389 and 428

(Fatal Error) 'path' - parameter conversion not allowed -> Line 88 and 116

(Fatal Error) 'path' - variable of the same type expected -> Line 88 and 116


I don't know how to fix the last two fatal erros.

 
The operation of this utility is quite random.
In some periods it works and for others it does not. How can the same EA have different results with “NeuroFilter = true” and “NeuroFilter = false” in some periods, such as the old ones shown as examples in the MQL5 forum and for current periods even while training and using the same EA, we get if the same result for “NeuroFilter = true” and “NeuroFilter = false”
 
Sorry to say but,the file has been infected with Virus.
 
arber1432:
Sorry to say but,the file has been infected with Virus.

What file are you referring to?

Reason: