What Is an Expert Advisor? Events Versus an Indicator

An expert advisor is a MetaTrader program that processes events and can send trade requests from its code. An indicator calculates or displays analysis and does not submit those requests. MQL4 expert advisors target MT4, and MQL5 expert advisors target MT5. The program name does not imply a profitable strategy, readable MQ4 or MQ5 source, or reliable unattended operation.

Key Takeaways

  • EAs process events; not every quote necessarily results in a separate OnTick call.
  • An order request is not proof of a fill. Check platform permissions, broker responses and resulting positions.
  • MQ4/MQ5 are source files; EX4/EX5 are compiled programs. Source availability depends on distribution terms.
  • Compile, test the rules on historical data, then evaluate operation on a demo account before considering live use.

Events, rules and trade requests

An EA is commonly attached to a chart. In MQL5, a NewTick event relates to that chart symbol. The official OnTick documentation states that a new tick is not added to the queue while another NewTick event is pending or being processed. EAs can also handle timers and other events; OnTick is not mandatory.

  • The program can evaluate every processed quote or explicitly wait for a new bar. Which price and bar it reads depends on the code.
  • A signal condition may lead to a trade request, but the EA must check the result and resulting account state.
  • Disabling AutoTrading prevents EA trade requests; it does not stop the EA from processing events. Removing an EA does not itself close existing positions.

EA, indicator and signal service are different mechanisms

An indicator calculates or displays analysis; an EA can use that analysis to manage trading requests. A signal can be a notification or part of an automatic copying service, depending on the service. Automatic execution is therefore not unique to EAs, and it does not imply that you can inspect the underlying strategy.

  • Inspect MQ4 or MQ5 source when it is supplied. An EX4 or EX5 file alone does not provide editable source.
  • MQL5 Market distributes compiled programs. Its tester demo restriction differs from a broker demo-account trial.
  • MT4 and MT5 executables are not interchangeable. Porting requires adapting platform APIs and trading behavior, not renaming the extension.

Name the event that is allowed to send the order

A moving-average cross is only an illustration, not a profit claim. Name the symbol, the timeframe, the completed bars that form the cross, and whether that NewTick may send an order or the expert advisor must wait for a new bar. Then state what the handler does when a position is already open, and define sizing, exits, trading hours, and the log line for a rejected request. Those choices are the expert advisor. An indicator that plots the same averages does not send the order or record the rejection.

  • Read price, point, or pip units from the broker symbol specification. Digits and lot step are not the same on every forex symbol.
  • State whether an opposite signal closes, reverses, or leaves the position, and whether the account is netting or hedging.
  • Log repeat signals, rejected requests, restart recovery, and maximum exposure. The indicator window for those averages does not show any of that.

Read the test as handled events, not as an indicator score

A historical test describes how this expert advisor behaved under the data and simulation settings you selected. MT5 provides several tick modes and execution-delay options, so a backtest is not automatically a run with no costs and no delays. Keep the version, inputs, and settings with the result, then repeat the same rules on later history without retuning them. The report is evidence about those events and fills. It does not score the indicator by itself.

  • Inspect individual orders and equity, including open losses. A smooth closed-trade balance can hide exposure that an indicator pane never shows.
  • On a broker demo account, watch live-feed events, permissions, and recovery. Those fills still need not match a live account.
  • Grid and loss-recovery expert advisors can add exposure after losses. Short-holding-period expert advisors are sensitive to costs. The label does not name the code.
  • No tick mode, optimization, or Monte Carlo analysis proves future profitability.

Draft MQL5 that still has to handle NewTick

Pineify can turn that event specification into MQL5 source. Read the generated handlers, compile the file in MetaEditor, and test the expert advisor in MT5. If OnTick or the order path does not match the rules, ask for a revision. A drafted file still needs that review before anyone treats it as a running expert advisor.

  • Keep one known source version with each test report, and write down the change before you rerun it.
  • Optimize this MQL5 expert advisor in MT5. Pineify Strategy Optimizer is a TradingView workflow and does not run the expert advisor.
  • Leave the terminal, or a host that keeps it running, online so the expert advisor can process events. Watch connectivity and broker errors. Automation still needs supervision.

This page is educational and does not provide investment advice. Automated trading can cause substantial losses. Historical tests and demo trading do not guarantee live results.

Frequently Asked Questions