Configuration Files Explained

We use the Spring Framework to handle configuration of the Marketcetera Platform. Configuration parameters are specified in XML files in the conf directory, corresponding to their appropriate modules:

ors.xmlORS-specific JMS and FIX configurationModify to change JMS queue/topic names, sender and targetCompIDs, destination of outgoing FIX messages (i.e. exchange simulator)
orderloader.xmlOrderLoader-speicific JMS configurationModify to change JMS topic name, JMS broker URL
quickfixj.xmldefault QuickFIX engine configurationModify to change FIX message logging or to enable SSL Connecitivity
order-limits.xmlOrder LimitsModify to add or remove order limits
message-modifiers.xmlDefault FIX fields and routesModify to add default header/message/trailer fields, and setup routes
broker.xmlEmbedded JMS QueueShould not be modified, unless you have a port conflict
ors-shared.xmlInternal ORS configuration fileShould not be modified

Let's look at the various possible configurations in more detail.

FIX Connection

The FIX configuration is split between ors.xml and quickfixj.xml files. The first one contains application-specific configuration (ORS topic names and outgoing FIX destination), and quickfixj.xml contains the default QuickFIX settings.

The sendercompid uniquely identifies the sending party in the FIX connection.
The targetcompid uniquely identifies the receiving party in the FIX connection.
The server address and port point to the FIX server to which you are connecting.

Please see the FIX configuration section of the ORS Configuration guide.

QuickFIX Logging

quickfixj.xml controls the type of logger to use for the ORS. By default it is setup to use the slf4jLogFactory which uses Log4J to output either to a screen or to a file (determined by log4j.properties) file. There are two different kinds of logs:

screenLogFactoryPrints directly to stdout
slf4jLogFactorystdout log wrapper around Log4J that can be configured via log4j.properties

See the Trade Recorder section for information on how setup automatic trade recording with ORS and Tradebase.

By default the ORS logs to a file in /var/log/marketcetera/ors.xml (which may live in C:\var\log\marketcetera\ors.xml on Windows). You can modify the log4j.properties file to send output to stdout (at line 18) instead of file to see the output in the same window where you start the ORS:

log4j.rootLogger=error, stdout

Storing Database Information

The database information is stored in the sessionSettings bean in the quickfixj.xml file:

<bean id="sessionSettings" class="quickfix.spring.SessionSettings">
        <property name="defaults">
                <map>
                        .....
                        <entry key="JdbcDriver" value="com.mysql.jdbc.Driver"/>
                        <entry key="JdbcURL" value="jdbc:mysql://localhost/marketcetera"/>
                        <entry key="JdbcUser" value="marketcetera"/>
                        <entry key="JdbcPassword" value="marketcetera"/>
                </map>
        </property>
        .....

The database must have at least the tables specified in the ORS-only tables specification.

Default FIX Fields

Inserting custom FIX fields by default only makes sense in the ORS configuration guide. Please see the appropriate section of the ORS Configuration guide.

See the explanation of message modifiers on how to configure the ORS to modify the outgoing messages.

JMS Configuration

The Marketcetera platform uses a JMS message broker for communication between the various components, including the Photon client and the ORS. We have an embedded ActiveMQ JMS configured in the broker.xml file, which is started by the ORS process.

<broker useJmx="true" brokerName="ORS_BROKER" persistent="false" xmlns="http://activemq.org/config/1.0">
        <transportConnectors>
          <transportConnector uri="tcp://localhost:61616"/>
        </transportConnectors>
</broker>

You can use your own JMS if you want, just make sure to remove reference to the embedded broker from the ors.xml file and modify the following bean in both ors.xml and orderloader.xml to point to the right JMS URL:

<bean id="connectionFactory" class="org.apache.activemq.ActiveMQConnectionFactory">
        <property name="brokerURL" value="tcp://localhost:61616"/>
</bean>

Clients send messages to the ORS through the requestQueue, while the ORS sends the replies back using the topic specified in replyTopic. For example, the ORS is generally configured to listen for broker-bound messages on ors-commands and to publish messages coming back from the broker on ors-messages.

You can modify these settings in the ors.xml file to change that:

<bean id="requestQueue" class="org.apache.activemq.command.ActiveMQQueue">
        <constructor-arg value="ors-commands"/>
</bean>

<bean id="replyTopic" class="org.apache.activemq.command.ActiveMQTopic">
        <constructor-arg value="ors-messages"/>
</bean>

See the orderloader.xml section of the installation guide on what to modify for the OrderLoader.

FIX Engine

The FIX configuration section deals with setting up the default FIX engine configuration, and is mostly handed off to the code from the QuickFIX/J package. The default session settings are set in quickfixj.xml file and are also discussed in the installation guide.

