WindowExpertName() in MQL5 ?

 

Hi,

WHat is the replaced function of WindowExpertName() in MQL5 ? How can i get expert name in MQL5?


Thanks

 
yster:

Hi,

WHat is the replaced function of WindowExpertName() in MQL5 ? How can i get expert name in MQL5?


Thanks

Try to use the MQL5InfoString(MQL5_PROGRAM_NAME)
 

This s corrrect sintaxe:


string pgm_name = MQLInfoString(MQL_PROGRAM_NAME)

https://www.mql5.com/en/docs/check/mqlinfostring

Documentation on MQL5: Checkup / MQLInfoString
Documentation on MQL5: Checkup / MQLInfoString
  • www.mql5.com
Checkup / MQLInfoString - Reference on algorithmic/automated trading language for MetaTrader 5
 
fksalviano:

This s corrrect sintaxe:


string pgm_name = MQLInfoString(MQL_PROGRAM_NAME)

https://www.mql5.com/en/docs/check/mqlinfostring

Did you realize that the previous answer had been made in 2010 ??  Regards.
 
Jose Francisco Casado Fernandez:
Did you realize that the previous answer had been made in 2010 ??  Regards.
Yes, but if tomorrow  another person find this topic like i've found today, so will found the correct sintaxe 
 

However the return values of MQLInfoString(MQL_PROGRAM_NAME) do not match in MQL4 and MQL5.

While MQL4 returns the name of the file (without the extension), MQL5 returns a name assigned in IndicatorSetString(INDICATOR_SHORTNAME, ...).

 
if(MQLInfoString(MQL_PROGRAM_NAME)!="your eaname") return(0);

no extension!

 
fksalviano #:

This s corrrect sintaxe:


string pgm_name = MQLInfoString(MQL_PROGRAM_NAME)

https://www.mql5.com/en/docs/check/mqlinfostring

This one helped me