MetaTrader 4

MT4 bots: what runs on MetaTrader 4 and what does not

MetaTrader 4 was released in 2005 and is still the most widely supported retail platform there is. Its automation model is simple, extremely well documented, and carries real constraints worth knowing before you build around it.

  • Running an EA on MT4
  • VPS and connectivity
  • MT4 vs MT5
  • MarketPro EA status

Last reviewed by the MarketPro research desk · Editorial policy

Short answer

An MT4 bot is an Expert Advisor. A program written in MQL4 that runs inside MetaTrader 4 and trades automatically. It attaches to a chart, receives every price tick and can open, modify and close orders on its own. The terminal must be running and connected for it to work at all, which is why an MT4 bot in serious use lives on a VPS rather than a laptop.

Key takeaways

  • An MT4 bot only trades while the terminal is open and connected. Close it and everything stops, including exits.
  • MQL4 is not compatible with MQL5. An MT5 EA cannot run here without being rewritten.
  • AutoTrading must be enabled globally and per-EA before anything is placed.
  • A VPS near the broker's servers keeps it online and cuts execution latency.
  • The MarketPro EA for MT4 and MT5 is not available to download yet. The waiting list is open in the app.

Running a bot on MetaTrader 4

An MT4 bot is an Expert Advisor written in MQL4, compiled to .ex4 and placed in MQL4/Experts inside the terminal's data folder. It attaches to one chart, receives that instrument's ticks, and acts through MT4's order functions.

Three MT4-specific behaviours shape how bots are written for it:

  • Position-based accounting. Each trade is an independent ticket. Buying 1 lot and then buying another gives you two open positions, not one of 2 lots. So an EA has to iterate the order pool to understand its own state.
  • One instrument per chart. A multi-pair strategy means multiple chart attachments or explicit cross-symbol reads.
  • Single-threaded strategy tester. MT4's tester cannot run multi-currency backtests properly and is far slower than MT5's, which is the practical reason most new development happens on MT5.

What MT4 has going for it is reach. Almost every retail broker still supports it, the body of existing EAs and indicators is enormous, and the platform is stable and undemanding.

MT4 versus MT5

MetaTrader 4MetaTrader 5
LanguageMQL4MQL5 (C++-like)
AccountingPosition-based (independent tickets)Netting or hedging, configurable
Timeframes921
Strategy testerSingle-threaded, single-currencyMulti-threaded, multi-currency, real ticks
Pending order types46
Market depthNoYes
Broker supportNear universalVery wide and growing

For a straightforward single-pair strategy, MT4 is entirely adequate and its ubiquity is a real advantage. For anything needing multi-currency testing, tick-accurate backtests or market depth, MT5 is the better environment, see the MT5 bot guide.

Why a VPS is not optional

An EA is not a service running somewhere; it is code executing inside your terminal. If the terminal is closed, the machine sleeps, the internet drops or Windows restarts for an update, the EA stops. Positions it opened stay open, unmanaged, with no trailing stop and no exit logic.

That is the actual risk. A missed entry costs you an opportunity. A missed exit costs you money, and it happens at exactly the moment you would most want the software running.

A VPS solves it: a machine that never sleeps, on a connection that does not drop, ideally in the same data centre region as your broker's servers so execution latency is measured in single-digit milliseconds. Many brokers provide one free above a volume or balance threshold; otherwise a suitable one costs a few dollars a month. Against the cost of one unmanaged position, that is not a close decision.

What an automated system cannot do

Four limits are structural rather than a matter of build quality, and understanding them is most of what separates people who use automation well from people who lose money to it.

It cannot know what it has not been shown. A rule set encodes past relationships. When the regime changes (a trending market turns to chop, a correlation that held for two years breaks) the system keeps applying yesterday's logic with full confidence and no awareness that anything has changed.

Backtests overstate almost everything. A backtest with clean fills, fixed spread and no slippage is not a simulation of trading, it is a simulation of arithmetic. Add realistic spread, variable execution and the requeues that happen in fast markets, and a strategy that looked excellent frequently becomes marginal.

Optimisation finds coincidences. Tune enough parameters against enough history and you will find a setting that fits it perfectly. That setting describes the noise in that particular sample, not a property of the market, and it stops working the moment it meets data it was not fitted to. This is curve-fitting, and it is the single most common reason a purchased system fails.

Recovery logic hides risk instead of removing it. Martingale and grid systems produce beautiful equity curves for months, because doubling into a losing position converts many small losses into rare enormous ones. The curve is not evidence of an edge; it is evidence that the loss has not arrived yet.

The MarketPro Expert Advisor

MarketPro is building an Expert Advisor for MetaTrader 4 and MetaTrader 5. It is not available to download yet, and this page will say so until it is.

What is open today is the waiting list. Install the app, open the EA tab, and join it; everyone on the list is emailed when the builds go live. There is no charge and no card involved in joining.

When it does ship, three things will be true about it by design:

  • You install and run it. It executes on your terminal, on your account, under your configuration. MarketPro never touches your account and exercises no discretion over your funds.
  • It ships with a kill switch and an explicit as-is licence with no performance guarantee.
  • Availability is limited by region. Distribution is restricted, and eligibility is determined by residence rather than by a checkbox on a page.

Meanwhile the thing that is live is the signal feed: vetted trade ideas with entry, stop and three targets that you place yourself. That is the manual equivalent of what the EA will automate, and it is available today with one free signal a day.

Written and reviewed by the MarketPro research desk

MarketPro is a trading-signal and trading-education app operated by Harajuku Holdings LTD (Cyprus). Our signal desk publishes and tracks every trade idea in-app, and every page here is checked against the app's live behaviour before publishing. Last reviewed . How we produce signals and content · About MarketPro

MarketPro EA status: coming soon

The MarketPro Expert Advisor for MetaTrader 4 and MetaTrader 5 is not available to download yet. The in-app waiting list is open, and everyone on it is emailed the moment the builds go live. Vetted signals are available today in the app. Get MarketPro free and join the EA waiting list from the EA tab.

The MarketPro Expert Advisor is software you install and run yourself on your own MetaTrader terminal. MarketPro does not trade on your behalf, does not manage your account, and exercises no discretion over your funds. It is supplied as-is with no performance guarantee, and availability is limited by region.

FAQ

Frequently asked questions

How do I add a bot to MetaTrader 4?
File → Open Data Folder, copy the compiled file into MQL4/Experts, restart the terminal, then refresh Expert Advisors in the Navigator. Drag it onto a chart, enable "Allow algorithmic trading" in the dialog, and turn on the AutoTrading button in the toolbar. A smiling face on the chart means it is running. The Expert Advisor guide has the full walkthrough.
Can I run an MT5 bot on MT4?
No. MQL4 and MQL5 are different languages with different order-handling models, so an EA has to be compiled for the platform it runs on. Converting between them is a development job, not a setting.
Do I need to keep MetaTrader 4 open for the bot to trade?
Yes. The EA runs inside the terminal, so if the terminal is closed or the machine loses its connection, the bot stops. Including the logic that would have closed an open position. This is the main argument for a VPS.
Does MarketPro have an MT4 bot?
A MarketPro Expert Advisor for both MetaTrader 4 and MetaTrader 5 is in development and is not available to download yet. The waiting list is open in the app, and everyone on it is emailed when the builds go live. The signal feed is live today.
Trade · Learn · Earn

Signals now, EA later

The MarketPro EA is in development and the waiting list is open. The vetted signal feed is available today, free, one signal a day.

Not investment advice. Past performance is not indicative of future results.