Can an EA or Indicator know its filename? [solved]

 

Hello,

A short question I haven't quite figured out. Can an indicator/ea know its filename? Sort like the following. Thanks!

String fn = WhichIsMyFileName();
if(fn == 'MyIndicatorName.ex4')
{
    DoSomething();
} else {
    DoSomethingElse();
}
 
I suppose you could read the relevant *.chr file and extract the relevant information from it
 
flaab:

Hello,

A short question I haven't quite figured out. Can an indicator/ea know its filename? Sort like the following. Thanks!

Hi flaab,

WindowExpertName(), even other filename https://www.mql5.com/en/articles/1543

:D

 
onewithzachy:

Hi flaab,

WindowExpertName(), even other filename https://www.mql5.com/en/articles/1543

:D

Thanks a lot mate!! :-)
 
onewithzachy:

Hi flaab,

WindowExpertName(), even other filename https://www.mql5.com/en/articles/1543

:D

Thank you.. :) it helps!!