roq-fix-bridge

Important

This adapter is currently “work in progress” and at the earliest expected for release 0.7.1

Purpose

  • Gateway bridge using a FIX-based message protocol

  • Integration with third-party vendors

Conda

1
2
3
conda install \
  --channel https://roq-trading.com/conda/stable \
  roq-fix-bridge
1
2
3
cp $CONDA_PREFIX/share/roq-fix-bridge/config.toml $CONFIG_FILE_PATH

# Then modify $CONFIG_FILE_PATH to match your specific configuration
1
2
3
4
5
6
roq-fix-bridge \
      --name "fix-bridge" \
      --config_file "$CONFIG_FILE_PATH" \
      --metrics_listen_address "$TCP_LISTEN_PORT" \
      --event_log_dir "$EVENT_LOG_DIR" \
      --flagfile "$FLAG_FILE"

Config

  • FIX client login credentials

Flags

1
roq-fix-bridge --help

--config_file

Config file (path)

--listen_address

Listen address (network address)

--fix_version

FIX version, e.g. 4.4

--fix_heartbeat_freq_secs

Heartbeat frequency (server to client, in seconds)

--fix_logon_timeout_secs

Logon timeout (in seconds). Must be less than or equal to heartbeat frequency. Heartbeat frequency is chosen if this flag is unspecified

Session

Client → Server

Tag

Name

Comments

108

HeartBtInt

Heartbeat interval in seconds

141

ResetSeqNumFlag

Reset sequence numbers?

553

Username

554

Password

Tag

Name

Comments

58

Text

Informative text

Tag

Name

Comments

112

TestReqId

Pass-through value (will be returned with Heartbeat)

Tag

Name

Comments

112

TestReqId

Pass-through value (copied from TestRequest)

Tag

Name

Comments

45

RefSeqNum

Sequence number causing the reject

58

Text

Informative text

371

RefTagID

Tag ID causing the reject

372

RefMsgType

Message type causing the reject

373

SessionRejectReason

Tag

Name

Comments

7

BeginSeqNo

First sequence number to replay

16

EndSeqNo

Last sequence number to replay

Server → Client

Tag

Name

Comments

108

HeartBtInt

Heartbeat interval (seconds)

Tag

Name

Comments

58

Text

Informative text

Tag

Name

Comments

112

TestReqId

Pass-through value (will be returned with Heartbeat)

Tag

Name

Comments

112

TestReqId

Some pass-through value (copied from TestRequest)

Tag

Name

Comments

45

RefSeqNum

Sequence number causing the reject

58

Text

Informative text

371

RefTagID

Tag ID causing the reject

372

RefMsgType

Message type causing the reject

373

SessionRejectReason

Tag

Name

Comments

7

BeginSeqNo

First sequence number to replay

16

EndSeqNo

Last sequence number to replay

Market Data

Client → Server

Tag

Name

Comments

320

SecurityReqId

Request ID

559

SecurityListRequestType

Request type

55

Symbol

207

SecurityExchange

263

SubscriptionRequestType

Snapshot, subscribe, unsubscribe

Tag

Name

Comments

320

SecurityReqId

Request ID

321

SecurityRequestType

Request type

55

Symbol

207

SecurityExchange

263

SubscriptionRequestType

Snapshot, subscribe, unsubscribe

Tag

Name

Comments

324

SecurityStatusReqId

Request ID

55

Symbol

Symbol

207

SecurityExchange

Exchange

263

SubscriptionRequestType

Snapshot, subscribe, unsubscribe

Tag

Name

Comments

262

MDReqID

Request ID

263

SubscriptionRequestType

Snapshot, Subscribe, Unsubscribe

264

MarketDepth

Depth?

265

MDUpdateType

Update type. Note! we currently only support incremental updates

267

NoMDEntryTypes

Count

269

MDEntryType

146

NoRelatedSym

Count

55

Symbol

207

SecurityExchange

Server → Client

Tag

Name

Comments

320

SecurityReqId

Request ID (only snapshot)

322

SecurityResponseID

Response ID

560

SecurityRequestResult

Result type

146

NoRelatedSym

Count

55

Symbol

207

SecurityExchange

58

Text

Tag

Name

Comments

320

SecurityReqId

Request ID

322

SecurityResponseID

Response ID

323

SecurityResponseType

Response type

55

Symbol

207

SecurityExchange

Tag

Name

Comments

324

SecurityStatusReqId

Request ID (only snapshot)

55

Symbol

207

SecurityExchange

325

UnsolicitedIndicator

False if snapshot, True if incremental update

326

SecurityTradingStatus

Market status

Tag

Name

Comments

262

MDReqID

Request ID

55

Symbol

207

SecurityExchange

268

NoMDEntries

Count

269

MDEntryType

Field

270

MDEntryPx

Price

271

MDEntrySize

Size

272

MDEntryDate

