Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
262 views

Fix Api: Developers Guide

This document provides information about FIX API messages for the Protrader 3 Client Portal, including: 1) Details on standard FIX message headers and trailers that are expected and sent. 2) Descriptions of session level messages like Logon, Logout, Heartbeat that manage the connection. 3) Pre-trade application messages like Security Definition, Market Data Requests that provide reference data. 4) Trading application messages like New Order Single, Order Cancel/Replace, Execution Report that handle orders. 5) Other application messages like Account Status, Route Status, Properties that provide account information.

Uploaded by

Alex Curtois
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
262 views

Fix Api: Developers Guide

This document provides information about FIX API messages for the Protrader 3 Client Portal, including: 1) Details on standard FIX message headers and trailers that are expected and sent. 2) Descriptions of session level messages like Logon, Logout, Heartbeat that manage the connection. 3) Pre-trade application messages like Security Definition, Market Data Requests that provide reference data. 4) Trading application messages like New Order Single, Order Cancel/Replace, Execution Report that handle orders. 5) Other application messages like Account Status, Route Status, Properties that provide account information.

Uploaded by

Alex Curtois
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 36

FIX API

Developers guide

August 09, 2016

Protrader 3 Client Portal


https://cp.protrader.com
FIX API

DOCUMENT HISTORY ...................................................................................................................... 3

ABOUT FIX MESSAGES ..................................................................................................................... 4

FIX 4.4 MESSAGE REFERENCE ......................................................................................................................... 4


ABOUT THE MESSAGE STRUCTURE .................................................................................................................. 4
STANDARD HEADER ....................................................................................................................................... 4
STANDARD TRAILER ........................................................................................................................................ 6

SESSION LEVEL MESSAGES .............................................................................................................. 7

HEARTBEAT ................................................................................................................................................... 7
TEST REQUEST ............................................................................................................................................... 7
RESET REQUEST ............................................................................................................................................. 7
REJECT (SESSION) ........................................................................................................................................... 8
SEQUENCE RESET ........................................................................................................................................... 8
LOGON ......................................................................................................................................................... 9
LOGOUT ...................................................................................................................................................... 10

APPLICATION LEVEL MESSAGES – PRE TRADE ............................................................................. 12

SECURITY DEFINITION REQUEST .................................................................................................................... 12


SECURITY DEFINITION................................................................................................................................... 12
MARKET DATA REQUEST............................................................................................................................... 14
MARKET DATA INCREMENTAL REFRESH .......................................................................................................... 15
MARKET DATA SNAPSHOT/FULL REFRESH ................................................................................................. 18
NEWS MESSAGES ......................................................................................................................................... 19

APPLICATION MESSAGES FOR TRADING...................................................................................... 20

NEW ORDER SINGLE .................................................................................................................................... 20


Open and Close Indicator........................................................................................................................... 22
SL/TP orders ................................................................................................................................................. 22
ORDER CANCEL / REPLACE ........................................................................................................................... 22
ORDER CANCEL ........................................................................................................................................... 24
EXECUTION REPORT ..................................................................................................................................... 25
ORDER STATUS REQUEST.............................................................................................................................. 28
ORDER CANCEL REJECT ................................................................................................................................ 29
TRADE CAPTURE REPORT REQUEST ................................................................................................................. 30
TRADE CAPTURE REPORT ............................................................................................................................... 30

APPLICATION LEVEL MESSAGES – OTHER .................................................................................... 32

ROUTE STATUS REQUEST .............................................................................................................................. 32


ROUTE STATUS ............................................................................................................................................ 32
ACCOUNT STATUS MESSAGES ....................................................................................................................... 33
REQUEST FOR POSITIONS.............................................................................................................................. 34
PROPERTIES MESSAGE .................................................................................................................................. 35

2
FIX API

DOCUMENT HISTORY
DATE AUTHOR CHANGES

30.03.2013 Alexey Il’in Tag 11, Resend Request.

25.02.2013 Alexandr Kachur Tag 400, Instrument Type added to Security Definition.

14.03.2013 Yuriy Lebedev Market Data SNAPSHOT/FULL Refresh.

29.11.2013 Alexandr Mahnitskiy 35=H, 35=AN, changes on page 25-26.

06.01.2015 Alexandr Mahnitskiy 35=G, Edited comment tag 207.

18.03.2016 Alexey Il’in Corrections in the required values.

Adjustment of required parameters. Changes in Account


28.03.2016 Irina Tatradymova
Status Messages
Removed XML message; added new values for New Order
Single (tags 59 and 40); adjusted description for Logon, Logout,
29.03.2016 Alexandr Mahnitskiy
Properies Message, About The Message Structure, Security
Definition Request; reorginized document structure.

09.08.2016 Alexandr Mahnitskiy Edit comments for 35=G message

3
FIX API

ABOUT FIX MESSAGES


