Error 4002 in backesting: cannot load custom indicator '::Indicators\TDI.ex5' [4002] - page 2

 
Vinicius Pereira De Oliveira #:

See the documentation for the iCustom() function:

Now look at the input parameters of your indicator:

Your indicator call should look something like this (total of 9 parameters):

But you are passing an excessive amount of parameters... You need to fix it.

Thanks very much. I think the problem of uploading of TDI is fixed. 
But when I when change the code like you showed me.
It appears other errors lines (see the screenshot). 
int OnInit()
  {
...
   TDI_Handle_TF_1 = iCustom(Symbol(), TF_1, "::Indicators\\TDI.ex5", RSI_Period, RSI_Price, Volatility_Band, StdDev, RSI_Price_Line, RSI_Price_Type, Trade_Signal_Line, Trade_Signal_Type, UpperTimeframe);
   TDI_Handle_TF_2 = iCustom(Symbol(), TF_2, "::Indicators\\TDI.ex5", RSI_Period, RSI_Price, Volatility_Band, StdDev, RSI_Price_Line, RSI_Price_Type, Trade_Signal_Line, Trade_Signal_Type, UpperTimeframe);
   TDI_Handle_TF_3 = iCustom(Symbol(), TF_3, "::Indicators\\TDI.ex5", RSI_Period, RSI_Price, Volatility_Band, StdDev, RSI_Price_Line, RSI_Price_Type, Trade_Signal_Line, Trade_Signal_Type, UpperTimeframe);
   TDI_Handle_TF_4 = iCustom(Symbol(), TF_4, "::Indicators\\TDI.ex5", RSI_Period, RSI_Price, Volatility_Band, StdDev, RSI_Price_Line, RSI_Price_Type, Trade_Signal_Line, Trade_Signal_Type, UpperTimeframe);
   TDI_Handle_TF_Dashboard = iCustom(Symbol(), TF_Dashboard_Only, "::Indicators\\TDI.ex5", RSI_Period, RSI_Price, Volatility_Band, StdDev, RSI_Price_Line, RSI_Price_Type, Trade_Signal_Line, Trade_Signal_Type, UpperTimeframe);
   

   // OnTick();

   Comment("");    // clear the chart
   return(INIT_SUCCEEDED);
  }
 

Try replacing that last parameter (UpperTimeframe) with "true" or "false".

int  iCustom(
   string             symbol,             // symbol name
   ENUM_TIMEFRAMES    period,             // period
   string             name,               // folder/custom_indicator_name
   int                RSI_Period,         // RSI_Period: 8-25
   ENUM_APPLIED_PRICE RSI_Price,
   int                Volatility_Band,    // Volatility_Band: 20-40
   double             StdDev,             // Standard Deviations: 1-3
   int                RSI_Price_Line,
   ENUM_MA_METHOD     RSI_Price_Type,
   int                Trade_Signal_Line,
   ENUM_MA_METHOD     Trade_Signal_Type,
   bool               UseAlerts
   );
 
Vinicius Pereira De Oliveira #:

Try replacing that last parameter (UpperTimeframe) with "true" or "false".

Things are starting to move forward: the TDI is loaded, not a single error line.

But the lack of trade-taking like its MQL4 version, which has the same buying and selling conditions, persists.

 
24042018 #Things are starting to move forward: the TDI is loaded, not a single error line. But the lack of trade-taking like its MQL4 version, which has the same buying and selling conditions, persists.

The article below helped me a lot in this process:

Articles

Migrating from MQL4 to MQL5

Sergey Pavlov, 2010.05.17 13:32

This article is a quick guide to MQL4 language functions, it will help you to migrate your programs from MQL4 to MQL5. For each MQL4 function (except trading functions) the description and MQL5 implementation are presented, it allows you to reduce the conversion time significantly. For convenience, the MQL4 functions are divided into groups, similar to MQL4 Reference.

 
Vinicius Pereira De Oliveira #:

The article below helped me a lot in this process:


Ok, I'll try it. 
But I'd like to know how can I add dependencies tab like stdlib.ex5 OR stdlib.ex4 in my MQL5 folder.
Because the bot .ex5 sent by my developer contains this tab an takes all the 3 types trades conditions. 

But mine with more than 15 trades types conditions and without this tab takes only 3 of them.



 
Vinicius Pereira De Oliveira #:

The article below helped me a lot in this process:


I would like to know if it is possible that the problem comes from my compiler or MT5.

Because I just tried the bot with exactly the 3 conditions that work well in the .ex5 file that my developer sent me.

But when I compile with it in my compiler the bot works but does not take any trade opposite to that of my developer.

 
Vinicius Pereira De Oliveira #:

The article below helped me a lot in this process:


Here's a subtle detail that may be the cause of the problem.


The TDI used when I backtest my developer's bot is different from the one used when I backtest the bot I compiled.


The only thing I changed in the backtest settings is the bots I switched.


This is visible by their respective colors. Whereas in my MQL5 folder, I only have one TDI among my indicators. Each bot defines the same TDI parameters.


With my developer's bot, the trade is executed; with mine, the trade is not executed. Both bots have the same code. One was compiled by my developer and the second in my metaeditor.




 
Hi, the error reported at the beginning of this thread (error 4002) and another error reported later (error 4804) have received proper guidance for their resolution after sharing relevant code snippets for each issue. Regarding the current issue, you will have a better chance of getting useful help if you start a new thread with a detailed description of your difficulty and again share relevant code snippets that allow us to identify the error and suggest appropriate solutions. Otherwise, we can only speculate about the problem and/or point you to related topics/articles/code that may help you fix it.
 
Vinicius Pereira De Oliveira #:
Hi, the error reported at the beginning of this thread (error 4002) and another error reported later (error 4804) have received proper guidance for their resolution after sharing relevant code snippets for each issue. Regarding the current issue, you will have a better chance of getting useful help if you start a new thread with a detailed description of your difficulty and again share relevant code snippets that allow us to identify the error and suggest appropriate solutions. Otherwise, we can only speculate about the problem and/or point you to related topics/articles/code that may help you fix it.

Thanks very lots for your great help. The issue is fixed now. I just deinstalled and reinstalled my MT5 and my compiled file works like which my developer sent to me. 
Thanks again