Case Study — Platform Connectivity

MetaTrader 5 Gateway to Nasdaq OMX

Three custom MT5 gateway adapters — price, order and management — connecting MetaTrader 5 retail traders and their Expert Advisors to the Nasdaq OMX platform at the OSE and TOCOM, with full futures support. Delivered 2014.

Executive Summary

MetaTrader 5 (MetaQuotes) lets brokers give retail clients a familiar trading front-end — including the ability to write and run their own automated "Expert Advisor" strategies in MQL5. To connect MT5 clients to Japanese futures markets, Touch-Fire built three purpose-made gateway adapters that make MT5 and the Touch-Fire platform fully interoperable.

Each adapter shares Touch-Fire's standard adapter architecture, but bridges the specifics of the MT5 Gateway and Manager APIs — translating between MT5's volume-delta order books, its synchronous/asynchronous order acknowledgement model, and the Touch-Fire hub — to route prices, orders and account management to and from Nasdaq OMX at the OSE and TOCOM.

Three Adapters, One Platform

The price adapter pushes prices from the Touch-Fire hub into the MT5 servers. The hard part is that MT5 consumes market depth as volume deltas per price level, whereas the price server publishes absolute volumes.

  • Delta computation: a local instrument summary mirrors the price server's book; each incoming update is applied to compute the per-level delta MT5 requires, including explicit removal of depths that fall outside the book.
  • Initial book replay: on every reconnect, the full book is rebuilt and sent, while live updates are buffered in a circular queue and replayed in order — discarding any already captured in the snapshot — to guarantee a correct starting book.
  • Ticks: last-price ticks feed the MT5 charts; for instrument classes without frequent trades, the best bid is sent so charting stays live.

The order adapter takes orders from MT5 and returns execution reports. MT5 offers two acknowledgement models, and choosing correctly is essential to avoid orders stuck in an unknown state.

  • Synchronous confirmation for fill-or-kill / fill-and-kill market orders that will never rest in the market.
  • Full MT5 order semantics handled — market and pending orders, modifications and cancels, stop-loss/take-profit and stop-out events, and order expiry managed on the Touch-Fire side.
  • Drop-copy injection of position-offset orders back into MT5 so positions stay consistent across both systems.

Full integration with the MT5 Manager API, to handle multiple automated management functions, covering user admin, account admin and keeping the position and account balances aligned with the model required on the Japanese markets.

  • Query, insert, update and delete MT5 accounts via JSON advisor queries, with group-level and pre-filtered lookups.
  • Balance operations executed as proper MT5 balance deals (deposit/withdrawal), and password changes via the dedicated API calls.

A dedicated session manager keeps MT5 and Touch-Fire in step across disconnects. On reconnect it recovers persisted orders and resumes processing only beyond the last handled sequence number to avoid duplicates; on disconnect it cleanly drains the outbound queue so no message is lost during a restart.

Results & Impact

Retail traders use the MetaTrader 5 experience they already know — charts, depth-of-market and Expert Advisors — to trade futures on Nasdaq OMX at the OSE and TOCOM. Delta-based book maintenance and initial-book replay keep MT5's order books perfectly synchronised with the live market, even across reconnects. The management adapter brings MT5 account administration and balance operations under the same Touch-Fire control plane as the rest of the platform.

Related Capabilities

High-throughput connectivity for market makers and DMA clients. Virtual order books and synthetic pricing built on our market-data core. Accounts, balances, clearing and post-trade reporting.

Connecting a Retail Platform to Market?

Touch-Fire builds the gateway adapters that link third-party trading platforms to exchanges across Japan and Asia. Talk to us about your connectivity.

Contact us about platform connectivity.