FIX 4.4 Message Reference
This section lists the messages in detail and provides information on our use of these FIX 4.4
messages. Tags marked “Not supported” are not used by our server, but may be required to conform to
FIX protocol.
All field values must conform to FIX protocol definitions. For example, order quantity must be a
float; a date must not contain alphabetical characters. Specifying invalid field values may cause
unexpected behavior. The documentation at www.fixprotocol.org provides information on field data
types.

ABOUT THE MESSAGE STRUCTURE


The Protrader FIX Trading Server expects and sends standard headers and trailers on each
message. Our QuickFIX engine will reject messages not containing correct headers and trailers.
Unsupported tags should not be specified but in general, if they are present, will be ignored. All fields
should be specified in the order that the fields are specified in the message definition within the current
document (for repeating data groups this rule is a must)

STANDARD HEADER
Tag Field Name Required Comments

8 BeginString Y FIX.4.4

9 BodyLength Y

35 MsgType Y

49 SenderCompID Y Clients should use Protrader user login

By default clients should use PFSPRICE for price


56 TargetCompID Y
connection and PFSORDER for trade connection.

115 OnBehalfOfCompID N Not supported

128 DeliverToCompID N Not supported

90 SecureDataLen N Not supported

91 SecureData N Not supported

4
FIX API

Tag Field Name Required Comments

34 MsgSeqNum Y

50 SenderSubID N Not supported

142 SenderLocationID N Not supported

57 TargetSubID N Not supported

143 TargetLocationID N Not supported

116 OnBehalfOfSubID N Not supported

144 OnBehalfOfLocationID N Not supported

129 DeliverToSubID N Not supported

145 DeliverToLocationID N Not supported

Send when message may be duplicate of another


97 PossResend N message sent under a different sequence
number. (As example for Execution report)

52 SendingTime Y

Required if message was resent as a result of a


122 OrigSendingTime N
ResendRequest. Can set to SendingTime.

212 XmlDataLen N Only for xml messages

213 XmlData N Only for xml messages

347 MessageEncoding N Not supported

369 LastMsgSeqNumProcessed N Not supported

370 OnBehalfOfSendingTime N Not supported

5
FIX API

STANDARD TRAILER
Tag Field Name Required Comments

93 SignatureLength N Not supported.

89 Signature N Not supported.

10 CheckSum Y

Please refer to the FIX documentation available at for checksum calculation algorithm
specifications.

6
FIX API

SESSION LEVEL MESSAGES


The following messages are session level messages and are processed by our server using the
QuickFIX engine. Some of these messages can be generated as well as accepted by our server, and some
messages are expected to be received only.

HEARTBEAT
Heartbeat messages can be initiated by either the client or the server.

Tag Field Name Required Comments

Standard Header Y MsgType = 0

Set by the server when responding to a Test Request


112 TestReqID Y message.
Data type: string

Standard Trailer Y

TEST REQUEST
Test Request messages may be initiated by the client or the server. The server may initiate this
message under the control of the QuickFIX engine if it believes there is a problem with the socket.
Upon receipt of this message, the server will respond with a Heartbeat message.

Tag Field Name Required Comments

Standard Header Y MsgType = 1

Will be returned in tag 112 of Heartbeat


112 TestReqID Y
Data type: string

Standard Trailer Y

RESET REQUEST
Either the client or the server, in response to a detected gap in the message sequences, can
initiate a Reset Request message. It requests a resend of the messages from BeginSeqNo through to and
including EndSeqNo.

Tag Field Name Required Comments

Standard Header Y MsgType = 2

7
FIX API

Tag Field Name Required Comments

7 BeginSeqNo Y

16 EndSeqNo Y

Standard Trailer Y

A Reset Request will be responded to by retransmitting the requested messages, or by transmitting


a Sequence Reset (Gap Fill) to skip some of those messages.

REJECT (SESSION)
A message reject is issued when an incoming message fails session level validation. Either the
client or the server can produce this message, although the client is very unlikely to do so, as all fix
messages produced by the server are supposed to be FIX compliant.
When this type of message is produced by the server, the error will have been detected by the
QuickFIX engine and suitable text will be found in tag 58. The field in error is found in tag 371 and the
sequence number of the message in error is found in tag 45.

Tag Field Name Required Comments

Standard Header Y MsgType = 3

45 RefSeqNum Y MsgSeqNum of rejected message

371 RefTagID Y The tag failing validation

372 RefMsgType Y MsgType of the message in error

373 SessionRejectReason Y Refer to FIX documentation

58 Text Y Message to explain the error

Standard Trailer Y

SEQUENCE RESET
The client may generate a Sequence Reset message when responding to a Reset Request in order
to skip messages. Please read the information on the importance of proper sequence number reset co-
ordination and sequence number processing in section This is a recommended mechanism to ensure

8
FIX API