Begin time (UTC)

273

MDEntryTime

Begin time (UTC)

126

ExpireTime

End time (UTC)

37

OrderID

Order ID (optional)

346

NumberOfOrders

Number of orders (MBP)

290

MDEntryPositionNo

Order priority (MBO)

Tag

Name

Comments

268

NoMDEntries

Count

279

MDUpdateAction

Update action

269

MDEntryType

Field

55

Symbol

207

SecurityExchange

270

MDEntryPx

Price

271

MDEntrySize

Size

272

MDEntryDate

Begin time (UTC)

273

MDEntryTime

Begin time (UTC)

126

ExpireTime

End time (UTC)

37

OrderID

346

NumberOfOrders

Number of orders (MBP)

290

MDEntryPositionNo

Order priority (MBO)

Tag

Name

Comments

262

MDReqID

Request ID

281

MDReqRejReason

Reject reason

58

Text

Informative text

Order Management

Client → Server

Tag

Name

Comments

37

OrderID

11

ClOrdID

Unique ID (for the request)

55

Symbol

207

SecurityExchange

54

Side

Tag

Name

Comments

584

MassStatusReqID

Unique ID (for the request)

585

MassStatusReqType

Request type

55

Symbol

207

SecurityExchange

54

Side

Tag

Name

Comments

11

ClOrdID

Unique ID (for the request)

18

ExecInst

Execution instruction

55

Symbol

207

SecurityExchange

54

Side

60

TransactTime

Request timestamp

38

OrderQty

Total intended order quantity

40

OrdType

Order type

44

Price

99

StopPx

Stop price

59

TimeInForce

77

PositionEffect

210

MaxShow

Max quantity to show (if supported by exchange)

Tag

Name

Comments

41

OrigClOrdID

ClOrdID of the previous non-rejected order

37

OrderID

11

ClOrdID

Unique ID (for the request)

55

Symbol

207

SecurityExchange

54

Side

60

TransactTime

Request timestamp

Tag

Name

Comments

37

OrderID

Order ID

41

OrigClOrdID

ClOrdID of the previous non-rejected order

11

ClOrdID

Unique ID (for the request)

55

Symbol

207

SecurityExchange

38

OrderQty

Total intended order quantity

44

Price

54

Side

60

TransactTime

Request timestamp

40

OrdType

Order type

Tag

Name

Comments

11

ClOrdID

Unique ID (for the request)

530

MassCancelRequestType

Type of request (only supporting 7 = cancel all orders)

60

TransactTime

Request timestamp

Server → Client

Tag

Name

Comments

37

OrderID

11

ClOrdID

Client order ID

41

OrigClOrdID

Original client order ID

790

OrdStatusReqID

Request ID (if response to OrderStatusRequest)

584

MassStatusReqID

Request ID (if response to OrderMassStatusRequest)

911

TotNumReports

Total number of reports (if response to OrderMassStatusRequest)

912

LastRptRequested

True if last report (if response to OrderMassStatusRequest)

17

ExecID

Execution ID

150

ExecType

Execution type

39

OrdStatus

Order status

103

OrdrejReason

Order reject reason

55

Symbol

207

SecurityExchange

54

Side

38

OrderQty

Order quantity

44

Price

99

StopPx

Stop price

59

TimeInForce

18

ExecInst

Execution instruction

32

LastQty

Fill quantity (if trade)

31

LastPx

Fill price (if trade)

151

LeavesQty

Remaining order quantity

14

CumQty

Cummulative traded quantity

6

AvgPx

Average fill price

60

TransactTime

Transaction time

77

PositionEffect

Position effect

210

MaxShow

Max shown quantity

58

Text

851

LastLiquidityInd

Liquidity indicator of fill (if trade, maker or taker)

Tag

Name

Comments

37

OrderID

11

ClOrdID

Client order ID

41

OrigClOrdID

Original client order ID

39

OrdStatus

Order status

434

CxlRejResponseTo

Origin of request (OrderCancel or OrderCancelReplace)

102

CxlRejReason

Reason for reject

58

Text

Tag

Name

Comments

11

ClOrdID

Unique ID (for the request)

37

OrderID

Unique ID (from the server)

530

MassCancelRequestType

Request type

531

MassCancelResponse

Response type

532

MassCancelRejectReason

Reason for reject

58

Text

Constraints

  • The universe of {exchange, symbol} is dynamic and can not always be known at the time when a FIX client issues a request. The FIX protocol also does not allow for a client to receive notifications when an exchange hase become ready. Thus, a FIX client must expect rejects (when an {exchange, symbol} combination has not yet become available, for example) and implement a retry policy.

  • Successful FIX client subscriptions will be cached and survive gateway reconnects. This is done because the FIX protocol does not allow for a client to receive notifications when a subscription is broken. Thus, a FIX client must expect stale subscriptions and implement a timeout policy.