Page tree
Skip to end of metadata
Go to start of metadata

Preface

B2BITS' FIX ICE Trade Capture Solution is a server application pre-configured to work with the ICE Trade Capture FIX interfaceICE Trade Capture Solution design is based on B2BITS' generic server FIXEdge extended with the ICE handler. It inherits and leverages all FIXEdge features including easy configuration, administration, and monitoring. 

Workflow Overview

1.1 Supported FIX Messages

ICE Trade Capture data is captured by FIXEdge via FIX 4.4 session. The ICE Trade Capture Solution supports the following FIX messages: 

  • From ICE Trade Capture Solution to ICE:
    • Security Definition Request (MsgType = ''c");
    • Trade Capture Report Request (MsgType = ''AD").
  • From ICE to ICE Trade Capture Solution:
    • Security Definition (MsgType = ''d")
      new and old message formats are supported (new format is enabled by default);
    • Defined Strategy (MsgType = ''UDS");
    • Trade Capture Report Request Ack (MsgType = ''AQ");
    • Trade Capture Report (MsgType = ''AE");
    • News (MsgType = "B").

2.1 ICE Trade Capture Solution - SecDefFirst Mode Workflow Diagram

SecDefFirst Mode Workflow diagram step-by-step description

Main flow

  1. ICE Trade Capture Solution starts and establishes FIX Session to ICE Trade Capture using details from FIXEdge.properties file.
  2. Once the session is established  ICE Trade Capture Solution is doing the following in a loop for each security definition subscription stated in ICEProperties.properties
    1. generates Security Definition Request (MsgType = 'c'), filling the values of tags 48 (SecurityID), 461 (CFI Code), and 321 (SecurityRequestType)
    2. waits until the previous request is completed or predefined timeout (60 seconds by default) is expired
    FIX message example 8=FIX.4.4|9=100|35=c|49=SenderCompId|56=ICE|34=77|50=1|52=20140915-19:32:54.954|320=1410809574952_76|321=3|48=1|461=FXXXXX|10=043|
    NoteSecurity Definitions can be requested once a day or on each logon depending on the value of the property ICESession.SecurityDefinitionSubscriptions.RequestMode specified in ICEProperties.properties configuration file. The date & time of the last processed Security Definition is preserved in the persistent file (ICE_persistStorage.out) per each subscription with the time accuracy received in the incoming message.
    Note: Mentioned timeout (p.2.2) can be changed by specifying ICESession.SecurityDefinitionSubscriptions.RequestTimeout parameter (in milliseconds) in ICEProperties.properties configuration file.
  3. ICE Trade Capture determines that request parameters are valid and replies with Security Definition (MsgType = 'd') messages. 
    NoteFormat of Security Definitions (new or old) depends on the value of tag 9006 sent in custom Logon message.
  4. ICE Trade Capture Solution is doing the following in a loop for each defined strategy subscription stated in ICEProperties.properties
    1. generates Security Definition Request (MsgType = 'c'), filling the values of tags 48 (SecurityID), 461 (CFI Code), and 321 (SecurityRequestType)
    2. waits until the previous request is completed (the News (MsqType = B) has been received) or predefined timeout (60 seconds by default) is expired
    FIX message example 8=FIX.4.4|9=100|35=c|49=SenderCompId|56=ICE|34=77|50=1|52=20140915-19:32:54.954|320=1410809574952_76|321=101|48=1|461=FXXXXX|10=043|
    NoteDefine Strategies can be requested once a day or on each logon depending on the value of the property ICESession.SecurityDefinitionSubscriptions.RequestMode specified in ICEProperties.properties configuration file. The date & time of the last processed Define Strategy is preserved in the persistent file (ICE_persistStorage.out) per each subscription with the time accuracy received in the incoming message.
    Note: Mentioned timeout (p.4.2) can be changed by specifying ICESession.SecurityDefinitionSubscriptions.RequestTimeout parameter (in milliseconds) in ICEProperties.properties configuration file.
  5. ICE Trade Capture determines that request parameters are valid and replies with Defined Strategy (MsgType = 'UDS') messages.
  6. ICE Trade Capture Solution generates Trade Capture Report Request (MsgType = 'AD') for all available trades, based on the data preserved in the persistent file (ICE_persistStorage.out), and sends it to ICE Session. Trade Capture Report Requests (if any) are sent after the last Security Definition response is downloaded or predefined timeout is expired.
    FIX message example8=FIX.4.4|9=129|35=AD|49=SenderCompId|56=ICE|34=78|50=1|52=20140915-19:32:54.954|568=1410809574953_77|569=0|263=1|580=1|75=20140915|60=20140915-00:00:00|10=228|
  7. ICE Trade Capture determines that subscription parameters are valid and sends Trade Capture Report Request Ack (MsgType = 'AQ') with tags 749=0 (Success) and 750 = 0 (Accepted) confirming successful subscription:
    FIX message example8=FIX.4.4|9=104|35=AQ|49=ICE|34=165|52=20141001-23:32:24.029|56=SenderCompId|568=1410809574952_76|569=0|749=0|750=0|10=178|
  8. ICE Trade Capture sends Snapshot of trades - one or more Trade Capture Report (MsgType='AE') messages.
  9. ICE Trade Capture notices saying that all snapshot of trades is sent by Trade Capture Report Request Ack (MsgType = 'AQ') with tags 749=0 (Success) and 750 = 1 (Completed):
    FIX message example8=FIX.4.4|9=104|35=AQ|49=ICE|34=167|52=20141001-23:32:24.029|56=SenderCompId|568=1410809574952_76|569=0|749=0|750=1|10=178|
  10. ICE Trade Capture starts sending live updates (new trades or changes to existing ones - Trade Capture Report (MsgType='AE') messages, and new defined strategies - Defined Strategy (MsgType = ''UDS") messages).

PublishMktCreationRealtime(9010) tag value in Logon Request (MsgType = "A") must be equal "1" to receive UDS created real time during the trading session.


Exceptional cases

3a. ICE Trade Capture determines that the request contains an invalid ICE Market ID or an ID that the user is not allowed to access.

3a1. ICE Trade Capture sends Security Definition (MsgType = 'd') with tag 323 (SecurityResponseType) = '5' or '6'

3a2. Main flow continues from step 4. 

3b. ICE Trade Capture determines that the request contains an invalid CFI Code.

3b1. ICE Trade Capture sends Security Definition (MsgType = 'd') for the specified ICE Market ID for CFI code = FXXXXX (Futures)
3b2. The main flow continues from step 4.

5a. ICE Trade Capture determines that the request contains an invalid ICE Market ID or an ID that the user is not allowed to access.

5a1. ICE Trade Capture sends Security definition (MsgType = 'UDS') with tag 323 (SecurityResponseType) = '5'
5a2. Main flow continues from step 6.

8a. ICE Trade Capture does not have data available to be sent as a Snapshot.

8a1. The main flow continues from step 9. 

2.2 ICE Trade Capture Solution - TradesFirst Mode Workflow Diagram

If the ICESession.SecurityDefinitionSubscriptions.RequestMode property is set to TradesFirst, the ICE Trade Capture Solution will execute the TradesFirst Mode Workflow, as shown below. This flow is advantageous to those whose priority is increased performance rather than security. Trades are processed first, and if so configured, security definition subscription processing (optional) is executed simultaneously, with minimized delays to trade message processing.

Optional:
To configure security definition subscription processing, use the ICESession.TradeCaptureSubscriptions.RequestMode parameter in the ICEProperties.properties file.


TradesFirst Workflow diagram step-by-step description

  1. ICE Trade Capture Solution starts and establishes FIX Session to ICE Trade Capture using details from FIXEdge.properties file.

  2. The Main Flow commences (see below).
    1. If security definition subscription processing is configured, the Main Flow and the Security Definition Subscription Flow (below) take place simultaneously.

Main Flow

Trade Capture Report thread:

  1. ICE Trade Capture Solution generates Trade Capture Report Request (MsgType = 'AD') for all available trades, based on the data preserved in the persistent file (ICE_persistStorage.out), and sends it to ICE Session. Trade Capture Report Requests (if any) are sent after the last Security Definition response is downloaded or predefined timeout is expired.
    FIX message example: 8=FIX.4.4|9=129|35=AD|49=SenderCompId|56=ICE|34=78|50=1|52=20140915-19:32:54.954|568=1410809574953_77|569=0|263=1|580=1|75=20140915|60=20140915-00:00:00|10=228|

  2. ICE Trade Capture determines that subscription parameters are valid and sends Trade Capture Report Request Ack (MsgType = 'AQ') with tags 749=0 (Success) and 750 = 0 (Accepted) confirming successful subscription:
    FIX message example: 8=FIX.4.4|9=104|35=AQ|49=ICE|34=165|52=20141001-23:32:24.029|56=SenderCompId|568=1410809574952_76|569=0|749=0|750=0|10=178|

  3. ICE Trade Capture sends Snapshot of trades - one or more Trade Capture Report (MsgType='AE') messages.

  4. ICE Trade Capture notices saying that all snapshot of trades is sent by Trade Capture Report Request Ack (MsgType = 'AQ') with tags 749=0 (Success) and 750 = 1 (Completed):
    FIX message example: 8=FIX.4.4|9=104|35=AQ|49=ICE|34=167|52=20141001-23:32:24.029|56=SenderCompId|568=1410809574952_76|569=0|749=0|750=1|10=178|

  5. ICE Trade Capture starts sending live updates (new trades or changes to existing ones - Trade Capture Report (MsgType='AE') messages

Security Definition Subscription Flow

Security Definition thread:

  1. Once the session is established ICE Trade Capture Solution is doing the following in a loop for each security definition subscription stated in ICEProperties.properties: 
            1. generates Security Definition Request (MsgType = 'c'), filling the values of tags 48 (SecurityID), 461 (CFI Code), and 321 (SecurityRequestType)
            2. waits until the previous request is completed or predefined timeout (60 seconds by default) is expired
    FIX message example:  8=FIX.4.4|9=100|35=c|49=SenderCompId|56=ICE|34=77|50=1|52=20140915-19:32:54.954|320=1410809574952_76|321=3|48=1|461=FXXXXX|10=043|
    Note: Security Definitions can be requested once a day or on each logon depending on the value of the property ICESession.SecurityDefinitionSubscriptions.RequestMode specified in ICEProperties.properties configuration file. The date & time of the last processed Security Definition is preserved in the persistent file (ICE_persistStorage.out) per each subscription with the time accuracy received in the incoming message.
    Note: Mentioned timeout (p.2.2) can be changed by specifying ICESession.SecurityDefinitionSubscriptions.RequestTimeout parameter (in milliseconds) in ICEProperties.properties configuration file.
  2. ICE Trade Capture determines that request parameters are valid and replies with Security Definition (MsgType = 'd') messages. 
    Note: Format of Security Definitions (new or old) depends on the value of tag 9006 sent in custom Logon message.

  3. ICE Trade Capture Solution is doing the following in a loop for each defined strategy subscription stated in ICEProperties.properties: 
             1. generates Security Definition Request (MsgType = 'c'), filling the values of tags 48 (SecurityID), 461 (CFI Code), and 321 (SecurityRequestType)
             2. waits until the previous request is completed (the News (MsqType = B) has been received) or predefined timeout (60 seconds by default) is expired
    FIX message example:  8=FIX.4.4|9=100|35=c|49=SenderCompId|56=ICE|34=77|50=1|52=20140915-19:32:54.954|320=1410809574952_76|321=101|48=1|461=FXXXXX|10=043|
    Note: Define Strategies can be requested once a day or on each logon depending on the value of the property ICESession.SecurityDefinitionSubscriptions.RequestMode specified in ICEProperties.properties configuration file. The date & time of the last processed Define Strategy is preserved in the persistent file (ICE_persistStorage.out) per each subscription with the time accuracy received in the incoming message.
    Note: Mentioned timeout (p.4.2) can be changed by specifying ICESession.SecurityDefinitionSubscriptions.RequestTimeout parameter (in milliseconds) in ICEProperties.properties configuration file.

  4. ICE Trade Capture determines that request parameters are valid and replies with Defined Strategy (MsgType = 'UDS') messages.

  5. ICE Trade Capture starts sending new defined strategies - Defined Strategy (MsgType = ''UDS") messages).

Exceptional Cases

Main Flow:

3a. ICE Trade Capture does not have data available to be sent as a Snapshot.

3.a. Main Flow continues from step 4.

Security Definition Subscription Flow:

2a. ICE Trade Capture determines that the request contains an invalid ICE Market ID or an ID that the user is not allowed to access.

2a.1. ICE Trade Capture sends Security Definition (MsgType = 'd') with tag 323 (SecurityResponseType) = '5' or '6'

2a.2. Security Definition Subscription Flow continues from step 3.

2b. ICE Trade Capture determines that the request contains an invalid CFI Code.

2b.1. ICE Trade Capture sends Security Definition (MsgType = 'd') for the specified ICE Market ID for CFI code = FXXXXX (Futures)
2b.2. Security Definition Subscription Flow continues from step 3.

4a. ICE Trade Capture determines that the request contains an invalid ICE Market ID or an ID that the user is not allowed to access.

4a.1. ICE Trade Capture sends Security definition (MsgType = 'UDS') with tag 323 (SecurityResponseType) = '5'
4a.2. The flow ends.

3.1 Processing Incoming ICE Trade Capture Data

ICE Trade Capture Solution Configuration

Please see the table below that represents the components included in the FIXEdge package intended for ICE Trade Capture Solution:

Add-on ComponentConfiguration FileDescription
ICE Trade Capture Handler
(ICEHandler)
ICEProperties.properties

The separate configuration file used to specify the following ICE Handler parameters: ICE session name, persistence file location, parameters of security definition request(s).

# ============ YOU NEED TO FILL SENDER COMP ID IN THE FOLLOWING PROPERTIES: START =============
#ICE Session SenderCompID
ICESession.SenderCompID =  ***as supplied by ICE***
#ICE Session SenderSubID (session qualifier) - available starting from FIXEdge version 6.11
# This parameter is optional and to be used when ICE provides more than one connection for one Sender
ICESession.SenderSubID = ***as supplied by ICE***
# ============= YOU NEED TO FILL SENDER COMP ID IN THE FOLLOWING PROPERTIES: END ==============

# ====== YOU NEED TO SPECIFY SECURITY DEFINITION SUBSCRIPTIONS REQUEST MODE: START =======
# Security definitions' request mode defines the frequency of requests for security definitions (once a day after the very first logon or after each logon).
# Setting will be applied to all subscriptions defined under 'ICESession.SecurityDefinitionSubscriptions' property
# Valid values: 'OnceADay', 'EachLogon'
ICESession.SecurityDefinitionSubscriptions.RequestMode = OnceADay
# Trade capture request mode defines the order of subscription requests, allowing to prioritize either security definitions (SecDefFirst) or trades (TradesFirst). The default value is SecDefFirst, as below.
ICESession.TradeCaptureSubscriptions.RequestMode = SecDefFirst
# ======= YOU NEED TO SPECIFY SECURITY DEFINITION SUBSCRIPTIONS REQUEST MODE: END ========

# ====== YOU NEED TO SPECIFY SECURITY DEFINITION SUBSCRIPTIONS: START =======
#Security definition subscriptions
ICESession.SecurityDefinitionSubscriptions = ICEEuropeBrentFutures, ICEEuropeBrentOptions, ICEEuropeNaturalGasFutures, ICEEuropeNaturalGasOptions, ICEUSCocoa, ICEUSCoffee
# Example of subscription configuration:
# ICESession.SecurityDefinitionSubscriptions.SubscriptionName.SecurityID = ice_market_type_code
# ICE instrument type: Futures (FXXXXX) | Options (OXXXXX) | Unique Option market IDs (OXXFXX) 
# ICE Market Type. List of all available ICE market types:  https://www.theice.com/publicdocs/technology/Supported_Market_Types_on_ICE_API.pdf 
#ICE Europe Brent Futures
ICESession.SecurityDefinitionSubscriptions.ICEEuropeBrentFutures.SecurityID = 5
ICESession.SecurityDefinitionSubscriptions.ICEEuropeBrentFutures.CFICode = FXXXXX
#ICE Europe Brent Options
ICESession.SecurityDefinitionSubscriptions.ICEEuropeBrentOptions.SecurityID = 5
ICESession.SecurityDefinitionSubscriptions.ICEEuropeBrentOptions.CFICode = OXXXXX
#ICE Europe Natural Gas Futures
ICESession.SecurityDefinitionSubscriptions.ICEEuropeNaturalGasFutures.SecurityID = 3
ICESession.SecurityDefinitionSubscriptions.ICEEuropeNaturalGasFutures.CFICode = FXXXXX
#ICE Europe Natural Gas Options
ICESession.SecurityDefinitionSubscriptions.ICEEuropeNaturalGasOptions.SecurityID = 4
ICESession.SecurityDefinitionSubscriptions.ICEEuropeNaturalGasOptions.CFICode = OXXXXX
#ICE US Cocoa
ICESession.SecurityDefinitionSubscriptions.ICEUSCocoa.SecurityID = 20
ICESession.SecurityDefinitionSubscriptions.ICEUSCocoa.CFICode = FXXXXX
#ICE US Coffee
ICESession.SecurityDefinitionSubscriptions.ICEUSCoffee.SecurityID = 21
ICESession.SecurityDefinitionSubscriptions.ICEUSCoffee.CFICode = FXXXXX
# ====== YOU NEED TO SPECIFY SECURITY DEFINITION SUBSCRIPTIONS: END =======

# ====== YOU NEED TO SPECIFY DEFINED STRATEGY SUBSCRIPTIONS: START =======
#Security definition subscriptions
ICESession.UDSSubscriptions = ICEEuropeBrent, ICEEuropeNaturalGas, ICEEuropeGasOil
ICESession.UDSSubscriptions.ICEEuropeBrent.SecurityID = 5
ICESession.UDSSubscriptions.ICEEuropeNaturalGas.SecurityID = 3
ICESession.UDSSubscriptions.ICEEuropeGasOil.SecurityID = 4
# ====== YOU NEED TO SPECIFY DEFINED STRATEGY SUBSCRIPTIONS: END =======
BL_Config.xml

Is used to specify the following:

  • declare the separate ICE Handler for each session including qualified one (different only in SenderSubId);

    Note

    The separate config file "ICEProperties.properties" must be specified for each ICE Handler

    ..........
    <DllHandlers>
    	<Handler Name="ICEHandler" 
            Description="ICE Handler" 
            DllName="libICEHandler-MD-x64.so" 
            VerifyHandlersVersion="true" 
            ConfigFile="../FIXEdge1/conf/Separate_ICEProperties.properties" />
        ..........
    </DllHandlers>
    ..........
  • define rules for ICE Handler launch;

    ..........
           <Rule Description="Launch ICE Handler">
           <Source> 
                <FixSession SenderCompID=".*" TargetCompID=".*" />
           </Source>
           <Condition>
             <MatchMessage Value=".*PLACE YOUR SENDER COMP ID HERE.*" /> 
                <MatchMessage Value=".*Established.*" /> 
           </Condition>
           <Action>
             <!-- <Send><Client Name="SMTPClient" /></Send> --> <!-- Optional action to be used if email notification is required -->
             <HandlerAction Name="ICEHandler" />
           </Action>
     </Rule>
    ..........
  • rules for processing incoming FIX messages (including those which call java scripts storing data to database)

    ..........
    
     <Rule Description="Register messages in ICEHandler" >
         <Source Name=".*ICESession"/>
         <Condition>
            <EqualField Field="35">
               <Val>d</Val>
               <Val>AE</Val>
            </EqualField>
         </Condition>
         <Action>
           <HandlerAction Name="ICEHandler"/>
         </Action>
     </Rule>
    
    
     <Rule Description="Save ICE Trade Capture Report data and register trade in ICEHandler">
         <Source Name=".*ICESession" />
         <Condition>
             <EqualField Field="35" Value="AE" />
         </Condition>
         <Action>
             <HandlerAction Name="FMXMLHandler" EntryIndex="true" />
             <SaveToHistory Name="ICEReports" />
         </Action>
     </Rule>
    
    
     <Rule Description="Save ICE Security Definition data and register secdef in ICEHandler">
         <Source Name=".*ICESession" />
         <Condition>
             <EqualField Field="35" Value="d" />
         </Condition>
         <Action>
            <HandlerAction Name="FMXMLHandler" EntryIndex="true" />
            <SaveToHistory Name="ICESecurityDefinitions" />
         </Action>
     </Rule> 
    
    
    
    
     <Rule Description="Save ICE UDS data">
              <Source Name=".*ICESession" />
           <Condition>
             <EqualField Field="35" Value="UDS" />
           </Condition>
           <Action>
          <HandlerAction Name="FMXMLHandler" EntryIndex="true" />
       <SaveToHistory Name="ICEDefinedStrategy" />
           </Action>
     </Rule> 
    ..........
  • description of DB Stored Procedures to store data to (if applicable)

    ..........
         <History Name="ICEReports"
                 StorageType="ODBC"
                 MaxNumberOfRecords="15000"
                 TableName="ICEReports"
                 ColumnSize="256000"
                 UseStoredProcForInsert="true"
                 StoredProcName="SaveReports"
                 ConnectionString="DSN=ICE_Trades;UID=ice_admin;Pwd=temp_pass;">
          <KeyField ColumnName="xmlData" ColumnSize="256000">213</KeyField> 
        </History>
        <History Name="ICESecurityDefinitions"
                 StorageType="ODBC"
                 MaxNumberOfRecords="15000"
                 TableName="ICESecurityDefinitions"
                 ColumnSize="256000"
                 UseStoredProcForInsert="true"
                 StoredProcName="SaveDefinitions"
                 ConnectionString="DSN=ICE_Trades;UID=ice_admin;Pwd=temp_pass;">
          <KeyField ColumnName="xmlData" ColumnSize="256000">213</KeyField> 
        </History>
        <History Name="ICEDefinedStrategy"
                 StorageType="ODBC"
                 MaxNumberOfRecords="15000"
                 TableName="ICEDefinedStrategy"
                 ColumnSize="256000"
    	     UseStoredProcForInsert="true"
    	     StoredProcName="SaveStrategies"
                 ConnectionString="DSN=ICE_Trades;UID=ice_admin;Pwd=temp_pass;">
          <KeyField ColumnName="xmlData" ColumnSize="256000">213</KeyField>	
        </History>
    ..........
Extension to standard FIX 4.4 dictionaryadditional_ice.xmlDefines custom tags for ICE Trade Capture API messages
ICE FIX Session detailsFIXEdge.properties

Is used to specify FIX Session details

  • Host  = **** as supplied by ICE ****
  • Port  = **** as supplied by ICE ****
  • Encryption required: no in Test, in Production - SSL encryption is required
  • FIX Version:  4.4
  • Role:  Initiator 
  • SenderCompID  = **** as supplied by ICE ****
  • SenderSubID  = **** as supplied by ICE ****
  • TargetCompID = **** as supplied by ICE ****
  • Username = **** as supplied by ICE ****
  • Password = **** as supplied by ICE ****
  • Heartbeat Interval = 30 (recommended; value of '0' will lead to connection drops)
  • Reconnect Interval = 16000 (recommended)
  • Schedule ICEFIXSchedule
  • Logon = ICETC_Logon.msg

ICETC_Logon.msg

Is used for two main purposes:

  1. Specify the accuracy of timestamps in incoming messages from ICE via tag 9007 (increased time precision is specified in the package by default);
  2. Specify the interface of security definitions interface to be received via tag 9006 (New Strategy Information is specified in the package by default). PublishMktCreationRealtime(9010) tag value in Logon Request (MsgType = "A") must be equal "1" to receive UDS created real-time during the trading session;

Other custom tags can be also specified and used. Please check the ICE specification for details.

Database SQL scripts

ICE_database.sql

MSSQL_ICETrdCapt.sql

MSSQL_ICESecDef.sql

MSSQL_ICEStrategies.sql

Used to create database objects

  • database login, user, tables (ICE_database.sql)
  • stored procedures (MSSQL_ICETrdCapt.sql, MSSQL_ICESecDef.sql, MSSQL_ICEStrategies.sql)