that stale orders are not re-transmitted in the event that the connection has been down for an extended
period.
This message is not produced by the server, when the server responds to Reset Requests all
requested messages are re-sent.

Tag Field Name Required Comments

Standard Header Y MsgType = 4

123 GapFillFlag N Normally present and set to “Y”

36 NewSeqNo Y Must only increase expected SeqNo

Standard Trailer Y

The GapResetFlag (tag 123) should normally be present and set to “Y” in order to skip the
messages. This is called a Sequence Reset (Gap Fill) and the server will set the next expected sequence
number to the value of NewSeqNo (tag 36), thus skipping intervening messages. It is important to note
that the sequence number of this message should be the sequence number of the first message to be
skipped.

LOGON
FIX logon authentication requires a valid Protrader user SenderID name and a password. The
user must have rights for logon as “FIX client”.
Logon can be rejected for a number of reasons:
• the login name or password are invalid
• the user is already logged in the system in a different FIX session or via other means
• Logon request message sequence number is smaller than the last received FIX message
(MsgSeqNum too low) – manual intervention on the client side is required to correct the sequence
numbers and/or reset them via ResetSeqNumFlag field.
• You have connected to wrong Cluster Node – it’s required to recconect to another node (required IP
adress and port you can find in Logout message).

A Logout message is sent in all these cases with the Text(58) field containing the error description.

Tag Field Name Required Comments

Standard Header Y MsgType = A

98 EncryptMethod Y Ignored, use 0.

9
FIX API

Tag Field Name Required Comments

Heartbeat interval used by both sides. Default


108 HeartBtInt Y
60.

Indicates both sides of a FIX session should


141 ResetSeqNumFlag N
reset sequence numbers

554 Password Y Protrader user password

NodeID N ID of the cluster node


20009

20005 NoClusterNodes N Total number of nodes in cluster

20009 NodeID N Id of the cluster node

1 – Quote stream
20008 ConnectionMode N 2 – Trade stream
3 – Quote & Trade stream

20007 NodeLoad N Load of t the cluster node

These data group provides information how


20001 NoServerURLs N
you can connect to cluster node

20002 NodeHost N IP or URL of the node

20003 NodePort N port number

20004 NodeProtocol N FIX API = 2

Standard Trailer Y

Notes: Cluster should be understood as a group of servers with different roles (trade node, quote
node, etc.) connected to the same DataBase . Based on environment configuration, in some cases users
need to establish Quote and Trade session with different nodes. Connection details to each node should
be provided by a broker, but in general, user can find out connection details of all required nodes by
himself using 20005 data group.

LOGOUT
This message is created by the client application when it wishes to disconnect a session.

10
FIX API

Tag Field Name Required Comments

Standard Header Y MsgType = 5

58 Text N

20005 NoClusterNodes N Total number of nodes in cluster

20009 NodeID Y Id of the cluster node

1 – Quote stream
20008 ConnectionMode Y 2 – Trade stream
3 – Quote & Trade stream

20007 NodeLoad Y Load of t the cluster node

These data group provides information how


20001 NoServerURLs N
you can connect to cluster node

20002 NodeHost Y IP or URL of the node

20003 NodePort Y port number

20004 NodeProtocol Y FIX API = 2

Standard Trailer Y

11
FIX API

APPLICATION LEVEL MESSAGES – PRE TRADE


SECURITY DEFINITION REQUEST
The server will only process a security definition request with a SecurityRequestType of 3
(Request List of Securities). The server will respond with a Security Definition message. Other types of
Security Definition Request are rejected by the server by setting the Security Response Type to 5 on the
returned message.

Tag Field Name Required Comments

Standard Header Y MsgType = c (lowercase)

320 SecurityReqID Y Unique identifier for this request

321 SecurityRequestType Y Ignored, use 3

55 Symbol N Instrument name

48 SecurityID N Instrument Id

22 IDSource N Not supported.

167 SecurityType N Protrader instrument type name

Standard Trailer Y

Most of the fields are unsupported due to the fact that on the Protrader FIX Trading Server, use
of this message is limited to requesting a list of all available securities. It is not possible to use this
message to request that a particular security be traded on the Protrader servers.

SECURITY DEFINITION
The Security Definition is send by the server on client logon or in response to a Security Definition
Request to list the available securities on the gateway. This does not list all securities defined on the
Protrader servers – only the securities that your logon has received permission to access. If a Security
Definition Request is being rejected (e.g. not type 3) then the returned message will contain no securities.

12
FIX API

Tag Field Name Required Comments

Standard Header Y MsgType = d (lowercase)

320 SecurityReqID Y As supplied in Request.

322 SecurityResponseID Y A time based unique identifier.

4 (returning a list)
323 SecurityResponseType Y 5 (rejecting a request)
6 (could not match selection)

55 Symbol Y Instrument name

48 SecurityID Y Protrader instruement ID.

