View as Markdown

Broker onboarding

Connect an account on any MT4 or MT5 broker, and what to do when we can't find the server.

You don’t need a broker-specific integration. Any MT4 or MT5 broker works with the details below.

What you provide

  • platform: mt4 or mt5
  • server: the server name as shown in the terminal’s login dialog, e.g. YourBroker-Server
  • login and password (master to trade, investor to read only)
  • serverAddress (MT4 only): the broker’s public server address, host:port, unless you upload a provisioning profile

MT5

We check the server name against our list of broker servers. A name on the list works as it is. For a name we don’t know, create a provisioning profile with the broker’s servers.dat first, then create the account with it.

MT4

MT4 has no central directory, and we don’t look up addresses for you. Give the broker’s public server address as serverAddress. You find it on your broker’s site or in the terminal’s login dialog. Without a port we use 443. The terminal then downloads the broker’s server file itself.

curl -s -X POST "$TW/users/current/accounts" -H "auth-token: $TW_KEY" \
  -H "content-type: application/json" \
  -d '{"name": "My MT4", "platform": "mt4", "server": "YourBroker-Server",
       "serverAddress": "mt4demo.yourbroker.example:443", "login": "123456", "password": "..."}'

Or upload the broker’s .srv file on a provisioning profile instead (below).

When the server isn’t found

If the name isn’t on our list and you gave no profile (or, on MT4, no serverAddress), you get E_SRV_NOT_FOUND with suggestions:

{
  "error": "ValidationError",
  "message": "We were unable to find the server 'YourBroker-Srv'. Upload a provisioning profile with its servers file, or check the server name. Suggested server names: YourBroker-Server",
  "details": { "code": "E_SRV_NOT_FOUND", "serversByBrokers": { "Your Broker Ltd": ["YourBroker-Server"] } }
}

If none fits, create a provisioning profile and upload the server file from a terminal where login works: servers.dat from MT5’s Config folder, or the broker’s .srv file from MT4’s config folder.

curl -s -X POST "$TW/users/current/provisioning-profiles" -H "auth-token: $TW_KEY" \
  -H "content-type: application/json" \
  -d '{"name": "My broker", "version": 5, "brokerTimezone": "EET", "brokerDSTSwitchTimezone": "EET"}'

curl -s -X PUT "$TW/users/current/provisioning-profiles/$PROFILE/servers.dat" \
  -H "auth-token: $TW_KEY" -F "[email protected]"

Then create the account with provisioningProfileId.

Quirks we handle

  • Symbol suffixes. EURUSD might be EURUSDm or EURUSD.r. GET …/symbols returns the exact names; use those.
  • Filling modes. MT5 brokers accept different fill policies. We choose from the symbol’s allowed modes, or you can give a priority list in fillingModes.
  • Same name, two platforms. Some brokers use one server name for MT4 and MT5. The platform you set decides.
  • Cent and micro accounts. Minimum volumes differ; read minVolume and volumeStep from the symbol specification.
  • Server time. Measured per server, never assumed. See Time zones.