2016年10月3日 星期一

CME MDP 3.0 Market Data Decoding Development



CME MDP 3.0 Market Data

http://www.cmegroup.com/confluence/display/EPICSANDBOX/CME+MDP+3.0+Market+Data

CME Market Data Platform has 3 formats: 1. MDP 3.0, 2. Stramlined Market Data, 3. ITC.
MDP replaces FAST.


Reference

Here is a lengthy detail documentation but too long to be read.
FIX Simple Binary Encoding Release Candidate 2 PDF
http://www.smallake.kr/wp-content/uploads/2014/11/Simple-Binary-Encoding-Release-Candidate-2.pdf


Martin Thompson written a good description of MDP
http://mechanical-sympathy.blogspot.hk/2014/05/simple-binary-encoding.html

Stephen Edwards teches CSEE 4840 Embedded System Design 2014 in Columbia University.
One of the student group project MDP-tickerplant contains a few files talking about MDP.
http://www.cs.columbia.edu/~sedwards/classes/2014/4840/index.html
http://www.cs.columbia.edu/~sedwards/classes/2014/4840/proposals/MDP-tickerplant.pdf
http://www.cs.columbia.edu/~sedwards/classes/2014/4840/reports/MDP-tickerplant.pdf
http://www.cs.columbia.edu/~sedwards/classes/2014/4840/reports/MDP-tickerplant-presentation.pdf


Onixs has a CME MDP 3.0 Market Data Handler that provides an API for 30 days evaluation.
http://www.onixs.biz/cme-mdp-3-0-market-data-handler.html
Onixs software release history can be found here. Active development is from 2010 to 2014.
http://onixsnews.blogspot.hk/


epam has a website called B2BITS that provides a B2BITS CME MDP Handler. It provides the low latency options of OpenOnload OS Kernal bypass technology of using Solarflare 10GbE Server Adapters, and DBL OS kernel bypass technology of using Myri-10G Network Adapters.
http://www.b2bits.com/trading_solutions/market-data-solutions/cme-mdp3.html

epam has put some codes on web
https://github.com/epam/java-cme-mdp3-handler
https://libraries.io/github/epam/java-cme-mdp3-handler


JETTEK has an CME Adapter as Java API.
http://jettekfix.com/node/13


github real-logic is a Java program that will translate the XML-based data dictionary into Java, C++, and C# bindings.
https://github.com/real-logic/simple-binary-encoding

github tfgm has a sbedecoder project which is a Python based decoder and capable to decode MDP3.
https://github.com/tfgm/sbedecoder

Good FIX protocol dictionary
http://www.onixs.biz/fix-dictionary/4.2/tagNum_35.html

History

Previous Test

<connection id="316SA">
  <type feed-type="S">Snapshot</type>
  <protocol>UDP/IP</protocol>
  <ip>224.0.31.28</ip>
  <host-ip>205.209.222.78</host-ip>
  <host-ip>205.209.222.88</host-ip>
  <port>14316</port>
  <feed>A</feed>
</connection>

Config

CME MDP 3.0 - FTP Site Information, locate the production configuration config.xml file at ftp://ftp.cmegroup.com/SBEFix/Production/Configuration/config.xml

In confic.xml, find <channel id="360" label="COMEX Globex Futures">
<channel id="360" label="COMEX Globex Futures">
  <products>
    <product code="GC">
      <group code="GC" />
    </product>
  </products>
  <connections>
    <connection id="360IA">
      <type feed-type="I">Incremental</type>
      <protocol>UDP/IP</protocol>
      <ip>224.0.31.192</ip>
      <host-ip>205.209.221.79</host-ip>
      <host-ip>205.209.223.79</host-ip>
      <port>14360</port>
      <feed>A</feed>
    </connection>
    <connection id="360IB">
      <type feed-type="I">Incremental</type>
      <protocol>UDP/IP</protocol>
      <ip>224.0.32.192</ip>
      <host-ip>205.209.211.79</host-ip>
      <host-ip>205.209.212.79</host-ip>
      <port>15360</port>
      <feed>B</feed>
    </connection>
    <connection id="360SA">
      <type feed-type="S">Snapshot</type>
      <protocol>UDP/IP</protocol>
      <ip>224.0.31.202</ip>
      <host-ip>205.209.222.78</host-ip>
      <host-ip>205.209.222.88</host-ip>
      <port>14360</port>
      <feed>A</feed>
    </connection>
    <connection id="360SB">
      <type feed-type="S">Snapshot</type>
      <protocol>UDP/IP</protocol>
      <ip>224.0.32.202</ip>
      <host-ip>205.209.213.53</host-ip>
      <host-ip>205.209.214.53</host-ip>
      <port>15360</port>
      <feed>B</feed>
    </connection>
  </connections>