107 SecurityDesc N Protrader instrument description

167 SecurityType N Protrader instrument type (i.e. instrument group)

200 MaturityMonthYear N Not supported.

205 MaturityDay N Not supported.

201 PutOrCall N Not supported.

202 StrikePrice N Not supported.

15 Currency Y Instrument primary currency

58 Text Y Instrument description

454 NoUnderlyings N Number of repeating groups for available routes

Cross type for convert instrument primary currency


into system currency:
7020 CrossInstrumentType N 0- simple, i.e. without cross instrument; 1- cross type
price;2 – cross type simple reverse; 3 – cross type
reverse price

7021 CrossInstrumentId N Cross instrument id for account

13
FIX API

Tag Field Name Required Comments

7022 CurrencyMinChange N Accuracy of instrument.

16461 LotSize N LotSize

16470 LotSizeOption N Reserved for options.

16552 ExchTickSize N Tick size

ExchPointValue
16554 N Point (pips) size

FOREX = 1;
EQUITIES = 2;
FUTURES = 3;
OPTIONS = 4;
EQUITIES_CFD = 5;
460 InstrumentType Y FORWARD = 6;
FUTURES_CFD = 7;
INDICIES = 8;
CRYPTO CURRENCY = 10;
SPREADBET = 11;
GENERAL = 0;

336 TradingSessionID Y Protrader session ID

Standard Trailer Y

MARKET DATA REQUEST


The Market Data Request is submitted by the client application in order to request price data
from the server. Both snapshots and incremental refreshes are supported. Market depth is supported
to 20 levels although for most exchanges only 10 levels will be provided. Some exchanges limit this to 5
levels.
The server will respond to a Market Data Request with a Market Data Incremental Refresh message
as requested, or a Market Data Reject message.

Tag Field Name Required Comments

Standard Header Y MsgType = V

262 MDReqID Y Unique ID, or the ID of the request to disable.

14
FIX API

Tag Field Name Required Comments

SubscriptionRequest 1 – subscribe
263 Y
Type 2 – unsubscribe

1 – Level I
0 – Full cup
264 MarketDepth Y
*For full market depth server does not send
MDEntryPositionNo, only MDEntryID.

Not supported. Snapshot/Full and Market Data


265 MDUpdateType N
Incremental Refresh.

266 AggregatedBook N Ignored.

267 NoMDEntryTypes Y Number of MDEntryType fields requested.

If not set sibscibe for bids, offers and trades.


Supported values:
269 MDEntryType Y BID = '0';
OFFER = '1';
TRADE = '2';

146 NoRelatedSym Y Number of securities requested.

55 Symbol Y Protrader instrument name

167 SecurityType N Protrader instrument type. Not required.

MaturityMonth
200 N Format YYYYMM – only for Derivatives.
Year

205 MaturityDay N Use for Options.

201 PutOrCall N Use for Options.

202 StrikePrice N Use for Options.

Security
207 Y Protrader route name
Exchange

Standard Trailer
Y

MARKET DATA INCREMENTAL REFRESH


A Market Data Incremental Refresh is returned by the server when the Market Data Request has
requested an incremental refresh. Multiple market data entries can be notified in the same message.

15
FIX API

Tag Field Name Required Comments

Standard Header Y MsgType = X

262 MDReqID Y Request this is responding to

268 NoMDEntries Y Number of entries following.

0 – (new)
279 MDUpdateAction Y 1 – (change)
2 – (delete)

269 MDEntryType Y Entry type for new entries.

Identifies the market depth entry (MMID)


278 MDEntryID Y
Unique id in market depth cap.

280 MDEntryRefID N Not supported.

55 Symbol Y Protrader instrument name

48 SecurityID Y Protrader instrument ID.

460 Product N Protrader type

167 SecurityType N Protrader instrument type.

200 MaturityMonthYear N Format YYYYMM – only for derivatives.

205 MaturityDay N Use for Options.

201 PutOrCall N Use for Options.

202 StrikePrice N Use for Options.

207 SecurityExchange Y Protrader route name

270 MDEntryPx N Price for this entry.

16
FIX API

Tag Field Name Required Comments

271 MDEntrySize N Volume for this price.

272 MDEntryDate N Date price received.

273 MDEntryTime N Time price received.

275 MDMkt Y Route name

290 MDEntryPositionNo N Not supported. Position for this entry in depth

Standard Trailer Y

17
FIX API

MARKET DATA SNAPSHOT/FULL REFRESH


A Market Data Snapshot/Full Refresh is returned by the server when the Market Data Request
has requested a Snapshot/Full refresh.

Tag Field Name Required Comments

Standard Header Y MsgType = W

262 MDReqID Y Request this is responding to

Indicates whether an Option is for put or call


Valid values:
201 PutOrCall N
0 – Put
1 – Call

200 MaturityMonthYear N Format YYYYMM – only for derivatives

