User Tools

Site Tools


fintech:fix_protocol

This is an old revision of the document!


Finances

  • Trade items:
    • Swap ; Rate swap ; Futures ; Treasury bonds ; Curves ; Trade decomposition ; Spread_hedging
    • Derivatives (listed)
    • Cash equities
    • Bonds and gilts : bonds are IOU from giverments wanting to raise money / Gilts (~bonds from UK goverment) are widely viewed as being among the safest type of bond. However the interest rate, or yield, available from Gilts is usually quite low
      • ETF bonds
  • Market-liquidity (cash sometimes identified with it because cash is the most liquid asset)
    • Market_Maker : liquidity provider is a company or an individual that quotes both a buy and a sell price in a tradable asset held in inventory, hoping to make a profit on the bid–ask spread,
  • Clearing_house
  • Derivatives, Futures, Securities, Shares, Bonds.
  • Short_selling: the investor will profit if the value of the asset falls. Aim: borrow assets, sell them, wait for the value to go down and buy them again (cheaper).
  • Trader types:
    • Quant trading
    • Prop trading : when a firm trades with its own money


Types of investment companies:

  • Quantitative_trading (Quantum): Investment technique which looks for patterns and trends among vasts amounts of information.
  • Asset liquidity: Ability of selling an asset on a certain moment without having to lower its price excessively. Persistent occurrences of a phenomenon, correlations among liquid assets (“statistical arbitrage” or “pairs trading”), or price-movement patterns (trend following or mean reversion).
  • Back office (reporting (as400)): Administration and support personnel in a financial services company. They carry out functions like settlements, clearances, record maintenance, regulatory compliance, and accounting. When order processing is slow due to high volume, it is commonly referred to as “back office crunch.”
  • 'Straight Through Processing - STP': While presently only a concept that many are working toward, STP represents a major shift from present-day T+3 trading to same-day settlement.

Read more: Back Office Definition | Investopedia http://www.investopedia.com/terms/b/backoffice.asp#ixzz3rxxmtflS Follow us: Investopedia on Facebook: https://www.facebook.com/Investopedia?_rdr=p


  • Session messages
  • Application messages

Example: GBP-USD
GBP is the 'base' (what we use to buy and sell) and USD is the counter (i.e.: what we are really buying or selling)

- In FX market we have retailers (post office where we go to exchange EUR for GBP) and wholesale. MyCompany is the latter. An example is all the banks taking the small quantities exchanges in their retail market and go to our venue to change it. Much narrow spread than in the retail market (e.g. people buying to them EUR/GBP and then they coming to us to change all those EUR back to GBP )

- Not just the simple case exposed above. For instance, if a big company like BMW wants to buy a factory in USA, it will go to the market to buy USD (EUR/USD). However, the fact that is pumping such a big amount of EUR in USA, makes the EUR weaker. That's why this operation is done is small chunks.

Check this video for an example of how a MyCompany-like platform works. ) - Quotes for a instrument. - Once we buy/sell instrument, we have opened a EUR/USD position. Before buying or selling, we can see the potential gain/losses. - With the bought quantity in point one, we close the position when we sell it back to the market. - Pending order is an order that will be executed if certain market conditions are met.

- Order Book: List of orders used to record the interest of buyers and sellers in a particular financial instrument. A matching engine uses the book to determine which orders can be fulfilled i.e. what trades can be made. Here is a good explanation about how an order book works. - Pulsed Market Data: The Market Data Server sends, by multicast, a whole view of the Order Book every 500ms.


tail -100000 MyCompany-bnpt1oe_04281603010951.R0.summary | tr '\1' ',' | grep -v "35=0"  | grep --color=always "35=h"

Fix specifications:

  1. In sharepoint: Sharepoint-fix
  2. In Internet:fix_wiki
  3. Tags/Types navigator


Instrument: A financial instrument is a tradeable asset of any kind; either cash, evidence of an ownership interest in an entity, or a contractual right to receive or deliver cash or another financial instrument.
FIX: Messages : MD (market data) , Order Entry http://www.onixs.biz/fix-dictionary/4.4/tagNum_150.html Clord …

MARKET MAKING AND ORDER EXECUTION The MyCompany Trading Platform accepts LIMIT, MARKET orders that can be listed in a single message

Customer) ----- ORDER (replace, new, cancel) ----->  (Book)
                                                                                      |                                                                                   
              <------ ACK Green_Room ----------------------    |
                                                                                       |  
              <------ ACK Book ---------------------------------    _| (Green room delay)


