指南

FIX API for forex brokers

FIX (Financial Information eXchange) is the standard protocol liquidity providers and brokers use to exchange prices, orders and fills. Almost all FX and CFD liquidity is streamed over FIX 4.4, so every broker connecting an LP meets it.

Sessions

How a FIX session works

A FIX connection is a long running session over TCP, kept alive and kept in order by a few simple rules.

  1. 01

    Log on

    Your side connects and sends a Logon with its CompIDs and heartbeat interval. The LP answers with its own Logon.

  2. 02

    Stay in step

    Every message carries a sequence number. A gap triggers a resend request, so nothing is silently lost.

  3. 03

    Stay alive

    When there is nothing to say, each side sends a heartbeat. Silence past the interval gets a test request, then a disconnect.

  4. 04

    Reset

    Sequence numbers reset on a schedule, often daily or weekly, and both sides must agree when.

Messages

The FIX 4.4 messages brokers meet

Each message type is identified by tag 35. A price connection uses the session messages and market data; a trading connection adds orders.

  • LogonTag 35:35=AWhat it does:Opens the session. Carries SenderCompID (49), TargetCompID (56), the heartbeat interval (108) and often a username and password.
  • HeartbeatTag 35:35=0What it does:Sent when nothing else has been sent for one heartbeat interval, so both sides know the link is alive.
  • Test requestTag 35:35=1What it does:Asks the other side for a heartbeat when it has gone quiet. No answer means the session is dropped.
  • Resend requestTag 35:35=2What it does:Asks for messages again after a gap in sequence numbers.
  • Sequence resetTag 35:35=4What it does:Moves the expected sequence number on, used to fill gaps or after a scheduled reset.
  • LogoutTag 35:35=5What it does:Closes the session cleanly, usually with a reason in the text field.
  • Market data requestTag 35:35=VWhat it does:Subscribes to prices for one or more symbols, as top of book or several levels.
  • Market data snapshotTag 35:35=WWhat it does:A full picture of the current prices for a symbol.
  • Market data incrementalTag 35:35=XWhat it does:Only what changed since the last update. Many LPs stream this way.
  • Market data rejectTag 35:35=YWhat it does:The subscription was refused, for example an unknown symbol.
  • New order singleTag 35:35=DWhat it does:A new order, on trading sessions only.
  • Execution reportTag 35:35=8What it does:Order accepted, filled, partly filled or rejected.
Before you connect

What to agree with an LP

Most failed first connections come from a mismatch in one of these. Get them in writing before anyone opens a port.

  1. 01

    Spec and version

    The LP’s FIX specification document and version, almost always FIX 4.4 for FX and CFD liquidity.

  2. 02

    CompIDs and credentials

    Your SenderCompID, their TargetCompID, and any username and password sent at logon.

  3. 03

    IPs to allow-list

    LPs accept connections only from known addresses, so you need a fixed IP that will not change.

  4. 04

    Separate sessions

    Most LPs give one session for prices and another for orders, each with its own CompIDs.

  5. 05

    Heartbeat and resets

    The heartbeat interval, and when sequence numbers reset: daily, weekly, or only on request.

  6. 06

    Symbols and depth

    The exact symbol names and suffixes, and whether you get top of book or several levels of depth.

  7. 07

    Test environment

    A UAT session to prove the connection before you touch production.

  8. 08

    Support contacts

    Who to call when the session drops, and what hours they answer.

Troubleshooting

Why FIX sessions drop

The four problems behind most support tickets.

Sequence number mismatch

After a restart or a missed reset, one side expects a different number and refuses the logon. Agree the reset schedule and how to recover.

Missed heartbeats

Network trouble or a busy server delays heartbeats, the other side sends a test request, and the session drops.

Logon refused

Wrong CompID, wrong password or an IP that is not on the allow-list. The logout text usually says which.

Logged in but silent

The session stays up and heartbeats flow, but prices stop. The hardest failure to spot without a watchdog.

In XiroLink

FIX 4.4 on both sides, watched for you

XiroLink connects to LPs over FIX 4.4 or TCP, each in its own session with its own heartbeat and reconnect, from your bridge’s own fixed IP so LPs allow-list one address. A silent feed watchdog spots an LP that stays logged in but stops quoting.

It follows Centroid’s FIX 4.4 specifications both ways, and can serve your own clients over FIX as takers with their own credentials, allowed IPs and spreads. XiroLink sessions carry prices; orders are not routed.

See makers and takers

More terms such as Comp ID and heartbeat interval are in the glossary. For the whole setup from LP to MetaTrader, see how to connect a liquidity provider to MT5.

FIX questions

What is FIX API in forex?

FIX (Financial Information eXchange) is the standard protocol liquidity providers, brokers and institutional clients use to exchange prices, orders and fills. "FIX API" usually means a FIX session a provider offers for streaming prices, trading, or both.

Why is FIX 4.4 still so common?

Most FX and CFD liquidity providers built their interfaces on FIX 4.4 and kept them. FIX 5.0 splits the session layer into FIXT 1.1 and adds features, but FIX 4.4 remains the version you will meet most often.

What are SenderCompID and TargetCompID?

The identifiers each side uses in every message header (tags 49 and 56). Your SenderCompID is their TargetCompID and the other way round, and both must match what the LP set up, or the logon is refused.

Can I offer my own prices to clients over FIX?

Yes. With XiroLink you add a FIX taker with its own credentials, allowed IP ranges, symbol names and markup profile, and send the client a generated connection guide.

Do I need FIX to connect MetaTrader?

No. XiroLink connects to MT4 and MT5 through its datafeed plugins. FIX is for connecting LPs and for clients or systems that take prices over FIX.

用您自己的报价源体验 XiroLink

我们会将演示流动性桥接入模拟或真实的 LP 报价并带您逐步了解,然后与您一起搭建您自己的流动性桥。