Table of Contents |
---|
...
CMESample.Port = 9026
CMESample.SenderCompId = TSTCIDN // the last symbol of SenderCompID should be N as hot failover is not supported
CMESample.SenderSubId = TST
CMESample.SenderLocationId = RUUS // this parameter specifies location of client and can be set arbitrarily
CMESample.Password = password123
Obtain these parameters from CME.
The properties below control market segments on CME to connect:
CMESample.MarketSegments = 99,74
CMESample.MarketSegment.99.PrimaryHost = 69.50.112.199
CMESample.MarketSegment.99.BackupHost = 69.50.112.205
CMESample.MarketSegment.74.PrimaryHost = 127.0.0.1
CMESample.MarketSegment.74.BackupHost = 69.50.112.182
IP adresses of market data segments are published by CME. For more details see http://www.cmegroup.com/confluence/display/EPICSANDBOX/New+iLink+Architecture#NewiLinkArchitecture-SFTP-MSGWConfiguration
In the sample above two market segments are configured, but there is no restriction on number of them - feel free to add all market data segments.
CMESample.ProcessMessagesOutOfOrder = true
This parameter controls how application level messages should deliver to app code. Actually CME requires that application-level messages that are received out of order are taking into account by client application. For more info see http://www.cmegroup.com/confluence/display/EPICSANDBOX/Session+Layer+-+Resend+Request
If this parameter is set to true then it is garantee that messages are delivered in right order (sequence numbers are incerementing one-by one)
If it is set to false then application - level message are delivered as soon as FIXAntenna receives them from CME.
For more details see MessageDispatcher class implementation in MessageDispatcher.cpp
Run
Before running the sample make sure you have a valid license file and it is placed to the folder specified in "samples/CMEClient/bin/engine.properties" LicenseFile parameter (default value is ./../../../engine.license, that is the root folder where you unzipped the package).
Without a valid license file FIX Engine will fail to start and you won't be able to run the sample.
Run run.bat or run.sh files depending on your platform to run the sample.
...
[INFO] 20151215-16:14:28.226 [6700] [CME Initiator] - -----------------------------------------------------------------------------------------------
[INFO] 20151215-16:14:28.226 [6700] [CME Initiator] - Parsed parameters (Market Segments with empty Id, Primary or Backup Hosts were skipped):
[INFO] 20151215-16:14:28.242 [6700] [CME Initiator] - -----------------------------------------------------------------------------------------------
[INFO] 20151215-16:14:28.242 [6700] [CME Initiator] - Port: 9026
[INFO] 20151215-16:14:28.242 [6700] [CME Initiator] - SenderCompId: TSTCIDN
[INFO] 20151215-16:14:28.257 [6700] [CME Initiator] - SenderSubId: TST
[INFO] 20151215-16:14:28.257 [6700] [CME Initiator] - SenderLocationId: RUUS
[INFO] 20151215-16:14:28.257 [6700] [CME Initiator] - Password: password123
[INFO] 20151215-16:14:28.257 [6700] [CME Initiator] - ApplicationSystemName: FIXAntenna
[INFO] 20151215-16:14:28.257 [6700] [CME Initiator] - TradingSystemVersion: 2.16.0
[INFO] 20151215-16:14:28.273 [6700] [CME Initiator] - ApplicationSystemVendor: B2BITS
[INFO] 20151215-16:14:28.273 [6700] [CME Initiator] - Handle out of order messages as soon as they come
[INFO] 20151215-16:14:28.273 [6700] [CME Initiator] - Assume connecting to DropCopy interface
[INFO] 20151215-16:14:28.273 [6700] [CME Initiator] - Market Segments:
[INFO] 20151215-16:14:28.288 [6700] [CME Initiator] - Id: 74
[INFO] 20151215-16:14:28.288 [6700] [CME Initiator] - Primary Host: 69.50.112.197
[INFO] 20151215-16:14:28.288 [6700] [CME Initiator] - Backup Host: 69.50.112.182
[INFO] 20151215-16:14:28.288 [6700] [CME Initiator] - Id: 99
[INFO] 20151215-16:14:28.288 [6700] [CME Initiator] - Primary Host: 69.50.112.199
[INFO] 20151215-16:14:28.304 [6700] [CME Initiator] - Backup Host: 69.50.112.205
[INFO] 20151215-16:14:28.304 [6700] [CME Initiator] - -----------------------------------------------------------------------------------------------
...
Some important tips on developing an application for CME with FIX Antenna C++
FIX Session creation
It is quite important to
- specify deliverAppMessagesOutOfOrder = true in order to enable enhanced resend request scenario
- specify resendRequestBlockSize = 2500 in order meet CME limitation of 2500 msg per single resend request
- specify targetSubID as a market segment id
- create FIX Session object using Engine::SessionId that accepts the session qualifier parameter - in order to have an ability to create more than one FIX Session with the same SenderCompID and TargetCompID pair
See the code snippet below for more details:
Engine::SessionExtraParameters ssnParams;
...
Engine::FixEngine::singleton()->createSession(app, Engine::SessionId(params.senderCompID_, "CME", sessionQualifier), Engine::FIX42, ssnParams);
For the complete code sample please see the
SessionCollection::createSession( const std::string &marketSegmentId, Engine::Application* app, const Params& params)
method.
Logon to CME
In each cases of logon to CME it is required to use "custom logon" in order to specify required by CME tags:
- 1603 - ApplicationSystemName
- 1604 - TradingSystemVersion
- 1605 - ApplicationSystemVendor
- 95 - RawDataLength (used for password length)
- 96 - RawData (used for password)
For more details see
std::auto_ptr<Engine::FIXMessage> createLogonMessage(const Params& params, SessionPtr session)
...
8=FIX.4.2 9=475 35=n 49=CME 56=TSTCIDN 34=4 50=G 57=PAA 143=RU US 52=20151110-12:57:23.715 122=20151007-16:09:32.854 212=356 213=<RTRF>8=FIX.4.2 9=320 35=8 34=4291 369=4267 52=20151007-16:09:32.854 49=CME 50=G 56=G86000N 57=DUMMY 143=US,IL 1=00521 6=0 11=ACP1444234172815 14=0 17=99218:12219 20=0 37=9913161431 38=1 39=0 40=2 41=0 44=9980.5 48=998902 54=1 55=90 59=0 60=20151007-16:09:32.852 107=2EJZ4 150=0 151=1 167=FUT 432=20151007 1028=Y 1091=N 9717=ACP1444234172815 10=235 </RTRF> 369=995 10=175
...