</channel>




If we use Snapshot only, we subscribe to 224.0.31.202:14360 for group A.
sudo socat STDIO UDP4-RECV:14360,ip-add-membership=224.0.31.202:em1
sudo tcpdump -w out.pcap -i em1

wireshark gui filter is "ip.dst_host == 224.0.31.202 && udp.port == 14360"
libpcap filter is "udp && dst host 224.0.31.202 && port 14360"


If we use both Snapshot and Incremental, need to subscribe to 2 groups
224.0.31.192 and 224.0.31.202, both 14360 and 15360
sudo socat STDIO UDP4-RECV:14360,ip-add-membership=224.0.31.192:em1,ip-add-membership=224.0.31.202:em1


A general simple realtime tcpdump command:
sudo tcpdump -i em1 -nn 'port 14360 or port 15360'


sudo tcpdump -w snapshotincremental10mins.pcap -i em1 -G 600 -W 1


sudo tcpreplay --intf1=p2p1 snapshotincremental10mins.pcap --loop=1


The CME MDP documentation contains the following sections.
CME Market Data Platform
CME MDP 3.0 Market Data
MDP 3.0 - Simple Binary Encoding
MDP 3.0 - Dissemination
MDP 3.0 - Market Data Messaging
MDP 3.0 - Trade Summary
MDP 3.0 - Book Management
MDP 3.0 - Statistics
MDP 3.0 - Recovery
MDP 3.0 Message Specification

Template

ftp://ftp.cmegroup.com/SBEFix/Production/Templates/templates_FixBinary.xml


Used Config

MDP Main

Channel '311': I feed A is started
Channel '311': I feed B is started
Channel '311': S feed A is started


<connection id="311IA">
  <type feed-type="I">Incremental</type>
  <protocol>UDP/IP</protocol>
  <ip>224.0.31.2</ip>
  <host-ip>205.209.221.70</host-ip>
  <host-ip>205.209.223.70</host-ip>
  <port>14311</port>
  <feed>A</feed>
</connection>
<connection id="311IB">
  <type feed-type="I">Incremental</type>
  <protocol>UDP/IP</protocol>
  <ip>224.0.32.2</ip>
  <host-ip>205.209.211.70</host-ip>
  <host-ip>205.209.212.70</host-ip>
  <port>15311</port>
  <feed>B</feed>
</connection>
<connection id="311SA">
  <type feed-type="S">Snapshot</type>
  <protocol>UDP/IP</protocol>
  <ip>224.0.31.23</ip>
  <host-ip>205.209.222.80</host-ip>
  <host-ip>205.209.222.84</host-ip>
  <port>14311</port>
  <feed>A</feed>

</connection>

MDP PrintAllSecurities

Channel '311': N feed A is started


<connection id="311NA">
  <type feed-type="N">Instrument Replay</type>
  <protocol>UDP/IP</protocol>
  <ip>224.0.31.44</ip>
  <host-ip>205.209.222.76</host-ip>
  <host-ip>205.209.222.82</host-ip>
  <port>14311</port>
  <feed>A</feed>

</connection>



Market Data Services

  • Schema Dissemination - method for client system to receive all active CME Group templates
  • Market Data Configuration - allows client systems to receive list of all market data channel configurations
  • Security Definition Flat File - contains all Security Definition (tag 35-MsgType=d) messages for CME Globex instruments (This file TradingSessionList.dat can be viewed by fixviewer.com or even better fixdecoder.com)
  • Market Schedule File - contains all Security Groups with state changes scheduled for each Trading Date of the current week.

In TradingSessionList.dat [here], search for GOLD FUTURES.

TagRaw ValueTag NameValue
35
BJ
MsgType
BJ - TradingSessionList
1300
76
MarketSegmentID
76
1227
GOLD FUTURES
ProductComplex
GOLD FUTURES
1151
GC
SecurityGroup
GC
580
5
NoDates
5
75
20161017
TradeDate
20161017
386
3
NoTradingSessions
3
336
21
TradingSessionID
21
341
20161016210000000000
TradSesStartTime
20161016210000000000
625
30
TradingSessionSubID
30
336
17
TradingSessionID
17
341
20161016220000000000
TradSesStartTime
20161016220000000000
336
4
TradingSessionID
4 - Afternoon
341
20161017210000000000
TradSesStartTime
20161017210000000000
75
20161018
TradeDate
20161018
386
3
NoTradingSessions
3
336
21
TradingSessionID
21
341
20161017214500000000
TradSesStartTime
20161017214500000000

In secdef.dat file [here], search for "55=GCZ6"

