Cant run any custom indicators in Experts. But Why?

 
tried it all i think:

#resource "\\Indicators\\polynomialyachtfunder.ex5"
#property tester_indicator "\\Indicators\\polynomialyachtfunder.ex5"


string pyf_name = "\\Indicators\\polynomialyachtfunder.ex5"



pyf_Handle = iCustom(Symbol(),PERIOD_CURRENT,"\\Indicators\\polynomialyachtfunder.ex5",InpLength,InpPower,InpDeviation,InpAppliedPrice);

Before you ask: yes, the .ex5 file is inside the indicators folder.

Also 110% sure that i compiled the indicator code.


this is what i get:

2019.11.03 08:07:40.851    loading of \Indicators\polynomialyachtfunder.ex5 EURUSD,M5 failed [557]
2019.11.03 08:07:40.851    2018.12.02 00:00:00   cannot load custom indicator '\Indicators\polynomialyachtfunder.ex5' [4802]


as i said, I tried multiple variations of the paths. Even let it print out by a function i found in the forum, so the path is definetly correct.

 
Bayne:

Before you ask: yes, the .ex5 file is inside the indicators folder.

Also 110% sure that i compiled the indicator code.


this is what i get:

2019.11.03 08:07:40.851    loading of \Indicators\polynomialyachtfunder.ex5 EURUSD,M5 failed [557]
2019.11.03 08:07:40.851    2018.12.02 00:00:00   cannot load custom indicator '\Indicators\polynomialyachtfunder.ex5' [4802]


as i said, I tried multiple variations of the paths. Even let it print out by a function i found in the forum, so the path is definetly correct.

Help:

Resources

Working with custom indicators included as resources

One or several custom indicators may be necessary for the operation of MQL5 applications. All of them can be included into the code of an executable MQL5 program. Inclusion of indicators as resources simplifies the distribution of applications.

Below is an example of including and using SampleIndicator.ex5 custom indicator located in  terminal_data_folder\MQL5\Indicators\ directory:

//+------------------------------------------------------------------+
//|                                                     SampleEA.mq5 |
//|                        Copyright 2013, MetaQuotes Software Corp. |
//|                                              https://www.mql5.com |
//+------------------------------------------------------------------+
#resource "\\Indicators\\SampleIndicator.ex5"
int handle_ind;
//+------------------------------------------------------------------+
//| Expert initialization function                                   |
//+------------------------------------------------------------------+
int OnInit()
  {
//---
   handle_ind=iCustom(_Symbol,_Period,"::Indicators\\SampleIndicator.ex5");
   if(handle_ind==INVALID_HANDLE)
     {
      Print("Expert: iCustom call: Error code=",GetLastError());
      return(INIT_FAILED);
     }
//--- ...
   return(INIT_SUCCEEDED);
  }
Documentation on MQL5: MQL5 programs / Resources
Documentation on MQL5: MQL5 programs / Resources
  • www.mql5.com
//| Calls standard OrderSend() and plays a sound                     | The example shows how to play sounds from files 'Ok.wav' and 'timeout.wav', which are included into the standard terminal package. These files are located in the folder is a folder, from which the MetaTrader 5 Client Terminal is started. The location of the terminal...
 
Vladimir Karputov:

Help:

Resources

Working with custom indicators included as resources

One or several custom indicators may be necessary for the operation of MQL5 applications. All of them can be included into the code of an executable MQL5 program. Inclusion of indicators as resources simplifies the distribution of applications.

Below is an example of including and using SampleIndicator.ex5 custom indicator located in  terminal_data_folder\MQL5\Indicators\ directory:

Thank you, the indicator handle gives out a value above 0 now, so it seems to work with the initialization this way.

I dont know why, but it takes extremely long (im still waiting for a start).


It even printed out

2019.11.03 21:14:59.454    2018.12.02 00:00:00   Stack overflow
2019.11.03 21:14:59.820    2018.12.02 00:00:00   stack overflow

though it isnt in the code (neither the Indicator nor the expert)

Any ideas what it could be?

EDIT: just finished loading now: seems to work, though i have no idea why it printed "stack overflow".

Thank you Vladimir :-)
 
Stack overflow means you are recursively calling a function, somewhere in your code.
 
Vladimir Karputov:

Help:

Resources

Working with custom indicators included as resources

One or several custom indicators may be necessary for the operation of MQL5 applications. All of them can be included into the code of an executable MQL5 program. Inclusion of indicators as resources simplifies the distribution of applications.

Below is an example of including and using SampleIndicator.ex5 custom indicator located in  terminal_data_folder\MQL5\Indicators\ directory:

Thank you, this solved my problem

Reason: