FIX API Specification – Orders

XTRDFIX API Specification – Orders
Back To Main Page

Order states diagram

Dictionaries

Security Type

Type Value Description
Foreign Exchange Contract FOR All fiat to fiat pairs
Digital Assets Spot Contract CRYPROSPOT All crypto to crypto or crypto to fiat spot contracts

Order Types

Order Type Comments
Market(1) When sending market orders, Price or StopPx is not required to be set
Limit(2) When sending limit orders, Price(44) field is required to be set

Order Sides

Supported 3 sides:

– Buy(1)
– Sell(2)

Time in Force

Type Comments
Day(0) If order becomes pending, it will be canceled at the end of the trading session
Good Till Cancel(1)
Immediate Or Cancel(3) Limit order will be executed at an exact price or better immediately, else will be canceled
Fill Or Kill(4) Order will be filled for the quantity specified in OrderQt, else will be canceled

Messages

Logon

Tag Field Name Required Comments Example
98 EncrypMethod Y Always set to None(0) 98=0
108 HeartBtInt Y Heartbeat interval, always 30s 108=30
553 Username Y 553=1001
554 Password Y 554=Rr68twd6mw

Logout

Tag Field Name Required Comments Example
58 Text N Optional text 58=regular disconnection

NewOrderSingle

Tag Field Name Required Comments Example
1 Account Y Login ID, associated with given session 1=1001
11 ClOrdID Y Client assigned order ID 11=1234
12=ORD_1234
38 OrderQty Y Initial Order size 39=0.125
40 OrdType Y Type of order
Supported values:

  • Market(1)

  • Limit(2)

40=1
44 Price C Conditional field, indicating an expected fill price.
Required for:
  • Limit
44=0.033528
99 StopPx C Conditional field, required for Stop order type 99=0.033612
54 Side Y Order side used
Supported Values:

  • Buy(1)

  • Sell(2)

54=1
55 Symbol Y Symbol name 55=ETH/BTC
59 TimeInForce Y Control orders lifetime behavior.
Supported Values:

  • Day(0)

  • Good till Cancel(1)

  • Immediate or Cancel(3)

  • Fill Or Kill(4)

59=0
60 TransactionTime Y Timestamp in UTC timezone when the order was created with included
milliseconds
60=20180912-12:05:
15.105
100 ExDestination Y ECN or Venue name where the order will be sent/executed 100=OKEX
167 SecurityType Y Type of security to trade.
Supported values:

  • CRYPTOSPOT - Digital Assets spot market contract

  • FOR - Foreign exchange contract

167=FOR

OrderCancelRequest

OrderCancelRequest is used to cancel the order in its entirety. Only orders in NEW or PARTIALLY_FILLED statuses can be canceled. If you need to cancel only a part of the non-filled amount (leaves quantity), please refer to OrderCancelReplaceRequest.

Tag Filed Name Required Comments Example
1 Account Y Trader, which hold particular order to cancel 1=1001
11 ClOrdID Y Client order ID for cancel operation 11=1234
37 OrderID Y OrderID which should be canceled 37=312351044
41 OrigClOrdID Y Client order ID of order which should be canceled 41=1233
54 Side Y Order side of order, identified by OrigClOrdID/OrderID 51=1
55 Symbol Y Symbol, association with working order 55=ETH/USD
60 TransactionTime Y Timestamp in UTC timezone when an order was created with included
milliseconds
60=20180912-12:05:
15.105

OrderCancelReject

This message will be sent by the server in response to OrderCancelRequest if the operation failed for some reason.

