Frequently asked questions
Is the SDK included in my subscription?
Yes. Every plan includes the EA and the SDK. They are two products with their own license: every payment email includes your EA license file, and the first one also includes your SDK license key, which then renews automatically with your subscription. With the Free plan, the SDK works with demo accounts without a license key.
Does the SDK work with MetaTrader 4?
Yes. The SDK works with MetaTrader 4 and MetaTrader 5, with the same license and the same plans: create an MT4WebClient for MT4 and an MT5WebClient for MT5, with the same methods. For MT4 you need the name of your broker's server, as shown in MetaTrader 4, your account number and your password. MetaTrader 4 has no market depth and no stop-limit orders, and it connects in Direct mode.
Which brokers work with the SDK?
Not all of them. With MetaTrader 5, the brokers that offer the MetaTrader 5 web terminal: you need the address of your broker's web terminal (this video shows how to find it). With MetaTrader 4, the servers available in the MetaTrader 4 web terminal of MetaQuotes (metatraderweb.app): you need the name of your broker's server. In both cases you also need your account number and your password. Before you buy, try the SDK with a demo account of your broker: demo accounts work without a license. If your broker is not available, use the EA.
Can I connect several accounts at once?
Yes. The Unlimited plan is designed for that: one program with as many live accounts as you need, connected at the same time. Retail and Professional include one live account. If you need many accounts with the EA, or a custom setup, contact us and we will find the right option for you.
Which connection mode should I use?
That is up to you. The default is Direct, the fastest: the SDK speaks the protocol of the web terminal itself, with every feature and nothing else to install. The SDK also has two modes that run the official web terminal in a hidden browser (Microsoft Edge, Google Chrome or Chromium), so they can keep working if MetaQuotes changes the protocol of the web terminal: Hybrid, which takes longer to start, and Browser, which is also slower in every operation. You choose the mode with one option when you create the client. Browser and Hybrid are for MetaTrader 5; MetaTrader 4 uses the Direct mode. See Connection modes.
How do I use my license key in the SDK?
Pass it when you create the client: LicenseKey in C#, license_key in Python, C++ and Rust, licenseKey(...) in Java. The first run needs an internet connection to activate it.
Why does the SDK ask me to update?
Each version of the SDK works for 3 years from its release. As the SDK comes with a monthly or yearly subscription, this guarantees that everyone runs an up-to-date, supported version, and leaves plenty of time to update. Your program warns you 60 days before; then download the latest version from the website, free with your subscription. Your code does not need to change.
Native library not found
The program cannot find mtsocketapi_native.dll (Linux: libmtsocketapi_native.so).
Put it next to the program, or set the environment variable MTSOCKETAPI_LIB to its full path. Every example prints
the version and the path of the library it loaded on the first line.
Windows or Linux?
A .dll only works on Windows and a .so only on Linux; the code of the bindings is the same.
Times
Trading times (history, candles, positions) are in broker time (Account.ServerOffset seconds ahead of
UTC); calendar times are UTC.