How EAs work
An Expert Advisor attaches to a chart in MetaTrader and is called by the platform on each new tick or candle close. The EA checks market conditions and places, modifies, or closes orders as programmed.
EAs can read price data, indicators, account status, and open positions. They cannot access external data unless the code makes an HTTP request or the data is provided through a custom indicator.
File formats
EAs are compiled to .ex5 (MT5) or .ex4 (MT4) binary files. The source code is .mq5 or .mq4. Distributing only the compiled .ex5 prevents customers from reading or copying the underlying strategy logic.