Fix Api: Developers Guide
Fix Api: Developers Guide
Developers guide
HEARTBEAT ................................................................................................................................................... 7
TEST REQUEST ............................................................................................................................................... 7
RESET REQUEST ............................................................................................................................................. 7
REJECT (SESSION) ........................................................................................................................................... 8
SEQUENCE RESET ........................................................................................................................................... 8
LOGON ......................................................................................................................................................... 9
LOGOUT ...................................................................................................................................................... 10
2
FIX API
DOCUMENT HISTORY
DATE AUTHOR CHANGES
25.02.2013 Alexandr Kachur Tag 400, Instrument Type added to Security Definition.
3
FIX API
STANDARD HEADER
Tag Field Name Required Comments
8 BeginString Y FIX.4.4
9 BodyLength Y
35 MsgType Y
4
FIX API
34 MsgSeqNum Y
52 SendingTime Y
5
FIX API
STANDARD TRAILER
Tag Field Name Required Comments
10 CheckSum Y
Please refer to the FIX documentation available at for checksum calculation algorithm
specifications.
6
FIX API
HEARTBEAT
Heartbeat messages can be initiated by either the client or the server.
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.
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.
7
FIX API
7 BeginSeqNo Y
16 EndSeqNo Y
Standard Trailer Y
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.
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.
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.
9
FIX API
1 – Quote stream
20008 ConnectionMode N 2 – Trade stream
3 – Quote & Trade stream
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
58 Text N
1 – Quote stream
20008 ConnectionMode Y 2 – Trade stream
3 – Quote & Trade stream
Standard Trailer Y
11
FIX API
48 SecurityID N Instrument Id
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
4 (returning a list)
323 SecurityResponseType Y 5 (rejecting a request)
6 (could not match selection)
13
FIX API
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;
Standard Trailer Y
14
FIX API
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.
MaturityMonth
200 N Format YYYYMM – only for Derivatives.
Year
Security
207 Y Protrader route name
Exchange
Standard Trailer
Y
15
FIX API
0 – (new)
279 MDUpdateAction Y 1 – (change)
2 – (delete)
16
FIX API
Standard Trailer Y
17
FIX API
18
FIX API
Standard Trailer Y
NEWS MESSAGES
The News Messages using for send news to client.
42 OrigTime N
146 NoRelatedSym N
58 Text N
19
FIX API
6940 NewsSource N String containing the news source for the News Message
Standard Trailer Y
20
FIX API
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.
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)
21
FIX API
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.
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.
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.
23
FIX API
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.
24
FIX API
48 SecurityID N Optional.
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.
ExecRestatementReas
378 N Supplied for ExecType = D (Restated).
on
26
FIX API
27
FIX API
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.
790 OrdStatusReqID Y
790 OrdStatusReqID N
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|
29
FIX API
Standard Trailer Y
75 TradeDate Y
TransactTi
60 Y Time the trade was created
me
Standard Trailer Y
30
FIX API
SettlCurrA
119 Y LastPx*LastQty
mt
Secondary
198 N Counter Order ID
OrderID
31
FIX API
Standard Trailer Y
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.
32
FIX API
Standard Trailer Y
7006 UserGroupID Y
33
FIX API
7016 CommisionId Y
Standard Trailer Y
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
20011 PropertyName Y
20012 PropertyValue Y
Standard Trailer Y
35
FIX API
PFSOFT
Email: support@protrader.com
Website: www.protrader.com
36