Use only for derivatives


205 MaturityDay N
Values: 1-31

55 Symbol Y Protrader instrument name

167 SecurityType Y Protrader instrument type

48 SecurityID Y Protrader instrument ID

207 SecurityExchange Y Protrader route name

460 Product Y Protrader product type

268 NoMDEntries Y Number of entries following.

269 MDEntryType Y Entry type for new entries.

Identifies the market depth entry (MMID) Unique id in


278 MDEntryID N
market depth cap.

275 MDMkt N Source of quote

270 MDEntryPx Y Price for this entry

271 MDEntrySize Y Volume for this price

18
FIX API

Tag Field Name Required Comments

275 MDMkt Y Route name

299 QuoteEntryID Y Protrader Entry level ID

290 MDEntryPositionNo Y Position for this entry in depth

Standard Trailer Y

NEWS MESSAGES
The News Messages using for send news to client.

Tag Field Name Required Comments

Standard Header Y MsgType = B (uppercase)

33 NoLinesOfText Y Number of lines text

42 OrigTime N

61 Urgency N News priority. Values from 0 (high) to 9 (low)

148 Headline Y HeadLine of news.

146 NoRelatedSym N

55 Symbol N Related symbol (if specified).

22 IDSource N PT route name (if specified).

LinesOfText N Count of lines in message text.

58 Text N

149 URLLink N URL link.

6515 NewsID Y The unique identifier of a news message.

19
FIX API

Tag Field Name Required Comments

6940 NewsSource N String containing the news source for the News Message

6518 NewsType N Textual description of the news category.

Standard Trailer Y

APPLICATION MESSAGES FOR TRADING


NEW ORDER SINGLE
This message is used to submit a new order to the Protrader servers. Give-up and order routing
can be done on the Protrader servers by having the administrator set up users and accounts to do so.
The PT server will respond with either an Execution Report or a Reject (Session) message. A Reject
message is only issued if the message fails session level validation, such as invalid tag values. If an order
fails business validation, an Execution Report will be issued with an appropriate status and error text.

Tag Field Name Required Comments

Standard Header Y MsgType = D

Client identifier of the order (Should be only integer


11 ClOrdID N
numbers).
Optional.Used for closing position or adding SL/TP. If
73 NoOrders N specified, must be the value of Protrader Order ID
supplied by the server in the execution report.

37 OrderID N Protrader OrderID

1 Account Y The Protrader trader account

21 HandlInst Y Set to 1, otherwise will cause reject

55 Symbol Y Protrader instrument name

167 SecurityType N Protrader instrument type name

200 MaturityMonthYear N Reserved. Required for Options: format CCYYMM

20
FIX API

Tag Field Name Required Comments

205 MaturityDay N Reserved. Required for Options.

201 PutOrCall N Reserved. Required for Options

202 StrikePrice N Reserved. Required for Options

207 SecurityExchange Y Protrader route name

54 Side Y Only 1 (buy) or 2 (sell) supported

60 TransactTime Y Time of this order

38 OrderQty N Required: number of lots

Varies by exchange.
Types supported by Protrader server:
1 – market;
40 OrdType Y
2 – limit;
3 – stop;
4 – stop limit.
Order price for limit and market orders. For market
44 Price N
orders price is indicative and not required.

99 StopPx N Order price for stop orders.

15 Currency N Not supported. Always in primary currency.

117 QuoteID N Reserved.

Varies by exchange.
Absence of this field indicates Day order.
Types supported by Protrader server:
0 = Day
59 TimeInForce N
1 = Good Till Cancel (GTC)
3 = Immediate or Cancel (IOC)
4 = Fill or Kill (FOK)
6 = Good Till Date (GTD)

432 ExpireDate N Reserved GTD orders

58 Text N User comment for order.

21
FIX API

Tag Field Name Required Comments

ClOrdLinkID Protrader OrderID. Can’t be used together with 73 and 37


583 N
rag for close orders.

77 OpenClose N C for close orders (to add SL/TP or to close position)

18205 slPrice N Price for “Stop loss” order

18206 tpPrice N Price for “Take profit” order

Standard Trailer Y

Note, that if you have specifing SL/TP price, then system create independent Stop/Limit order that
is bound to main order. You can work with this orders (cancel, modify), like with normal Stop/Limit
Orders.

OPEN AND CLOSE INDICATOR


