"Meta"-Trader 4/5 Bridge Plugin

"Meta"-Trader 4 and 5 (MTR4 and MTR5 in short) are popular trading platforms that are provided free by most Forex or CFD brokers, sometimes under different names. Zorro's MT4/5 bridge controls the MTR4 or MTR5 platform - the "client terminal" - through an "Expert Advisor" (EA) script. This way Zorro can trade with almost all Forex/CFD brokers.

                                MTR4 Terminal with attached Zorro

The client terminal runs on the trader's PC and communicates with the broker's MTR4 / MTR5 server via Internet. This server generates prices with a mechanism determined by the broker, manages the trades, and calculates their wins or losses. The MT4/5 bridge DLL has two sides. On the MTR4/5 side it appears as a 32 bit or 64 bit library DLL that can be called from any EA. On the Zorro side it appears as a Broker Plugin DLL. This way the bridge can theoretically be used not only by Zorro, but also by any other software for reading prices and sending orders to the MTR4 or MTR5 terminal.

Zorro login fields:

User Account number (as in the terminal's title bar)
Password Empty

Accounts.csv example entries:

Name Broker Account User Pass Assets CCY Real NFA Plugin
Generic MT4 MT4 0 0 0 AssetsFix USD 0 0 ZorroMT4
Oanda MT4 Oanda 0 4711007 0 AssetsOanda USD 0 0 ZorroMT4

Installation and setup

Installing the MT4/5 bridge requires basic Windows knowledge: you should be familiar with the concept of folders and how to copy files between them, and you should also know your broker's available assets and their symbols. First make sure that you have installed Zorro and the broker's MTR4 or MTR5 platform (for MTR5 the 64 bit version is required). Despite the lower version number, MTR4 is better suited than MTR5 for automated trading, since it requires less code, is more robust, and supports more broker commands. Thus, if your broker offers both, always use MTR4. Start the platform and connect to your account with the login data from your broker.

Installation troubleshooting

For some reason, following the 4 steps above is not easy for all users. Failure in installing the bridge is one of the most frequent support issues. The most common mistakes are installing the bridge in a wrong folder, not starting the Zorro EA, or not enabling automated trading in the platform. If you had no success in installing the bridge, here's what to check first:

By carefully following the installation steps, anyone so far got the bridge running - success rate 100%. If the above installation instructions are not enough, you can get a much more detailed instruction with many illustrations and screenshots with the RobotWealth Algo Bootcamp. But if you really feel unable to install the bridge for whatever reason, we can do it for you. Order the installation service on the support page. We'll then install Zorro with MT4/5 bridge on your PC or VPS by remote access, ready to trade, together with an asset list adapted to your broker. This, also, has 100% success rate.

MTR4/5 connection issues

MTR4/MTR5 trading issues

MTR4/MTR5 Symbols

Many MTR4/5 versions use special asset names with broker specific suffixes. For instance, the "EUR/USD" currency pair is called "EURUSD" in the MTR4 version by FXCM™, "EURUSDm" in the IBFX™ version, "EURUSDi" in the version by Traders Way™, and "EURUSD.G" in the Global Prime™ version. The Zorro EA automatically adapts the names by removing the slash and adding the broker specific suffix from EURUSD symbol name of the EA chart window. So no adaption is required on your side.

For non-currency assets with names longer than 6 characters, or for names that can not be automatically adapted this way - for instance, "GOLD" instead of "XAU/USD" - the symbols used by Meta Trader must be entered directly in the Symbol column of the used asset list. Otherwise your selected assets are not found in the terminal's symbol list, and you'll get "asset unavailable" error messages when starting your script.

All assets you want to trade must be visible in the Market Watch window. If you still get error messages about unavailable assets, you can find the reason in the Experts Log that the terminal generates. It normally tells you what the problem is.

Additional data and commands

The MTR4/5 bridge supports the following features:

The MT4/5 bridge supports the brokerCommand function with the following commands:

You can add your own commands for sending or retrieving further information from the MTR4/MTR5 client. For this, edit the zorro.mq4 / zorro.mq5 EA. Any brokerCommand(Command,Parameter) call in a Zorro script triggers the CMD_BCOMMAND part of the Zorro EA run loop. Use a Command number between 2000 and 2999 for not getting into conflict with future official broker commands. The parameter is transferred in arr[1] and can be used for calling arbitrary MTR4 / MTR5 functions. Use arr[0] for transferring a numerical return value back to Zorro. Be aware that sent parameters are stored on the terminal side and thus affect all Zorro instances connected to that terminal - not only the instance that sent the parameter.


Zorro EA functions

Zorro can directly trade with MTR4/5 through the Zorro Expert Advisor. This EA is included in MQ4/MQ5 source code, so it can be used as a template for writing own EAs that evaluate trade signals from Zorro. For this the following four functions are available in the ZorroMT4.ex4 or ZorroMT5.ex5 libraries:

ZorroInit () : int

Open the Zorro plugin. Normally called in the MTR4 init() function.


0 when the initialization failed, otherwise nonzero.

ZorroExit ()

Release the Zorro plugin. Normally called in the MTR4 deinit() function.

ZorroRequest (double& array[]): int

Receive a request from the DLL, f.i. for opening a trade. Normally called in a loop in the MTR4 start() function.


array Array of up to 10 double variables that are filled with the request parameters.


0 if no request is pending, otherwise one of the following commands: CMD_COMMENT, CMD_PRINT, CMD_ASSET, CMD_HISTORY, CMD_BALANCE, CMD_BUY, CMD_TRADE, CMD_SELL, CMD_STOP, CMD_BCOMMAND (see Zorro.mq4). The zstring() function returns a string containing the requested asset name or a text message. Asset names need possibly be converted to the specific symbol names of the MTR4 version (see remarks).

ZorroRespond (int cmd, double& array[])

Respond to a request from the DLL. Normally called to transfer the result after receiving a request.


array Array of up to 10 double variables containing the response parameters.


Example: see Zorro.mq4 or Zorro.mq5

See also:

Brokers, brokerCommand, broker plugin, MQL4 language

► latest version online