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.