Expert Advisor Vs Custom Indicator

 

I am new to MT Trader and got the following questions. Any help is apprecaited.

1) Both EA and Indicators are written in MQL4, how does MT Trader know whether it is an EA or indicator? I checked the reference, the program structures seem no different (i.e. init(), start()). Other than the code are being put in different directories, I couldn't find the different. When I load an indicator with EA, it does give a "file is an indicator" message in log file. Therefore MT must have a way knowing it is an indicator. My question is how can it find out?

2) I am trying to develop some code base on an indicator (i.e. when an indicator shows up, the order will get execute). I read the MACD Sample already. Is there any place I can find more sample code which execute orders based on indicators?

Thanks in advance.

- tony

 
Most often indicator's body has 'indicator_chart_window' or 'indicator_buffers' codewords.