TagRaw ValueTag NameValue
35
d
MsgType
d - SecurityDefinition
5799
00000000
(Unknown)
00000000
980
A
SecurityUpdateAction
A - Add
779
20161016160924000312
LastUpdateTime
20161016160924000312
1180
360
ApplID
360
1300
76
MarketSegmentID
76
462
17
UnderlyingProduct
17
207
XCEC
SecurityExchange
XCEC
1151
GC
SecurityGroup
GC
6937
GC
(Unknown)
GC
55
GCZ6
Symbol
GCZ6
48
140396
SecurityID
140396
22
8
SecurityIDSource
8 - ExchangeSymbol
167
FUT
SecurityType
FUT - Future
461
FXXXSX
CFICode
FXXXSX
200
201612
MaturityMonthYear
201612
15
USD
Currency
USD
1142
F
MatchAlgorithm
F
562
1
MinTradeVol
1
1140
1499
MaxTradeVol
1499
969
1.0000000
MinPriceIncrement
1.0000000
9787
0.1000000
(Unknown)
0.1000000
996
TRYOZ
UnitOfMeasure
TRYOZ
1147
100.0000000
UnitOfMeasureQty
100.0000000
1150
12629.0000000
TradingReferencePrice
12629.0000000
731
00000011
SettlPriceType
00000011
5796
20161018
(Unknown)
20161018
1149
13629.0000000
HighLimitPrice
13629.0000000
1148
11629.0000000
LowLimitPrice
11629.0000000
1143
120.0000000
MaxPriceVariation
120.0000000
1146
10.0000000
MinPriceIncrementAmount
10.0000000
9779
N
(Unknown)
N
864
2
NoEvents
2
865
5
EventType
5 - Activation
1145
20101229223000000000
EventTime
20101229223000000000
865
7
EventType
7 - LastEligibleTradeDate
1145
20161228183000000000
EventTime
20161228183000000000
1141
2
NoMDFeedTypes
2
1022
GBX
MDFeedType
GBX
264
10
MarketDepth
10
1022
GBI
MDFeedType
GBI
264
2
MarketDepth
2
870
1
NoInstrAttrib
1
871
24
InstrAttribType
24 - TradeTypeEligibilityDetailsForSecurity
872
00000000000011000010000000000001
InstrAttribValue
00000000000011000010000000000001
1234
0
NoLotTypeRules
0
5791
111891
(Unknown)
111891
5792
367818
(Unknown)
367818


It is about the template xml format explanation.
https://github.com/FIXTradingCommunity/fix-simple-binary-encoding/blob/master/v1-0-RC3/doc/01Introduction.md


How to setup the Main code?
In 360SA.pcap, there are 8 instances of securityId 140396 out of the 1000 packets.
If main enableAllSecuritiesMode() + startSnapshotFeedA(), the controller will be newed after the first instance and can handle the rest 7 instances. Otherwise simply not subscribe(140396, "TEST_GC") to handle all 8 instances.


For Silver

35=d 5799=00000000 980=A 779=20161218171026000386 1180=360 1300=76 462=17 207=XCEC 1151=SI 6937=SI 55=SIF8 48=6263 22=8 167=FUT 461=FXXXSX 200=201801 15=USD 1142=F 562=1 1140=999 969=5.0000000 9787=0.0010000 996=TRYOZ 1147=5000.0000000 1150=16354.0000000 731=00000011 5796=20161219 1149=19350.0000000 1148=13355.0000000 1143=450.0000000 1146=5.0000000 9779=N 864=2 865=5 1145=20160226223000000000 865=7 1145=20180129182500000000 1141=2 1022=GBX 264=10 1022=GBI 264=2 870=1 871=24 872=00000000000011000010000000000001 1234=0 5792=13
TagRaw ValueTag NameValue
35
d
MsgType
d - SecurityDefinition
5799
00000000
(Unknown)
00000000
980
A
SecurityUpdateAction
A - Add
779
20161218171026000386
LastUpdateTime
20161218171026000386
1180
360
ApplID
360
1300
76
MarketSegmentID
76
462
17
UnderlyingProduct
17
207
XCEC
SecurityExchange
XCEC
1151
SI
SecurityGroup
SI
6937
SI
(Unknown)
SI
55
SIF8
Symbol
SIF8
48
6263
SecurityID
6263
22
8
SecurityIDSource
8 - ExchangeSymbol
167
FUT
SecurityType
FUT - Future
461
FXXXSX
CFICode
FXXXSX
200
201801
MaturityMonthYear
201801
15
USD
Currency
USD
1142
F
MatchAlgorithm
F
562
1
MinTradeVol
1
1140
999
MaxTradeVol
999
969
5.0000000
MinPriceIncrement
5.0000000
9787
0.0010000
(Unknown)
0.0010000
996
TRYOZ
UnitOfMeasure
TRYOZ
1147
5000.0000000
UnitOfMeasureQty
5000.0000000
1150
16354.0000000
TradingReferencePrice
16354.0000000
731
00000011
SettlPriceType
00000011
5796
20161219
(Unknown)
20161219
1149
19350.0000000
HighLimitPrice
19350.0000000
1148
13355.0000000
LowLimitPrice
13355.0000000
1143
450.0000000
MaxPriceVariation
450.0000000
1146
5.0000000
MinPriceIncrementAmount
5.0000000
9779
N
(Unknown)
N
864
2
NoEvents
2
865
5
EventType
5 - Activation
1145
20160226223000000000
EventTime
20160226223000000000
865
7
EventType
7 - LastEligibleTradeDate
1145
20180129182500000000
EventTime
20180129182500000000
1141
2
NoMDFeedTypes
2
1022
GBX
MDFeedType
GBX
264
10
MarketDepth
10
1022
GBI
MDFeedType
GBI
264
2
MarketDepth
2
870
1
NoInstrAttrib
1
871
24
InstrAttribType
24 - TradeTypeEligibilityDetailsForSecurity
872
00000000000011000010000000000001
InstrAttribValue
00000000000011000010000000000001
1234
0
NoLotTypeRules
0
5792
13
(Unknown)
13