First delay: Time it takes to get to the OE –> ME ; Second delay: Artificially introduced by the ME (green room)

 ExecutionReport (~ACK) will be sent for each fill (order), cancel or replace


Msg type

  • (Msg type) 35=A ←- Logon , (HeartBtInt)108=4 ←- 4 secs of hb. (5 max) Tag 35 is called Msg Type
  • (Msg type) 35=5 Logout
  • (Msg type) 35=0 Heartbeat If the heartbeat interval (1 second) elapses and no application message has been received, a Heartbeat message must be sent. Test Request (35=1) if nothing is received on that interval. “Are you still there?”. It's going together with a 112={id} which is the challenge id. The reply to that challenge needs to be the same id.
  • (Msg type)35=3 Reject←- Message invalid in structure SessionRejectReason(373)=0 ←- Invalid tag number
  • (Msg type)35=2 Messages Resend Link for explanation
  • (Msg type)35=8 ←- Execution Report ; (ExecType)150=A ←- Pending new ; (OrdStatus)39=A ←- Pending New
  • (Msg type)35=9 Order Cancel Reject
  • (Msg type)35=D ←- NewOrderSingle
  • (Msg type)35=F ←- Order Cancel Request
  • (Msg type)35=q ←-q OrderMassCancelRequest (Inbound(to cancel the orders matching criteria specified within the request))
  • (Msg type)35=r OrderMassCancelReport (Outbound)
  • (Msg type)35= j Throttle (To reject an application-level message which fulfils session-level rules and cannot be rejected via any other means)

To see if an order that has been OrderCancelRequest (35=F) was already in the market, don't rely on the ClOrdID(11) but on the OrigClOrdID(41) (Required specifically in response to cancel or replace order requests)..: The client should chain client order IDs on an ‘optimistic’ basis, ie. set the OrigClOrdID (tag 41) to the last non-rejected ClOrdID (tag 11) sent…

35=8 (ExecReport) > 150= (ExecType) > 39= (OrdStatus)
Execution Report - ExecType (150) (i.e. 35=8 ; 150= ) - Check pg 29 Specifies purpose of this report. Values are:

  • 0 = New
  • 4 = Cancelled
  • 5 = Replaced
  • 6 = Pending Cancel
  • 8 = Rejected
  • A = Pending New
  • C = Expired
  • D = Restated
  • E = Pending Replace
  • F = Trade
  • I = Order Status

39 OrdStatus: Identifies current status of order. {0 new ; 1 Partially-filled; 2 Filled; 4 cancelled ; 8 rejected ..)
Other fields
9 : BodyLength 11 : ClOrderID. (ClOrdID) (See also 37, 41) Client assigned ID uniquely identifying the order. This ID must be unique during the day session and can be re-used next business day. 17 ExecID : Must be unique for each Execution Report message PB.PC–EB 31: Price at which the order is filled (response to tag 44)

  • 34: MsgSeqNum: 35=2 (resend request,venue→customer if message with higher than expected MsgSeqNum)
  • 35 : MsgType-0 =Heartbeat ; 1=Test Request (if no heartbeat rec in interval) ; 8= Execution Report ; F = Order Cancel Request ; 9 =Order Cancel Reject ; A = Logon ; D= New Order Single ; E= New Order List ; G= OrderCancelReplaceRequest ( to change any valid attribute of an open order (i.e. reduce/increase quantity, change limit price, change instructions, etc.))
  • 37 OrderID : (See also 11, 41) OrderID is required to be unique for each chain of orders.MyCompany Trading Platform assigned ID; q= mass cancel)
  • 38 OrderQuantity
  • 39 OrdStatus: Identifies current status of order. {0 new ; 4 cancelled ; 8 rejected ..)
  • 40 OrdType : It can be 1 (Market) 2 (Limit)
  • 41 OrigClOrdID: (See also 11, 37) The client should chain client order IDs on an ‘optimistic’ basis, ie. set the OrigClOrdID (tag 41) to the last non-rejected ClOrdID (tag 11) sent.
  • 44 Price of the order Price per unit of quantity (e.g. per share) . Is replied by tag 31
  • 49 SenderCompID ; 56 TargetCompID
  • 52 SendingTime (Time stamp)
  • 55 Symbol (ISO 4217)
  • 59 (3 IOC)
  • 60 TransactTime Time this order request was initiated by the client
  • 64 Settlement date
  • 103 OrdRejReason (see types plus 'Unknown Order' , 'Throttle')
  • 108 HeartBtInt
  • 109 ClientID Used for firm identification in third-party transactions (should not be a substitute for OnBehalfOfCompID/DeliverToCompID).
  • 150 ExecType Describes the type of execution report. Same possible values as OrdStatus.

