Maybe you could try to read the documentation ?
The path to itself can be received using GetRelativeProgramPath() function.
angevoyageur:
Maybe you could try to read the documentation ?
Thanks Angevoyageur, helpful as always.
angevoyageur: Maybe you could try to read the documentation ?
The path to itself can be received using GetRelativeProgramPath() function. | Except that no such function listed List of MQL4 Functions - MQL4 Reference |
WHRoeder:
angevoyageur: Maybe you could try to read the documentation ? The path to itself can be received using GetRelativeProgramPath() function. | Except that no such function listed List of MQL4 Functions - MQL4 Reference |
It is not a built-in function! It is part of the coding example in the Resources documentation (Working with custom indicators included as resources): https://docs.mql4.com/runtime/resources
//+------------------------------------------------------------------+ //| GetRelativeProgramPath | //+------------------------------------------------------------------+ string GetRelativeProgramPath() { int pos2; //--- get the absolute path to the application string path=MQLInfoString(MQL_PROGRAM_PATH); //--- find the position of "\MQL4\" substring int pos =StringFind(path,"\\MQL4\\"); //--- substring not found - error if(pos<0) return(NULL); //--- skip "\MQL4" directory pos+=5; //--- skip extra '\' symbols while(StringGetCharacter(path,pos+1)=='\\') pos++; //--- if this is a resource, return the path relative to MQL5 directory if(StringFind(path,"::",pos)>=0) return(StringSubstr(path,pos)); //--- find a separator for the first MQL4 subdirectory (for example, MQL4\Indicators) //--- if not found, return the path relative to MQL4 directory if((pos2=StringFind(path,"\\",pos+1))<0) return(StringSubstr(path,pos)); //--- return the path relative to the subdirectory (for example, MQL4\Indicators) return(StringSubstr(path,pos2+1)); }
WHRoeder:
Sorry I forgot the link, it was late. FMIC gave it.
angevoyageur: Maybe you could try to read the documentation ? The path to itself can be received using GetRelativeProgramPath() function. | Except that no such function listed List of MQL4 Functions - MQL4 Reference |
Interesting interaction between (which I believe) are THE master coders of mql4/mql5, but they know it already, lol.

You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Dear everyone!
I hope you are fine. I am writing an indicator that uses another one as resource, called "foobar.ex4". The calling indicator is named "FooBarScanner.ex4".
This particular indicator (FooBar.ex4) is recursive, meaning that inside its own code, it calls itself a few times to get information with other settings.
The FooBar.ex4 indicator works as intended, gets information from itself using recursive calls and draws on the chart without freezing. This is not an infinite loop problem.
However, when I execute the indicator which uses FooBar.ex4 as a resource, I get several errors in the mt4 terminal, like this one:
It seems that the WindowExpertName() function returns a very different thing when an indicator is used as a resource and the recursive call fails.
How should I do the iCustom() call inside FooBar.mq4 for the indicator to work as intended, and the iCustom() call tok work properly as well? Any ideas?
Thanks in advance!