ICustom not loading - MQL5

 

Hello All;

I have an iCustom call in an EA. It works fine in live mode.

It was working fine in Strategy Tester as well - but no longer does. I have not made any changes to any of my system.

The log in Strategy Tester has the following messages:

2017.08.17 19:33:18.036 file Indicators\CustomCurrencyMeter_rev1.0 read error
2017.08.17 19:33:18.037 loading of CustomCurrencyMeter_rev1.0 EURUSD,M1 failed [532]
2017.08.17 19:33:18.037 2010.06.01 00:02:00   cannot load custom indicator 'CustomCurrencyMeter_rev1.0' [4802]
2017.08.17 19:33:18.037 2010.06.01 00:02:00   CCPI_Handle = -1
2017.08.17 19:33:18.037 2010.06.01 00:02:00   iCustom ERROR!!! Error Code = 4802


I can't find any reference to [532] (had assumed it was an error code since it is int he same format as [4802]. Also I'm pretty sure it is not a line number in either the Expert or the Indicator.

I've been reading some posts here but can not make sense of it. And I also tried 

#property tester_indicator "indicator_name.ex5"


to the start of the indicator - again no change.


I know many others have had this problem, but I've not found any clear information on what I'm doing wrong.


Any suggestions would be greatly appreciated.


Thanks in advance.


Jim

 

I should add that the custom indicator also runs fine in both live trading and Strategy Tester.


cheers

 
Torinex:

I should add that the custom indicator also runs fine in both live trading and Strategy Tester.


cheers

What is your code with iCustom() ?

 
Alain Verleyen:

What is your code with iCustom() ?

Hi Alain;

Here it is.

         double
         Zscore_AUD[],   
         Zscore_CAD[],   
         Zscore_CHF[],   
         Zscore_EUR[],   
         Zscore_JPY[],   
         Zscore_GBP[],   
         Zscore_NZD[],   
         Zscore_USD[];
         
         ArraySetAsSeries(Zscore_AUD,true);   
         ArraySetAsSeries(Zscore_CAD,true);   
         ArraySetAsSeries(Zscore_CHF,true);   
         ArraySetAsSeries(Zscore_EUR,true);   
         ArraySetAsSeries(Zscore_JPY,true);   
         ArraySetAsSeries(Zscore_GBP,true);   
         ArraySetAsSeries(Zscore_NZD,true);   
         ArraySetAsSeries(Zscore_USD,true);   
         
         int   CCPI_Handle = iCustom(  _Symbol,
                                       PERIOD_CURRENT,
                                       "CustomCurrencyMeter_rev1.0",
                                       Inp_CSC_LookBackPeriod,
                                       Inp_CSC_StdDevPeriod,
                                       false);
         
         if(CCPI_Handle == INVALID_HANDLE)
         {
            Print("iCustom ERROR!!! Error Code = ",GetLastError());
         }                        
      
         CopyBuffer(CCPI_Handle,0,0,3,Zscore_AUD);                                 
         CopyBuffer(CCPI_Handle,1,0,3,Zscore_CAD);                                 
         CopyBuffer(CCPI_Handle,2,0,3,Zscore_CHF);                                 
         CopyBuffer(CCPI_Handle,3,0,3,Zscore_EUR);                                 
         CopyBuffer(CCPI_Handle,4,0,3,Zscore_JPY);                                 
         CopyBuffer(CCPI_Handle,5,0,3,Zscore_GBP);                                 
         CopyBuffer(CCPI_Handle,6,0,3,Zscore_NZD);                                 
         CopyBuffer(CCPI_Handle,7,0,3,Zscore_USD);                                 
         
         double CCPI_Zscore[8];
         CCPI_Zscore[0] = Zscore_AUD[1];
         CCPI_Zscore[1] = Zscore_CAD[1];
         CCPI_Zscore[2] = Zscore_CHF[1];
         CCPI_Zscore[3] = Zscore_EUR[1];
         CCPI_Zscore[4] = Zscore_JPY[1];
         CCPI_Zscore[5] = Zscore_GBP[1];
         CCPI_Zscore[6] = Zscore_NZD[1];
         CCPI_Zscore[7] = Zscore_USD[1];
 

Is there a "CustomCurrencyMeter_rev1.0.ex5" in Indicators folder ?

Recompiled it (do you have source code ?) and try again ?

 
Alain Verleyen:

Is there a "CustomCurrencyMeter_rev1.0.ex5" in Indicators folder ?

Recompiled it (do you have source code ?) and try again ?


Alain;


Yes, the Custom Indicator is in the Indicators folder.

Have recompiled many times. It runs fine in demo trading account. It also runs in Strategy Tester when tested alone.

Only fails when called in EA via iCustom..........

 
Torinex:

Alain;


Yes, the Custom Indicator is in the Indicators folder.

Have recompiled many times. It runs fine in demo trading account. It also runs in Strategy Tester when tested alone.

Only fails when called in EA via iCustom..........


Also, the iCustom runs fine when in demo trading account.

 
Torinex:

Also, the iCustom runs fine when in demo trading account.

Try to rename it "CustomCurrencyMeter" without a dot in the name.
 
Alain Verleyen:
Try to rename it "CustomCurrencyMeter" without a dot in the name.

Alain;

You were right. That fixed it!!!!


many thanks

 
Torinex:

Alain;

You were right. That fixed it!!!!


many thanks


Alain;

This is really very strange. Now, when running in Strategy Tester, the EA opens a new Indicator sub-window, on every tick...........

I have created an empty window indicator to avoid any calculation issues. Here it is attached.

The revised iCustom call is as follows:

//+------------------------------------------------------------------+
//Custom Indicator Call

         double
         Empty_SubWindow_Buffer[];  
         
         ArraySetAsSeries(Empty_SubWindow_Buffer,true);   
         
         int   ESW_Handle = iCustom(  _Symbol,
                                       PERIOD_CURRENT,
                                       "Empty SubWindow");
         
         if(ESW_Handle == INVALID_HANDLE)
         {
            Print("iCustom ERROR!!! Error Code = ",GetLastError());
         }                        
      
         CopyBuffer(ESW_Handle,0,0,3,Empty_SubWindow_Buffer);                                 
         
The iCustom call is after the OnTick() call.
Files:
 
Torinex:

Alain;

You were right. That fixed it!!!!


many thanks

Actually it's an MT5 bug, a dot in an indicator should not be a problem. You should report it to ServiceDesk.
Reason: