FIX Order Entry
Use the FIX Order Entry session to submit, manage, and cancel orders.
For assistance or information regarding implementation of the FIX API, please contact support@sfox.com
sFOX uses FIX 4.4
Connectivity
Before logging onto a FIX session, you must establish a secure connection to the FIX gateway
Endpoints
Environment | Value | SSL Required |
---|---|---|
Production |
| Y |
Sandbox |
| Y |
TCP SSL
If your FIX implementation does not support establishing a native TCP SSL connection with SNI support, set up a local proxy such as stunnel to establish a secure connection to the FIX gateway. Refer to our QuickFIX Integration Guide for details and examples
Standard Header
A standard header is required at the start of each message
SenderCompID
s must be provided by sFOX. Contact support@sfox.com to be provided with a SenderCompID
for your session.
Tag | Name | Description |
---|---|---|
108 | HeartBtInt | Must be <= |
8 | BeginString | Must be |
49 | SenderCompID | Value provided by sFOX. Must be unique per session |
56 | TargetCompID | Must be |
StartDay |
| |
EndDay |
| |
StartTime |
| |
EndTime |
| |
TimeZone | Must be |
Messages
Logon – A
Sent by the client to initiate a session and by the server as an acknowledgement.
Only one session may exist per SenderCompId. Attempting to logon using a SenderCompId of an active session will result in an error.
Tag | Name | Required | Description |
---|---|---|---|
554 | Password | Y | Your API Key (generate one here) |
20040 | CancelOnDisconnect | N | String Field: Optionally cancel all orders on disconnect (logout or otherwise). Note: this cancels orders on the entire account.
|
QuickFIX: If you are implementing the FIX protocol using QuickFIX please refer to our QuickFIX Integration Guide
NewOrderSingle – D
Tag | Name | Required | Description |
---|---|---|---|
11 | ClOrdID | Y | Client provided order ID, must be unique per-account. If placing an order on behalf of a quote, this value should match your QuoteReqID (see OrderStatusRequest – H) |
55 | Symbol | Y | Trading pair in lowercase (see: Security List) |
54 | Side | Y |
|
40 | OrdType | Y |
or one of our Algorithm IDs |
44 | Price | Y (excluding Market orders) | Limit Price |
38 | OrderQty | Y | For limit orders, this is the quantity to trade in the base currency. For Market Sell orders, this is the amount in the base currency. |
152 | CashOrderQty | Y (OrdType = | For market buy orders, this is the amount to spend in the quote currency |
21 | HandleInst (custom usage) | N | How to execute the order:
|
59 | TimeInForce | N | The lifetime of the order:
|
20025 | Destination (custom) | N | Specific destination:
|
117 | QuoteID | N | QuoteID you'd like to place an order on behalf of (see OrderStatusRequest – H) |
Tag | Name | Algorithm | Required | Description | Default |
---|---|---|---|---|---|
20000 | StopAmount |
| N | The fixed amount to trail the market price by | |
20001 | StopPercent |
| N | The percentage to trail the market price by (given as a decimal: 10% = 0.1) | |
20010 | Interval |
| Y | The frequency at which TWAP trades are executed (in seconds) | |
20011 | TotalTime |
| Y | The maximimum time a TWAP order will stay active (in seconds). Must be >= 15 minutes (900 seconds) and the interval (tag 20010) | |
20020 | RoutingOption |
| Y | How SFOX will trade your order, |
RequestForQuote - R
Tag | Name | Required | Description |
---|---|---|---|
131 | QuoteReqID | Y | Client provided quote request ID. This identifier will also be used in any follow-up order placed on behalf of the returned quote as the ClOrdID |
55 | Symbol | Y | Trading pair in lowercase (see: Security List) |
54 | Side | Y |
|
38 | OrderQty | Y | Quantity of base currency you're interested in quoting a buy/sell order on |
OrderStatusRequest – H
Tag | Name | Required | Description |
---|---|---|---|
11 | ClOrdID | Y | Original ClOrdID when creating the order |
790 | OrdStatusReqID | N | Optionally provided value that will be echoed in the response |
OrderCancelRequest – F
Tag | Name | Required | Description |
---|---|---|---|
11 | ClOrdID | Y | Unique ID of the cancel request |
41 | OrigClOrdID | Y | Original ClOrdID provided when creating the order |
OrderCancelReplaceRequest - G
Tag | Name | Required | Description |
---|---|---|---|
11 | ClOrdID | Y | Client Order ID of this request |
41 | OrigClOrdID | Y | Client Order ID of the original order |
38 | OrderQty | N | |
44 | Price | N | |
152 | CashOrderQty | N | |
20000 | StopAmount | N | |
20001 | StopPercent | N |
OrderMassCancelRequest - q
Tag | Name | Required | Description |
---|---|---|---|
11 | ClOrdID | N | Optional client order id, echoed back in the |
530 | MassCancelRequestType | Y |
|
OrderMassCancelReport - r
Tag | Name | Description |
---|---|---|
37 | OrderID | OrderID of this report |
11 | ClOrdID | ClOrdID provided in the |
530 | MassCancelRequestType |
|
531 | MassCancelResponse |
|
532 | MassCancelRejectReason |
|
533 | TotalAffectedOrders | Number of orders that are affected by the request (note: it is not guaranteed all of these orders are canceled, only that a cancel is requested) |
58 | Text | Optional text to describe the error (if 531 = 0) |
ExecutionReport – 8
Tag | Name | Description |
---|---|---|
37 | OrderID | SFOX Assigned Order ID, when rejected this will be 0. |
17 | ExecID | SFOX Assigned Trade ID, when rejected this will be 0. |
11 | ClOrdID | Client provided order ID |
31 | LastPx | Last fill price |
32 | LastQty | Last fill quantity |
60 | TransactTime | |
55 | Symbol | Trading pair |
54 | Side |
|
40 | OrdType |
|
44 | Price | Client provided limit price, only if OrdType = 2 |
150 | ExecType | Execution type:
|
39 | OrdStatus | Current status of the order:
|
151 | LeavesQty | Amount remaining of the order |
14 | CumQty | Amount filled so far of the order |
6 | AvgPx | VWAP |
136 | NoMiscFees | Number of misc fees |
=> 137 | MiscFeeAmt | Amount of fees |
=> 138 | MiscFeeCurr | Fee Currency |
OrderCancelReject – 9
Tag | Name | Description |
---|---|---|
37 | OrderID | SFOX Order ID, unless the order is unknown (CxlRejReason = Unknown Order) |
11 | ClOrdID | Client provided order ID of the cancel request |
41 | OrigClOrdID | Client provided order ID of the original order (echoed back from the request) |
39 | OrdStatus | Existing status of the order that could not be canceled |
102 | CxlRejReason |
|
434 | CxlRejResponseTo |
|
Security List Request - x
Tag | Name | Required | Description |
---|---|---|---|
320 | SecurityReqID | Y | |
559 | SecurityListRequestType | Y | Must be |
Security List - y
Tag | Name | Description |
---|---|---|
320 | SecurityReqID | SecurityReqID from the SecurityListRequest |
322 | SecurityResponseID | Unique identifier of the response |
560 | SecurityRequestResult | This will always be |
146 | NoRelatedSym | |
-> 55 | Symbol | Underlying asset symbol in lowercase |
Last updated