REST + WebSocket API for MT4 & MT5
Web Trade API (MT4/MT5)
Build your own web and mobile trading apps on a REST and WebSocket API in front of your MT4 or MT5 server: live prices with the client's group spread, account, margin, positions and orders, with order calls that are safe to retry. The trade server carries only two gateway links however many clients connect, and the gateway scales to thousands of WebSocket clients.
Key features
Live prices over WebSocket
Apps subscribe per symbol and always receive the newest price, never a stale backlog; an optional public channel serves quotes without login.
Prices your clients recognise
Each client's group spread is applied, so the app shows the same bid and ask as the terminal.
Account, margin and positions
Account details, open positions and pending orders over REST, with account, margin, position and trade events pushed over the same socket; margin and equity are the server's own figures.
Orders that are safe to retry
Open, pending, modify, delete, close and close-by calls each carry a client order id; a repeat with the same id never creates a second order and answers duplicate.
Sign-in the broker controls
MT login and password checked by your own server, bearer sessions with a configurable lifetime, read-only investor access, lockout per login and address, and optional single-use tickets from your client cabinet so the app never handles the MT password.
Light on the trade server
The MT server carries only two gateway links however many clients connect; two gateways can share sessions and prices through Redis, and one app contract covers MT4 and MT5.
How it works
- 1
Install the plugin on your MT4 or MT5 server, allow the gateway's address and set the shared token.
- 2
Run the gateway on its own machine as a Windows service, with HTTPS and the plugin address.
- 3
Enable rules for the accounts and symbols that may use the API; everything is off until you do.
- 4
Point your app at the login endpoint and the WebSocket and start building.
Frequently asked questions
Does it support both MT4 and MT5?
Yes. Separate plugins for each server share one gateway and one identical app API.
What if an order call times out?
The status is unknown: read the positions first. Retrying with the same client order id is safe and never creates a duplicate.
Does it include charts or trade history?
The API covers prices, account, positions and orders. Candles and history are not part of it; tell us what your app needs.
AIEvery product below can be fitted with AI to match your needs: anomaly detection, risk scoring, dealer assistants, client insights and automated decisions on top of your own rules.
Other products
- 01Dealer Tools (MT4/MT5)A virtual dealer that runs inside your server. Every order is scored and decided in microseconds: execution rules, dynamic spread, toxicity scoring and mirror hedging, all configured from simple tables with a web console and REST API.
- 02Copy Trade (MT4/MT5)In-house trade copying inside your own MT4 or MT5 servers: leader and follower accounts live on the same company infrastructure, so copying is executed natively by the server plugin with no external connection. Scaled, fixed and equity-based allocation, reverse copying, partial-close handling, strategy stop-loss and subscription, following and performance fees.
- 03Social Trade (MT4+MT5)Social trading across company boundaries: followers on any MT4 or MT5 server can follow leaders hosted by other brokers, through a branded mobile and web experience with a strategy marketplace, leaderboards, equity protection, symbol mapping between brokers and full performance statistics.
- 04MAM/PAMM (MT5)Multi-account money management for fund managers: pooled allocation across investor accounts, fair profit distribution, manager fees and an investor view that shows each client exactly where they stand.
- 05Risk Management System (MT4+MT5)One control room for the dealing desk: real-time exposure per symbol and group, account risk status with reasons, anti-fraud detection, stress tests, automated rules and a full audit trail of who changed what.
- 06Dynamic Leverage (MT4/MT5)Leverage that follows each account’s equity automatically, with tiers, hysteresis to avoid flip-flopping, and tighter settings around weekends and high-impact news.
- 07Swap Ledger (MT4/MT5)Swap is the hardest number in a brokerage to get right, so every charge is shown with its working: volume, contract size, swap rate, point value, triple-swap day and rollover time, account by account. Swap-free and Islamic exemptions, time-limited waivers and fixed fees per group and symbol, with a daily ledger that proves what was charged, to whom and why.
- 08Dynamic Stop Out PluginStop-out that adapts to equity level and group instead of a single server-wide number, closing positions in an orderly sequence and logging every decision.
- 09Max Exposure Position (MT4/MT5)Limits on lots, money value and number of positions per account, group and symbol, checked before every order is executed, with early warnings at a configurable threshold and clear rejection reasons.
- 10Client Cabinet (MT4+MT5)The client area your traders log into: electronic onboarding and KYC with document checks, live and demo account opening, deposits and withdrawals across payment rails, internal transfers, statements and support tickets, all in your brand.
- 11IB Portal (MT4+MT5)A multi-level Introducing Broker programme with a scheme you can shape freely: rebates per product group with per-symbol overrides, overriding commission from each downline level, net-new-money and first-deposit bonuses, and revenue share. Every payout is calculated per lot and per day and shown to the IB line by line.
- 12CRM Marketing + Sales (MT4+MT5)Marketing and sales in one place, connected to real trading data: segments built from deposits, volume and activity, email and messaging campaigns with tracked conversions, lead scoring and routing, a sales pipeline from lead to funded account, rep targets and leaderboards.
- 13Traders Mobile AppsWhite-label trading apps for Android and iOS under your own brand, with professional charting, one-tap trading, account management and optional autopilot execution of trading plans.
- 14AI for every toolAdd AI where it pays off: dealer assistants that explain risk, fraud and toxic-flow scoring, client behaviour insights, automated alerts and decision support, built on top of your existing rules and data.
- 15Managed Dealing DeskStart a forex brokerage without your own dealing team. Dealing is the hardest and most expensive part of running a broker: experienced dealers are scarce, and one mistake on the desk is a direct loss. The Brokertex team runs your dealing desk and MT4/MT5 servers every day, under the rules you set, so you can focus on winning clients.
- 16Hedge Manager (MT4/MT5)Hedge client flow automatically at other brokers or liquidity providers: every client deal on your MT4 or MT5 server opens or closes the matching hedge on your hedge accounts, one to one or as a net position, with the share and direction you choose per account.
- 17Liquidity Hub (MT4/MT5)Execution bridge and liquidity hub: client orders on your MT4 or MT5 server are routed to liquidity providers over FIX (A-book) or kept in-house as B-book by your rules, and confirmed at the LP fill price. Works alongside Dealer Tools, which keeps the B-book dealing.
- 18Market Depth Gateway (MT5)A Depth of Market for your MT5 symbols without a liquidity provider: the gateway builds a multi-level order book from a plain top-of-book feed, publishes it to the server and confirms client orders at the volume-weighted average price of the book it published. Book shape per symbol from a rule table, an empty book whenever the feed goes stale, and a telemetry record of every fill for disputes.
- 19Prop Firm Guard (MT5)Challenge and funded-account rules enforced inside your MT5 server: profit target, daily loss, daily drawdown, total loss and trailing drawdown per rule, as percentages of the account's capital or equity peak. On a breach the plugin closes positions, deletes pending orders, disables trading and mails the trader; deposits and withdrawals shift the floors so they never cause or hide a breach.
- 21Custom ToolsNeed something that does not exist yet? We design and build plugins, services and integrations for MT4/MT5 to your specification, from server plugins to back-office connectors.
Ready to see it on your own server?
Book a demo and we will walk your team through the tools that fit your brokerage.