<bean id="sessionSettings" class="quickfix.spring.SessionSettings">
        <property name="defaults">
                <map>
                        <entry key="ConnectionType" value="initiator"/>
                        <entry key="HeartBtInt" value="30"/>
                        <entry key="FileStorePath" value="store"/>
                        <entry key="StartTime" value="00:00:00"/>
                        <entry key="EndTime" value="00:00:00"/>
                        <entry><key><value>DataDictionary</value></key><ref bean="fixDictionaryPath" /></entry>
                        <entry key="UseDataDictionary" value="Y"/>
                        <entry key="ReconnectInterval" value="15"/>
                        <entry key="ResetOnLogout" value="Y"/>
                        <entry key="ResetOnDisconnect" value="Y"/>
                        <entry key="SendResetSeqNumFlag" value="Y"/>
                        <entry key="JdbcDriver" value="com.mysql.jdbc.Driver"/>
                        <entry key="JdbcURL" value="jdbc:mysql://localhost/marketcetera"/>
                        <entry key="JdbcUser" value="marketcetera"/>
                        <entry key="JdbcPassword" value="marketcetera"/>
                </map>
              ............

You can modify the value of the DataDictionary field to use a custom dictionary for validation. Otherwise, the default dictionary corresponding to the FIX version specified in ors.xml file is used.
We also specify that the FIX connection should reset automatically on either a disconnect or a logout.

For more information about configuring the underlying QuickFIX/J component, see the QuickFIX/J Configuration documentation

SSL Connectivity

Enabling SSL connection to a FIX destination is very straightforward. Modify the default session settings in quickfixj.xml file (described above) and add the following keys:

       <entry key="SocketUseSSL" value="Y"/>
       <entry key="SocketKeyStore" value="yourkeystore.jks"/>
       <entry key="SocketKeyStorePassword" value="yourpassword"/>

The keystore file (we had a good experience using plain Sun JKS file) should be stored somewhere on the classpath, the same conf/ directory works great. This writeup may prove useful on how to create a java key store.

ors.xml

Take a look at the quickfixj.xml file if you need to modify additional QuickfixJ fields, such as specifying a custom FIX dictionary for your session.

For more information on connecting to the Marketcetera simulators see the simulators connection information writeup.

Default FIX Fields (Optional)

See the section on message modifiers for more detailed explanation of how messages are modified.

The following section configures the default FIX header/trailer fields, and is entirely optional. It is useful for complying with minor FIX dialect differences among brokers. To add your own default message modifiers modify the defaultMessageModifier section of the conf/message-modifiers.xml file. There are sections for regular FIX fields, header and trailer fields.

<property name="headerFields">
        <map>
                <entry key="57" value="CERT"/>
        </map>
</property>
<property name="msgFields">
        <map>
                <entry key="7001" value="TOP"/>
        </map>
</property>
<property name="trailerFields">
        <map>
        </map>
</property>

In the example above, the value of header field 57 (TargetSubID) is always set to be CERT in all outgoing messages, and the field 7001 in the message body is set to "TOP". No trailer fields are defined.

The property name can have a predicate to specify whether to insert the field into all message, messages of a particular type, or messages matching a particular tag. The syntax of the Regular Expression for the property name is as follows:

fix.(fields|header|trailer).([0-9]+)(\((\*|[0-9a-z]|admin|app)\))?

Which makes the following examples valid property names:

87
87(*)
(D)
87(app)
87(admin)

The first example '87' works exactly as described above, the rest of the examples have a 'predicate' in parenthesis.
Predicate values break down as follows:

  1. * -- insert field into all messages, the default
  2. <single letter or digit> -- insert field into messages matching this MsgType
  3. app -- insert field into app messages
  4. admin -- insert field into admin messages

Marketcetera Platform ships with these built-in message modifiers

  1. Field Duplicator - duplicates message fields
  2. Option Symbol splitter - removes the +JX suffix when incoming option symbol is in the following format: IBM+JX

See this discussion for information on how to create custom message modifiers.

Share Classes

Certain equities have different classes of shares, with Berkshire Hathaway BRK/A and BRK/B being the classics. To support different classes of shares in Marketcetera, turn on the separateSuffix property in the orderRouting section of the messages-modifiers.xml file (disabled by default):

        <property name="separateSuffix" value="true"/>

Use the "/" to designate different classes of shares: BRK/A, and here's the example of a command-line order: O B 100 BRK/A MKT

In this example, Marketcetera sets the Symbol (tag 55) to be BRK and the SymbolSfx (tag 65) to be A.

ORS Logging

By default the ORS is setup to log to the screen to the logs/ors.log file. Please see the logging section of the configuration file guide on how to modify or disable this.

If you are not using the appliance, you will need to create the database according to the specifications in the configuration file guide, or the ors will not start.