Tag Field Name Required Comments Example
1 Account Y 1=1001
11 ClOrdID C ID of client order which was used to perform cancel operation 11=CCL_001
41 OrigClOrdID C ID of canceling client order 41=TRD_00231
37 OrderID C ID of working order on XTRD side. Usually transmitted as OrderID within
ExecutionReport message
37=1123423
102 CxlRejReason Y Supported Values:

  • 0 - Too late to cancel

  • 1 - Unknown order(send when at least one of order related fields are missed, contains
    incorrect information or order can't be found)

  • 2 - Broker/Exchange option

  • 99 - Other

102=0
434 CxlRejResp
onseTo
Y Supported Values:

  • 1 - OrderCancelRequest

434=1
58 Text C Textual comments about rejection reason 58=Can't cancel
filled order
60 Transaction
Time
Y Timestamp in UTC timezone when Order can rejected 60=20180912-12:
15:15.105

ExecutionReport

Tag Field Name Required Comments Example
1 Account Y Login ID, associated with a given session 1=1001
11 ClOrdID Y Client-assigned order ID 11=1234
12=ORD_1234
37 OrderID Y Order ID on XTRD side 37=312351043
198 SecondaryOrderID C Order ID, assigned by target exchange 198=ea4063b0-4b66-
11ea-b77f2e728ce88125
17 ExecID Y Order execution ID
This field will be set to zero("0") when processing MassOrderStatusRequest message
(ExecType=ORDER STATUS(I))
17=4000123541
584 MassStatusReqId N Request ID, associated with MassOrdertStatusRequest message 584=ord_req_1223
911 TotNumReports
N A conditional field that will appear in the response to Order Mass Status Request(AF)
message. Contains a total number of all orders that meet search criteria
911=14
912 LastRptRequested N A conditional field that appears only for reports with ExecType=ORDER STATUS.
Indicates that this is the very last message in the batch
913=Y
40 OrdType Y Order Type (Market, Limit) 40=1
54 Side Y Order side used
Supported Values:

  • Buy(1)

  • Sell(2)

54=1
55 Symbol Y Symbol name 55=ETH/BTC
39 OrdStatus Y Reports current order status
Supported values:

  • NEW(0)

  • PARTIALLY FILLED(1)

  • FILLED(2)

  • CANCELED(4)

  • REJECTED(8)

39=2
150 ExecType Y Reports current execution status:
Supported values:

  • NEW(0)

  • TRADE(F)

  • CANCELED(4)

  • REJECTED(8)

  • ORDER STATUS(I)

150=F
6 AvgPx Y Average price of all executed parts(in case of partial fills) 6=0.033959
31 LastPx C Price of last executed part. If order fully filled at once, LastPx will be same as AvgPx 31=0.033951
32 LastQty C Last executed size. 32=0.100
14 CumQty Y Total executed quantity for a given order (sum of all fills) 14=0.200
151 LeavesQty Y Indicates quantity of order still not-executed yet live. 151=0.300
58 Text C May contain optional text information related to order status. E.g. textual explanation
of rejection
58=Account not found.
Tag 1
59 TimeInForce Y Control order lifetime behavior.
Supported Values:

  • Day(0)

  • Good till Cancel(1)

  • Immediate or Cancel(3)

  • Fill Or Kill(4)
59=0
60 TransactionTime
Y Time of the most recent Order's update,timestamp in UTC timezone. 60=20180912-12:05:
15.105
100 ExDestination Y ECN or Venue name where the order was sent/executed 100=OKEX
103 OrdRejReason C If a case of a rejection, this field will help identify the source of error 103=11
167 SecurityType Y Type of security.
Supported values:

  • FOR - Foreign Exchange Contract

  • CRYPTOSPOT - Digital Assets spot market contract

167=CRYPTOSPOT
12 Commission C Commission charged for the last execution or for the entire chain of executions(as a response for OrderMassStatusRequest).

Only orders in status PARTIALLY_FILLED(1) or FILLED(2) have this tag set.
12=0.001
13 CommisionType C Supported values:

  • Absolute (3)


Only orders in status PARTIALLY_FILLED(1) or FILLED(2) have this tag set.
13=3
479 CommissionCurrency C Currency used to charge given commission

Only orders in status PARTIALLY_FILLED(1) or FILLED(2) have this tag set.
479=USD

OrderMassStatusRequest

This message is used when counterparty needs to obtain a list of list(working) orders that match certain criteria. 

A response will be provided through a series of ExecutionReports that contains ExecType=Status and echoed back MassStatusReqId (584) field. 

Tag Field Name Required Comments Example
584 MassStatusReqId Y Unique ID, associated with a given request 584=request_123
585 MassStatusReqType Y Specify the scope of a mass status request.
Supported Values:

  • status of all orders(7)

  • status for orders that belongs to certain PartyID(8). In this case, additional information should be provided using NoPartyIds group

  • status of all orders for trading Login(9)

585=1
1 Account N Optional field, that required when queries for all orders for certain trading Login 1=1001
453 NoPartyIDs C This repeating group should be used to extract orders, associated with particular exchange or exchanges 453=4
447 PartyIDSource Supported values:

  • G - MIC Code

447=G
448 PartyID Exchange name 448=HUOBI
452 PartyRole Supported values:

  • 22 - Exchange

452=22

Request for Positions

This message is used to request a list of positions associated with a given exchange and trading login. This information is available in the form of a snapshot or incremental updates send by the server once the position size changed. 

Type: AN

Tag Field Name Required Comments Example
710 PosReqId Y Unique ID, associated with a given request 710=req_1
742 PosReqType Y Used to narrow the scope of information transmitted.
Supported values:

  • Position(0)

742=0
263 SubscriptionRequestType Y Used to subscribe or unsubscribe from reports.
Supported values:

  • Snapshot(0)

  • Snapshot and Updates(1)

  • Disable previous Snapshot and Updates request(2)

263=1
1 Account Y Trading login for which positions are requested 1=1001
581 AccountType Y Type of account associated with a position request
Supported values:

  • 1 - Account

581=1
715 ClearingBusinessDay Y The Clearing Business Date referred to by this request 715=20191107
453 NoPartyIDs Y 453=1
448 PartyID Y Counterparty name e.g. name of the target exchange HUOBI
447 PartyIDSource Y Supported values:

  • D - Proprietary/Custom Code

  • G - MIC code

447=D
452 PartyRole Y Supported values:

  • 1 - Executing Firm

  • 22 - Exchange

  • 24 - Customer Account

452=22
60 TransactTime Y Time, when this request was initiated 60=20191107-12:05:15.105

Request for Positions Ack

This message will be sent as a confirmation to Request for Positions. It contains basic information such is request status and a number of positions returned with the following snapshot. 

Type: AO

Tag Field Name Required Comments Example
721 PosMaintRptId Y Unique identifier for this position report 721=123456021
710 PosReqId N Request ID, copied from the parent message 710=req_1
727 TotalNumPosReports
N Number of positions returned 727=246
728 PosReqResult Y Indicates the request status.
Supported values:

  • 0 - Valid Request

  • 1 - Invalid or Unsupported request

  • 2 - No positions found

  • 3 - Not authorized to request positions

728=0
729 PosReqStatus Y Status of request for positions.
Supported values:

  • 0 - Completed

  • 2 - Rejected

729=0
453 NoPartyIDs Y 453=2
448 PartyID 448=XTRD
447 PartyIDSource Supported values:

  • D - Proprietary/Custom Code

  • G - MIC code

447=G
452 PartyRole Supported values:

  • 1 - Executing Firm

  • 22 - Exchange

  • 24 - Customer Account

452=1
1 Account Y Trading login for which positions are requested. 1=1001
581 AccountType Y Type of account associated with a position
request
Supported values:

  • 1 - Account

581=1
207 SecurityExchange N Name of the trading venue to get a list of the
positions
207=OKEX
58 Text N Human-readable error message 58=Not authorized to request positions for given
Account

Position Report

Type: AP

Tag Field Name Required Comments Example
721 PosMaintRptID Y Unique identifier for this position report 721=1002312
710 PosReqID N This filed will be set when returning positions snapshot and will be omitted for any
sequential updates
710=req_12
728 PosReqResult Y Always 0(Valid Request) 728=0
715 ClearingBusinessDate Y Always today 715=20191107
453 NoPartyIDs Y 453=2
448 PartyID 448=XTRD
447 PartyIDSource N Supported values:

  • D - Proprietary/Custom Code

  • G - MIC code

447=G
452 PartyRole N Supported values:

  • 1 - Executing Firm

  • 22 - Exchange

  • 24 - Customer Account

1=1001
1 Account Y Client Login ID associated with a current position 1=2342
581 AccountType Y Type of account associated with a position request
Supported values:

  • 1 - Account

581=1
55 Symbol Y Human readable asset name 55=ETH
167 SecurityType Y
207 SecurityExchange Y 207=OKEX
702 NoPositions Y 702=1
703 PosType Supported Values:

  • ETR - Electronic Trade Qty

703=ETR
704 LongQty The platform doesn't support short settling at this moment therefore only LongQty is
available
703=500.
123000