1

I'm facing a strange error if I try to run my code:

The creation of iRSI has failed: RSI_handle_38 = -1
Runtime error = 4805
tester stopped because OnInit returns non-zero code 1

The error [4805] is described in MQL5 docs like this:

"ERR_INDICATOR_CANNOT_ADD - Error applying an indicator to chart"

Here is my code:

//HANDLERS PRO 38 - ZELENA 3
RSI_handle_38 = iRSI("CADJPY", PERIOD_H1, 24, PRICE_CLOSE);
if(RSI_handle_38 < 0){
Print("The creation of iRSI has failed: RSI_handle_38 = ", INVALID_HANDLE);
Print("Runtime error = ", GetLastError());
return(INIT_FAILED);}

The strange thing is, that this code is generated by my C# app and I have also next 37 iRSI handlers so the code is exactly the same and they manage to load properly, but this one won't.

Example of iRSI handler 1-37:

//HANDLERS PRO 37 - ZELENA 3
RSI_handle_37 = iRSI("CADCHF", PERIOD_H1, 46, PRICE_CLOSE);
if(RSI_handle_37 < 0){
Print("The creation of iRSI has failed: RSI_handle_37 = ", INVALID_HANDLE);
Print("Runtime error = ", GetLastError());
return(INIT_FAILED);}

The same thing happens with Bollinger Bands - it stops working sooner (around 9th handler).

Is it possible that MQL5 has some "limits" for handlers or what am I doing wrong?

Thank you for help.

Unheilig
  • 16,196
  • 193
  • 68
  • 98
Marek Tesař
  • 117
  • 9

1 Answers1

0

Apparently, the problem is in Strategy Tester for the specific Broker. I am testing the same "Expert" using the "iFractals" indicator with two different brokers using the same version of MT5. In one of the brokers it works fine and in the other I get the error code [4805] for any indicator ('iIndicatorName').

But if you run the "Expert" or the "Indicator" on the chart, it works fine on both brokers.

Santo
  • 71
  • 3