Docs / Getting started

How XeTerminal works

The browser terminal, the Rust gateway and the plugin on your MT5 server: how prices and trades travel between your traders and MetaTrader 5.

XeTerminal gives your brokerage its own web trading terminal. Your traders open it in a browser on desktop or phone, sign in with their MT5 account, and trade on your MetaTrader 5 server. This page explains the parts and how they fit together.

The three parts

Part Where it runs What it does
The terminal Your traders' browsers The screens traders see: market watch, charts, the order panel and their positions
The gateway XeTerminal's side A gateway written in Rust between the browser and your MT5 server
The plugin Your MT5 trade server A .dll that answers the gateway and enforces the rules for each login

How a price reaches a trader

Your MT5 server sends a tick. The plugin passes it to the gateway, and the gateway sends it to every trader watching that symbol. Each tick is delivered as MT5 sends it, with your real spread and no throttling.

When a trader's connection is slow, the gateway does not queue old prices for them. They get the newest price, so what they see is what they would trade at.

How a trade reaches MT5

When a trader clicks buy or sell, the order goes from the browser to the gateway and on to your server through the plugin's trade lane. The gateway keeps its connections alive and opens trade connections before they are needed, so an order does not wait for a connection to be set up. Trades go through about twice as fast as they did before the gateway.

What the plugin enforces

The plugin checks every request on your server, not only in the browser:

  • An investor (read-only) login can look but cannot trade
  • A trader can only change or close their own tickets

Chart history

Old candles are stored in Cloudflare R2, so a trader scrolling back through a chart does not load your MT5 server again. History is kept in the XeTerminal bucket, in a folder for your brokerage, or in a bucket you own.

When a server fails

You can connect a primary and a backup MT5 server. Health checks run every minute. If the primary stops answering, traders are moved to the backup in about 30 seconds. XeTerminal moves back once the primary has been healthy for 5 minutes.

Restarts are graceful: traders reconnect within about 10 seconds.

What you do, in order

  1. Create your account
  2. Install the plugin
  3. Open the ports
  4. Connect and test
  5. Name your terminal
  6. Launch

Something unclear or out of date? Email support@xeterminal.com.