The OpenClose field is used in for trades to indicate whether the trade is opening or closing (close
position, add SL/TP to position or Order.
For close order OrderID tag must be the value Protrader Order ID. For mutual close must be sent
NoOrders of OrderID of all orders for mutual close.

Example Position Closing:


8=FIX.4.4|9=172|35=D|34=18|49=alexm1|56=PFSORDER|52=20131202-
12:30:39.640|38=1000|40=1|11=11|21=1|55=EUR/USD|54=1|60=20131202-
12:30:39.639|59=0|1=alexm1|207=LMAX|44=2|73=1|37=8415707|77=C|10=180|

Example Open Position:


8=FIX.4.4|9=145|35=D|34=5|49=alexm1|56=PFSORDER|52=20131202-
12:34:38.926|38=1000|40=1|11=13|21=1|55=EUR/USD|54=1|60=20131202-
12:34:38.926|59=0|1=alexm1|207=LMAX|10=214|

SL/TP ORDERS
If you need to set SL/TP orders, use Limit/Strop order (40=2 or 40=3) and NoOrders tag 73 with
OrderID field 37 and ClOrdLinkID field 583 and Posiiton Effect 77=C for bounded order/position.

Example Adding TP for position:


8=FIX.4.4|9=177|35=D|34=2|49=alexm1|56=PFSORDER|52=20131202-
12:33:53.927|38=1000|40=2|11=12|21=1|55=EUR/USD|54=1|60=20131202-
12:33:53.926|59=0|1=alexm1|207=LMAX|44=1.50000|73=1|37=8415673|77=C|10=17
3|

ORDER CANCEL / REPLACE


The Order Cancel/Replace is sent by the client application to amend an order that has a working
status. It may not be used to re-open an order by increasing the volume of a completed order. Part-filled

22
FIX API

orders may be amended, but not fully filled orders. Attempts to do so will result in a Cancel Reject with
“no such order”.
If an Order Cancel/Replace is accepted by the business rules but rejected downstream (for
example, if the exchange connection is disabled) the system will deliver an Execution Report for the
pending state followed by a Cancel Reject.

Tag Field Name Required Comments

Standard Header Y MsgType = G

37 OrderID Y Protrader Order ID

Unique identifier of replacement order (will be used in


11 ClOrdID Y the Cancel Reject message if the replacement request
is rejected).
Protrader user account field is required. But it is not
1 Account Y validating, since you can’t change the account for
order.

21 HandlInst Y Set to 1, otherwise will cause reject

55 Symbol Y Must match original order

167 SecurityType N Optional: match original order if supplied

200 MaturityMonthYear N Optional: match original order if supplied

205 MaturityDay N Optional: match original order if supplied

201 PutOrCall N Optional: match original order if supplied

202 StrikePrice N Optional: match original order if supplied

Optional. If specified, then field is not validating,


207 SecurityExchange N because you can’t change SecurityExchange for
already exist order.

54 Side Y Must match original order.

Time this order request was initiated/released by the


60 TransactTime Y
trader or trading system.

38 OrderQty N Must match original order.

23
FIX API

Tag Field Name Required Comments

152 CashOrderQty N Not supported.

40 OrdType Y Must match original order.

44 Price N Optional: may specify new price

99 StopPx N Optional: may specify new stop price

Optional. Supported only by specific Liqudity


59 TimeInForce N Providers. If tag is not specified, then system will use
Day as default.

41 OrigClOrdID N Protrader Order ID, used in case of order modification

168 EffectiveTime N Not supported.

432 ExpireDate N Optional: match original order if supplied

77 OpenClose N Optional: Must match original order.

527 SecondaryExecID N ID of open position

Standard Trailer Y

ORDER CANCEL
The Order Cancel is sent by the client application to cancel all the remaining volume of a working
order. To reduce the volume of an order, you should use Order Cancel/Replace.

Tag Field Name Required Comments

Standard Header Y MsgType = F

41 OrigClOrdID N Not supported. ClOrdID of the order to cancel.

37 OrderID Y ClOrdID of the order to cancel.

Unique identifier of cancel request (will be used in the


11 ClOrdID Y Cancel Reject message if the replacement request is
rejected).

24
FIX API

Tag Field Name Required Comments

1 Account Y Required: Protrader user account.

55 Symbol Y Must match original order.

48 SecurityID N Optional.

167 SecurityType N Ignored.

200 MaturityMonthYear N Ignored.

205 MaturityDay N Ignored.

201 PutOrCall N Ignored.

202 StrikePrice N Ignored.

207 SecurityExchange N Ignored.

54 Side Y Must match original order

Time this order request was initiated/released by the


60 TransactTime Y
trader or trading system.

38 OrderQty N Ignored.

Standard Trailer Y

Notes: The OrderID field is requred and the Cancel will be not processed without this field present.
This value is a Protrader Order ID.

EXECUTION REPORT
The execution report message is sent by the server to your application for the following reasons:
• Confirm receipt of a new order
• Confirm changes or cancels to an existing order
• Supply unsolicited order state changes
• Relay fill information
• Actual orders state (on login) or as response for Order Status request.
• Reject new orders

25
FIX API

The OrdStatus and ExecType fields are important for determining the sequence of events that took
place. Some of these scenarios are discussed in further detail below.

Tag Field Name Required Comments

Standard Header Y MsgType = 8 PossResend=Y for

37 OrderID Y Protrader order identifier

198 SecondaryOrderID N Not supported.

As set by your application.


Tag 11 you are receiving only with first message 150=A
11 ClOrdID N
(pending new).
For further work should be used server orderid (tag 37).
Previous ClOrderID when responding to Cancel or
41 OrigClOrdID N
Cancel/Replace messages.

17 ExecID N Optional: fill identifier

19 ExecRefID N Not supported.

150 ExecType Y Not all states are supported.

39 OrdStatus Y Not all states are supported.

103 OrdRejReason N Not supported.

ExecRestatementReas
378 N Supplied for ExecType = D (Restated).
on

1 Account N Protrader user account

55 Symbol Y Protrader instrument name

48 SecurityID N Protrader instrument ID

167 SecurityType N Protrader instrument type name.

200 MaturityMonthYear N For Options: format CCYYMM

205 MaturityDay N For Options.

26
FIX API

Tag Field Name Required Comments

201 PutOrCall N For Options.

202 StrikePrice N For Options.

207 SecurityExchange N Optional: Protrader route name

54 Side Y 1 (buy) or 2 (sell) only

38 OrderQty N Order volume

40 OrdType N As stated on the order

44 Price N As stated on the order

99 StopPx N As status on the order

59 TimeInForce N As stated on the order

432 ExpireDate N As stated on the order

32 LastQty N Volume of this fill, zero for reversal

60 TransactTime N Date of order execution

PositionEffect Used to identify if this is an open order 77=O or close


77 N
order 77=C (SL/TP or close position).

64 SettlDate N Date of settlment

31 LastPx N Price of this fill, zero for reversal

151 LeavesQty Y Volume still working

14 CumQty Y Volume filled so far

6 AvgPx N Decimal average price (accuracy limited)

27
FIX API

Tag Field Name Required Comments

21 HandlInst N Not returned (is set to 1 on order)

77 OpenClose N Indicate open or close

58 Text N Contains rejection reason text

527 SecondaryExecID N ID of open position

Standard Trailer Y

ExecType I = Order Status used in execution report messages that were sent for update
position/order status or as response on Order Status request.

ORDER STATUS REQUEST


The order status request can be used to get list of opened positions or active orders.
Note, that during startup (after Logon) the system sent the list of active orders automatically.

Tag Field Name Required Comments

Standard Header Y MsgType=H

790 OrdStatusReqID Y

55 Symbol N Protrader Instrument Name

54 Side N 1- buy, 2 - sell

37 OrderId N Protrader OrderID

790 OrdStatusReqID N

20000 IntField Y 1 - state of opened orders, 2 - state of opened positions

1 Account N Protrader account name

Standard Trailer Y

28
FIX API

Example:
Requesting open position for all visible instruments and accounts:
8=FIX.4.4|9=72|35=H|34=5|49=alexm1|56=PFSORDER|52=20131202-
12:44:33.715|790=44|20000=2|10=063|

Reply:
8=FIX.4.4|9=256|35=8|49=PFSORDER|56=alexm1|34=37|52=20131202-
12:43:00.442|97=Y|1=alexm1|6=1.34839|14=100000|17=3550817|37=8400135|38=100000|3
9=2|40=1|48=5|54=1|55=EUR/USD|59=1|60=20131105-
08:59:00.985|64=18991215|77=O|150=I|151=0|167=Spot|207=GFT|460=1|527=8400135|790
=44|10=049|

ORDER CANCEL REJECT


The Order Cancel Reject is delivered by the server when a Cancel or Cancel/Replace is not accepted
by the Protrader server. If the server accepted the Cancel or Cancel/Replace but the trading system
rejected it, then this message is preceded by an Execution Report for the pending status.

Tag Field Name Required Comments

Standard Header Y MsgType = 9

37 OrderID Y Protrader order-id.

198 SecondaryOrderID N Not supported.

11 ClOrdID Y As set in the Cancel or Cancel/Replace

41 OrigClOrdID Y ClOrdID which could not be cancelled.

39 OrdStatus Y Current order status.

1 Account N Protrader user account

60 TransactTime N Not supported.

434 CxlRejResponseTo Y Either 1 (Cancel) or 2 (Cancel/Replace)

0 – too late to cancel


1 – unknown order
102 CxlRejReason N
2 – rejected by trading system
3 – already in pending state

58 Text N Text description of rejection

29
FIX API

Tag Field Name Required Comments

354 EncodedTextLen N Not supported.

355 EncodedText N Not supported.

Standard Trailer Y

TRADE CAPTURE REPORT REQUEST


Tag Field Name Required Comments

Standard Header Y MsgType = AD

568 TradeRequestID Y Unique request id

569 TradeRequestType Y Must be 0

37 OrderID N Protrader order id

55 Symbol N Instrument Name

207 SecurityExchange N Protrader route name

Must be 2. Range of dates (between NoDate1 and


580 NoDate N
NoDate2)

75 TradeDate Y

TransactTi
60 Y Time the trade was created
me

Standard Trailer Y

TRADE CAPTURE REPORT


Tag Field Name Required Comments

Standard Header Y MsgType = AE

30
FIX API

Tag Field Name Required Comments

568 TradeReportID Y Unique report id

569 TradeRequestID C If have requested?

Indicates that this is the


last report which will be
returned as a result of
912 LastRptRequested N
the request.
N – not last
Y – last

55 Symbol Y Instrument Name

207 SecurityExchange Y Protrader route name

570 PreviouslyReported N Not supported.

32 LastQty Y Trade Quantity

31 LastPx Y Trade Price

75 TradeDate Y Not supported

60 TransactTime Y Time the trade was created

552 NoSides Y Number of sides

64 SettlDate Y date of trade settlement

54 Side Y 1 (buy) or 2 (sell)

37 OrderID Y Unique order id

1 Account Y Account name

SettlCurrA
119 Y LastPx*LastQty
mt

Secondary
198 N Counter Order ID
OrderID

31
FIX API

Tag Field Name Required Comments

Standard Trailer Y

APPLICATION LEVEL MESSAGES – OTHER


ROUTE STATUS REQUEST
Request status information for Protrader routes.

Tag Field Name Required Comments

Standard Header Y MsgType = UAR (uppercase)

18200 GatewayStatusReqId Y ID for this route status request.

SubscriptionRequestType
263 N Not supported.

Standard Trailer Y

ROUTE STATUS
The Route Status message is sending on client logon or returned by the server in response to a
Route Status Request.

Tag Field Name Required Comments

Standard Header Y MsgType = UAT (uppercase)

ID of the node, where this route was


20009 NodeID Y
started

18200 GatewayStatusReqId N ID for this route status request.

Number of status messages contained


18201 NoGatewayStatus Y
in this repeating group.
Current status of the route. Possible
values include:
18202 GatewayStatus Y • 1: Halted
• 2: Open
• 3: Closed

32
FIX API

Tag Field Name Required Comments

Generally to user will be send only


Route Status message with
GatewayStatus=2.

207 SecurityExchange Y Protrader route name.

Info route (only for trade mode). If


group with SubExchangeGateway=1
20015 QuoteSecurityExchange Y
isn’t set, subscription should be with
using this security Exchange

18203 ExchangeGateway Y Route name

Type of PT route. Valid values include:


18204 SubExchangeGateway Y • 1: Price
• 2: Order (i.e. trade)

58 Text N Additional information about the route.

Standard Trailer Y

ACCOUNT STATUS MESSAGES


The AccountStatus Messages using for send account info to client. It sent by server on client logon
and when account info are changed.

Tag Field Name Required Comments

Standard Header Y MsgType = UAA (uppercase)

1 Account Y Account name

7001 AccountId Y Protrader Account id

7002 UserID Y Protrader user id

553 Username Y Protrader user name

Client terminal type


7004 ClientType Y 2 - .net; 3 - pocketPC; 4 - html; 0 - undefined ; 8 - FIX
client

7006 UserGroupID Y

33
FIX API

Tag Field Name Required Comments

7008 UserStatus Y 0 – offline, 1 – online, 2 – account removed

7010 Balance Y Account balance.

7011 BlockedSum Y The unique identifier of a news message.

7016 CommisionId Y

15 Currency N Account currency

Cross type for convert account currency into system


currency:
7020 CrossInstrumentType N 0- simple, i.e. without cross instrument; 1- cross type
price;2 – cross type simple reverse; 3 – cross type
reverse price

Standard Trailer Y

REQUEST FOR POSITIONS


Requir
Tag Field Name Comments
ed

Standard Header Y MsgType = AN

Unique identifier for the Request for Positions as


710 PosReqID Y assigned by the submitter

724 PosReqType Y 0 = Positions only

55 Symbol N if not define - for all visible instruments

1 Account Y Protrader account name

715 ClearingBusinessDate Y

Standard Trailer Y

Example:
8=FIX.4.4|9=132|35=AN|34=10|49=alexm1|56=PFSORDER|52=20131202-

34
FIX API

13:06:49.468|60=20131202-13:06:49.467|710=11|1=alexm1|724=0|715=20131202-
13:06:49.467|10=031|

PROPERTIES MESSAGE
The properties message is sending on client logon.

Generally sever will provide only property message with name “finishblocktransfer” and value
“true” which means that all opened orders has been already send after Logon.

Requi
Tag Field Name Comments
red

Standard Header Y MsgType = UAO

20011 PropertyName Y

20012 PropertyValue Y

Standard Trailer Y

35
FIX API

PFSOFT

Email: support@protrader.com
Website: www.protrader.com

36

You might also like