TRADE AMOUNT: 38 OrderQty ; 44 Price of the order 6 AvgPx ; 14 CumQty ; 381 GrossTradeAmt (Total amount of trade: GrossTradeAmt = CumQty * AvgPx
IDENTITY (SenderCompID)49 —→ (TargetCompID)56 …
compId in our case can be used to discriminate MM (e.g.: BARCOE3_PFX) from non MM (without that) Username(553) ; Password(554)


REJECTS:

From MyCompany to customer 35=8 ; OrdRejReason(103)=6 ←- Duplicate Order (note that this is also an execution report)
From the customer to MyCompany : malformed . {CheckSum(10)←- this is part of the message trailer}

Aggressive vs Passive executions: (Source)
An aggressive execution results from an order executing against an order that already resides on the order book. Entry of any order type can result in an aggressive execution except for Indicative and Firm Exposure orders.
An aggressive order chases the price. Hit against the first level of the book to achieve a trade immediately
A passive order wait for the price to come to it. Set to a new price, creating a new level in the order book, waiting for other participants to hit it.


NEW ORDER SINGLE

  • 11 ClOrdID - Mandatory
  • 109 ClientID - Identification in 3rd party transaction
  • 76 ExecBroker


MARKET DATA (This data includes not only price tiers but also trades)
Returns one or more Market Data messages containing one or more Market Data Entries. Each Market Data Entry is a Bid, an Offer, a Trade.

  • Reuters RMDS (inc. RTIC, P2PS, DACS, DTS)
  • RIC (Reuters Instrument Code) is a ticker-like code used by Thomson Reuters to identify financial instruments. Do not confuse with symbol. RIC/ticker is an abbreviation used to uniquely identify PUBLICLY TRADED SHARES of a particular stock on a particular stock market.
  • Reed sample: “Ask for a “RTCE report (feed report for (past) feeds, troubleshooting)
  • Data Access Control System (DACS))
  • Reuters DTS user name.
  • P2P

Requests (MsgType=V)

  • Is a combination of two parameters, the SubscriptionRequestType and MDUpdateType
  • SubscriptionRequestType (263) = 0 (Snapshot) or 1 (Snap+Updates)
  • MDUpdateType (265) = 0 (Full Book) or 1 (Top of the Book)

Reply:

  • MsgType (35) = W Snapshot/Full Refresh ←- This sends the whole book (more load for the network but easier to implement in the ends)
  • MsgType (35) = V Market Data – Incremental Refresh ←- This sends what has changed in the book (better for the network but requires more work (stronger algos) on the ends)

Scenarios:

  • Request Initial Reply Subsequent replies
  • 263=0 ; 263=0 W Null
  • 263=1 ; 263=0 W W
  • 263=1 ; 263=1 W X

(35=2)Messages Resend

  • Resend Request: If higher than expected MsgSeqNum (Tag 34) Resent messages will not be added to the market.There will be no acknowledgement of the resent messages.
  • Resend Request: If lower than expected MsgSeqNum. The Client will be logged off. After client must reset the sequence number and note it
  • In order to fix it, the sender must issue a Message SequenceReset (35=4)
  • TimeInForce of Good Till Date and Good Till Cancel

Any changes between two pulses are sent in the next pulse
Book and updates are per instrument
Example of subscription : AggregatedBook(266) = True, SubscriptionRequestType(263) = snapshot+updates, MDUpdateType(265) = full refresh, see my subscription message below


PRICE REJECTS (What to do if):

  1. Ask for Reuters feed sample: “Ask for a “RTCE report” to Datasupport. They'd need also the DACS user name (which is the Reuters DTS user name. Data Access Control System (DACS))”
  2. Analyse it besides APIs' logs and possible network issues.
  1. → TSP2K8CTX04 trading.operations – MyCompany Spot generator server

* DTS(DACS)==⇒ feed RICS –> TSP2K8CTX04 trading.operations – spreadsheet run by Trading ops

  1. → TSPFD01 trading.operations – mycompany3 spot generator server

ERROR COLLAR:
The system needs a mid-point.If there is not enough liquidity (not busy) or the book is half sided an order may reach and see no match.
That's why the external error collar is used


Corvil Notes
https://sites.google.com/site/techknw/home/nms

fintech/fix_protocol.1698935895.txt.gz · Last modified: by 127.0.0.1