Any way to detect if current scope is EA or Indicator?

 

Hi. I want to have a variable/code in my library, that will tell if current script (it is used in) is EA or INDICATOR...


what code can be used?

 
MQLInfoInteger(MQL_PROGRAM_TYPE);
Running MQL4 Program Properties - Environment State - Standard Constants, Enumerations and Structures - MQL4 Reference
Running MQL4 Program Properties - Environment State - Standard Constants, Enumerations and Structures - MQL4 Reference
  • docs.mql4.com
Running MQL4 Program Properties - Environment State - Standard Constants, Enumerations and Structures - MQL4 Reference
 
honest_knave:

THANKS!!!!!!!!  p.s. in documentation there is not stated the returning values... I tested and 2 is for EA. 
 

ENUM_PROGRAM_TYPE

Identifier

Description

PROGRAM_SCRIPT

Script

PROGRAM_EXPERT

Expert

PROGRAM_INDICATOR

Indicator