For Copper:
55=HGZ7

35=d 5799=00000000 980=A 779=20170226170630000129 1180=360 1300=76 462=17 207=XCEC 1151=HG 6937=HG 55=HGZ7 48=183050 22=8 167=FUT 461=FXXXSX 200=201712 15=USD 1142=F 562=1 1140=999 969=5.0000000 9787=0.0001000 996=LBS 1147=25000.0000000 1150=27280.0000000 731=00000011 5796=20170224 1149=31280.0000000 1148=23280.0000000 1143=600.0000000 1146=12.5000000 9779=N 864=2 865=5 1145=20121228223000000000 865=7 1145=20171227180000000000 1141=2 1022=GBX 264=10 1022=GBI 264=2 870=1 871=24 872=00000000000011000010000000000001 1234=0 5791=3088 5792=21456

35
d
MsgType
d - SecurityDefinition
5799
00000000
(Unknown)
00000000
980
A
SecurityUpdateAction
A - Add
779
20170226170630000129
LastUpdateTime
20170226170630000129
1180
360
ApplID
360
1300
76
MarketSegmentID
76
462
17
UnderlyingProduct
17
207
XCEC
SecurityExchange
XCEC
1151
HG
SecurityGroup
HG
6937
HG
(Unknown)
HG
55
HGZ7
Symbol
HGZ7
48
183050
SecurityID
183050
22
8
SecurityIDSource
8 - ExchangeSymbol
167
FUT
SecurityType
FUT - Future
461
FXXXSX
CFICode
FXXXSX
200
201712
MaturityMonthYear
201712
15
USD
Currency
USD
1142
F
MatchAlgorithm
F
562
1
MinTradeVol
1
1140
999
MaxTradeVol
999
969
5.0000000
MinPriceIncrement
5.0000000
9787
0.0001000
(Unknown)
0.0001000
996
LBS
UnitOfMeasure
LBS
1147
25000.0000000
UnitOfMeasureQty
25000.0000000
1150
27280.0000000
TradingReferencePrice
27280.0000000
731
00000011
SettlPriceType
00000011
5796
20170224
(Unknown)
20170224
1149
31280.0000000
HighLimitPrice
31280.0000000
1148
23280.0000000
LowLimitPrice
23280.0000000
1143
600.0000000
MaxPriceVariation
600.0000000
1146
12.5000000
MinPriceIncrementAmount
12.5000000
9779
N
(Unknown)
N
864
2
NoEvents
2
865
5
EventType
5 - Activation
1145
20121228223000000000
EventTime
20121228223000000000
865
7
EventType
7 - LastEligibleTradeDate
1145
20171227180000000000
EventTime
20171227180000000000
1141
2
NoMDFeedTypes
2
1022
GBX
MDFeedType
GBX
264
10
MarketDepth
10
1022
GBI
MDFeedType
GBI
264
2
MarketDepth
2
870
1
NoInstrAttrib
1
871
24
InstrAttribType
24 - TradeTypeEligibilityDetailsForSecurity
872
00000000000011000010000000000001
InstrAttribValue
00000000000011000010000000000001
1234
0
NoLotTypeRules
0
5791
3088
(Unknown)
3088
5792
21456
(Unknown)
21456


End of file

沒有留言:

張貼留言

2023 Promox on Morefine N6000 16GB 512GB

2023 Promox on Morefine N6000 16GB 512GB Software Etcher 100MB (not but can be rufus-4.3.exe 1.4MB) Proxmox VE 7.4 ISO Installer (1st ISO re...