An acceptor or initiator can maintain as many FIX sessions as you would like. A FIX session is defined in QuickFix/N as a unique combination of a BeginString (the FIX version number), a SenderCompID (your ID), and a TargetCompID (the ID of your counterparty). A SessionQualifier can also be used to disambiguate otherwise identical sessions.
Each session can have several settings associated with them. Some of these settings may not be known at compile time and are therefore passed via a class called SessionSettings
. SessionSettings
behaves as a data dictionary that can be set and queried.
The SessionSettings
class has the ability to parse settings out of any System.IO.TextReader
. You can also simply pass it a filename. If you decide to write your own components (eg, storage for a particular database) you may also use this to store settings.
A settings file is set up with two types of heading; [DEFAULT] and [SESSION]. [SESSION] tells QuickFIX/N that a new Session is being defined. [DEFAULT] is a section to define settings which will be associated with sessions that don’t explicitly define them. QuickFIX/N itself will not define default values for all required settings. If you do not provide a setting that QuickFIX/N needs, it will throw a ConfigError
telling you what setting is missing or improperly formatted.
Below are the settings that can be associated with a session based on the default functionality provided with QuickFIX/N, followed by an example.
QuickFIX Settings
- Session
- Validation
- Initiator
- Acceptor
- Socket Configuration
- Storage
- File Storage
- Logging
- SSL
- Sample Settings File
Session
Setting | Description | Valid Values | Default |
---|---|---|---|
BeginString | Version of FIX this session uses |
FIXT.1.1
FIX.4.4
FIX.4.3
FIX.4.2
FIX.4.1
FIX.4.0
|
|
SenderCompID | Your ID as associated with this FIX session | case-sensitive alpha-numeric string | |
SenderSubID | (Optional) Your subID as associated with this FIX session | case-sensitive alpha-numeric string | |
SenderLocationID | (Optional) Your locationID as associated with this FIX session | case-sensitive alpha-numeric string | |
TargetCompID | Counterparty's ID as associated with this FIX session | case-sensitive alpha-numeric string | |
TargetSubID | (Optional) Counterparty's subID as associated with this FIX session | case-sensitive alpha-numeric string | |
TargetLocationID | (Optional) Counterparty's locationID as associated with this FIX session | case-sensitive alpha-numeric string | |
SessionQualifier | Additional qualifier to disambiguate otherwise identical sessions | case-sensitive alpha-numeric string | |
DefaultApplVerID | Required only for FIXT 1.1 (and newer). Ignored for earlier transport versions. Specifies the default application version ID for the session. This can be the ApplVerID enum (see the ApplVerID field) or the BeginString for the default version. |
FIX.5.0SP2
FIX.5.0SP1
FIX.5.0
FIX.4.4
FIX.4.3
FIX.4.2
FIX.4.1
FIX.4.0
|
- |
ConnectionType | Defines if session will act as an acceptor or initiator |
initiator
acceptor
|
- |
StartTime | Time of day that this FIX session becomes activated | Time in the format of HH:MM:SS. Uses "TimeZone" if specified, else UTC | - |
EndTime | Time of day that this FIX session becomes deactivated | Time in the format of HH:MM:SS. Uses "TimeZone" if specified, else UTC | - |
StartDay | For week long sessions, the starting day of week of the session. Use in combination with StartTime. | Day of week in English using any abbreviation (ie mo, mon, mond, monda, monday are valid) | - |
EndDay | For week long sessions, the ending day of week for the session. Use in combination with EndTime. | Day of week in English using any abbreviation (ie mo, mon, mond, monda, monday are valid) | - |
Weekdays |
For daily sessions that are active on specific days of the week.
Use in combination with StartTime and EndTime. Incompatible with StartDay and EndDay. If StartTime is before EndTime then the day corresponds to the StartTime. |
Comma-delimited list of days of the week (in English).
(Only the first two letters of each day are needed, e.g. "Tu,We,Th" and "Tues,Wed,Thurs" both work) |
- |
NonStopSession |
The session runs forever without interruption.
Incompatible with StartDay/EndDay and StartTime/EndTime |
Y
N
|
N |
MillisecondsInTimestamp DEPRECATED Use TimestampPrecision |
Determines if milliseconds should be added to timestamps. Only available for FIX.4.2 and greater. |
Y
N
|
Y |
TimestampPrecision |
How much precision should go into timestamps. Note: C# precision is limited to ticks, which are 100ns, thus nanosecond timestamps will always be rounded down |
Seconds
Milliseconds
Microseconds
Nanoseconds
|
Milliseconds |
SendRedundantResendRequests | If set to Y, QuickFIX will send all necessary resend requests, even if they appear redundant. Some systems will not certify the engine unless it does this. When set to N, QuickFIX will attempt to minimize resend requests. This is particularly useful on high volume systems. |
Y
N
|
N |
ResetOnLogon | Determines if sequence numbers should be reset when receiving a logon request. |
Y
N
|
N |
ResetOnLogout | Determines if sequence numbers should be reset to 1 after a normal logout termination. |
Y
N
|
N |
ResetOnDisconnect | Determines if sequence numbers should be reset to 1 after an abnormal termination |
Y
N
|
N |
RefreshOnLogon | Determines if session state should be restored from persistence layer at logon. Useful for creating hot failover sessions. |
Y
N
|
N |
EnableLastMsgSeqNumProcessed | Add the last message sequence number processed in the header (optional tag 369). |
Y
N
|
N |
MaxMessagesInResendRequest | Sets the maximum number of messages to retransmit in a single resend request. | Any integer greater than 0 is valid. Use 0 for infinity (default). | 0 |
SendLogoutBeforeDisconnectFromTimeout | Specifies whether a logout message should be sent before a connection is disconnected due to a timeout. |
Y
N
|
N |
IgnorePossDupResendRequests | Specifies whether to ignore a resend request when PossDupFlag (tag 43) is set to true |
Y
N
|
N |
UseLocalTime | Specifies whether to use local machine time for session schedule (StartTime and EndTime). |
Y
N
|
N |
TimeZone | Specifies time zone ID used for session schedule. Cannot be used with UseLocalTime. Supplied ID will be passed to TimeZoneInfo.FindSystemTimeZoneById. (See here for how to get a list of valid IDs on your system.) | Any time zone ID supported on target system. | - |
RequiresOrigSendingTime | If N, do not reject SequenceReset/PossDup messages that lack OrigSendingTime |
Y
N
|
Y |
Validation
Setting | Description | Valid Values | Default |
---|---|---|---|
UseDataDictionary | Tells session whether or not to expect a data dictionary. You should always use a DataDictionary if you are using repeating groups. |
Y
N
|
Y |
DataDictionary |
XML definition file for validating incoming FIX messages. If no DataDictionary is supplied, only basic message validation will be done. This setting should only be used with FIX transport versions older than FIXT.1.1 (i.e. FIX4x). See TransportDataDictionary and AppDataDictionary for FIXT.1.1 (i.e. FIX5+) settings.
|
Valid XML data dictionary file. QuickFIX/N comes with the following defaults in the spec/fix directory FIX44.xml
FIX43.xml
FIX42.xml
FIX41.xml
FIX40.xml
|
- |
TransportDataDictionary |
XML definition file for validating admin (transport) messages. This setting is only valid for FIXT.1.1 (usually FIX5+) sessions. See DataDictionary for older transport versions (FIX.4.0-FIX.4.4) for additional information.
|
Valid XML data dictionary file. QuickFIX/N comes with the following defaults in the spec/fix directory FIXT1.1.xml
|
- |
AppDataDictionary |
XML definition file for validating application messages. This setting is only valid for FIXT.1.1 (usually FIX5+) sessions. Not used for older transport versions. For FIX4x versions, see the DataDictionary setting. This setting supports the possibility of a custom application data dictionary for each session. This setting can be used as a prefix to specify multiple application dictionaries for the FIXT transport. For example: DefaultApplVerID=FIX.4.2
|
Valid XML data dictionary file, QuickFIX/N comes with the following defaults in the spec/fix directory FIX50SP2.xml
FIX50SP1.xml
FIX50.xml
FIX44.xml
FIX43.xml
FIX42.xml
FIX41.xml
FIX40.xml
|
- |
ValidateLengthAndChecksum | If set to N, messages with incorrect length or checksum fields will not be rejected. |
Y
N
|
Y |
ValidateFieldsOutOfOrder | If set to N, fields that are out of order (ie, body fields in the header, or header fields in the body) will not be rejected. Useful for connecting to systems which do not properly order fields. |
Y
N
|
Y |
ValidateFieldsHaveValues | If set to N, fields without values (e.g. "|44=|"; nothing after the "=") will not be rejected.
Useful for connecting to systems that improperly send empty tags.
Warning: The QF/n engine will not try to convert empty strings to non-string types. For instance, msg.Price.Obj will throw an IncorrectDataFormat exception, because the engine will not convert "" to float (or DateTime, or int, etc.). You can use msg.GetString(44).Length to get the field as a string and query its length. |
Y
N
|
Y |
ValidateUserDefinedFields | If set to N, user-defined fields will not be rejected if they are not defined in the data dictionary, or are not present in messages they do not belong to. |
Y
N
|
Y |
AllowUnknownMsgFields | If set to Y, non user-defined fields (field with tag < 5000) will not be rejected if they are not defined in the data dictionary, or are present in messages they do not belong to.
(Only applies to fields outside repeating groups; fields in groups must still obey the configured data dictionary or be rejected.) |
Y
N
|
N |
CheckLatency | If Y, messages must be received from the counterparty within a defined number of seconds (see MaxLatency). It is useful to turn this off if a system uses localtime for its timestamps instead of GMT. |
Y
N
|
Y |
MaxLatency | If CheckLatency=Y, this defines the number of seconds latency allowed for a message to be processed. |
positive integer
|
120 |
Initiator
Setting | Description | Valid Values | Default |
---|---|---|---|
ReconnectInterval | Time between reconnection attempts in seconds. Only used for initiators. NOTE: must be defined in DEFAULT section | Positive integer | 30 |
HeartBtInt | Heartbeat interval in seconds. Only used for initiators. | Positive integer | - |
LogonTimeout | Number of seconds to wait for a logon response before disconnecting. | Positive integer | 10 |
LogoutTimeout | Number of seconds to wait for a logout response before disconnecting. | Positive integer | 2 |
SocketConnectPort | Socket port for connecting to a session. Only used for initiators. | Positive integer | - |
SocketConnectHost | Host to connect to. Only used for initiators. | Valid IP address in the format of x.x.x.x or a domain name | - |
SocketConnectPort<n> | Alternate socket ports for connecting to a session for failover, where n is a positive integer. ie, SocketConnectPort1, SocketConnectPort2... must be consecutive and have a matching SocketConnectHost<n> | Positive integer | - |
SocketConnectHost<n> | Alternate socket hosts for connecting to a session for failover, where n is a positive integer. ie, SocketConnectHost1, SocketConnectHost2... must be consecutive and have a matching SocketConnectPort<n> | Valid IP address in the format of x.x.x.x or a domain name | - |
Acceptor
Setting | Description | Valid Values | Default |
---|---|---|---|
SocketAcceptPort | Socket port for listening to incoming connections. Only used with acceptors. | Positive integer, valid open socket port | - |
SocketAcceptHost | Socket host for listening to incoming connections. If not provided, the acceptor will listen on all network interfaces (0.0.0.0) | Valid IP address in the format of x.x.x.x | 0.0.0.0 |
Socket Configuration
SocketNodelay | Disable Nagle's algorithm for this connection. Written data to the network is not buffered pending acknowledgement of previously written data. Currently, this must be defined in the [DEFAULT] section. |
Y
N
|
Y |
SocketSendBufferSize |
Set the size (in bytes) of the TCP send buffer.
(See related .NET API) |
integer
|
8192 |
SocketReceiveBufferSize |
Set the size (in bytes) of the TCP receive buffer
(See related .NET API) |
integer
|
8192 |
SocketSendTimeout |
Set the time that the TCP socket will wait for a send operation to complete successfully
(See related .NET API) |
integer
|
0 |
SocketReceiveTimeout |
Set the time that the TCP socket will wait for a receive operation to complete successfully
(See related .NET API) |
integer
|
0 |
SocketIgnoreProxy | (Windows-specific) If the platform has a proxy configured, the engine will ignore it. |
Y
N
|
N |
Storage
Setting | Description | Valid Values | Default |
---|---|---|---|
PersistMessages | If set to N, no messages will be persisted. This will force QuickFIX to always send GapFills instead of resending messages. Use this if you know you never want to resend a message. Useful for market data streams. |
Y
N
|
Y |
File Storage
Setting | Description | Valid Values | Default |
---|---|---|---|
FileStorePath | Directory to store sequence number and message files. | Valid directory for storing files, must have write access. | - |
Logging
Setting | Description | Valid Values | Default |
---|---|---|---|
FileLogPath | (FileLogFactory only) Directory to store logs. | Valid directory for storing files, must have write access | - |
DebugFileLogPath | (Acceptors only) Directory to store ThreadedClientAcceptor thread logs. | Valid directory for storing files, must have write access | Value of FileLogPath if present, else "log". |
ScreenLogShowIncoming | (ScreenLogFactory only) Whether to print incoming FIX messages to the screen |
Y
N
|
N |
ScreenLogShowOutgoing | (ScreenLogFactory only) Whether to print outgoing FIX messages to the screen |
Y
N
|
N |
ScreenLogShowEvents | (ScreenLogFactory only) Whether to print event-log information to the screen |
Y
N
|
N |
SSL
Setting | Description | Valid Values | Default |
---|---|---|---|
SSLEnable | Determine if SSL should be used. |
Y
N
|
Y if SSLCertificatePath is specified, otherwise N |
SSLServerName | The expected certificate name of the server (usually same as DNS name). Only used for initiators. | string | defaults to value of SocketConnectHost |
SSLProtocols | Specifies the SSLProtocol to use (according to the C# SslProtocols enum). If .NET 4.5 is used there are more valid values. Refer to this MSDN page for a complete list of valid values. |
Ssl2
Ssl3
Tls
Default
Any other valid SslProtocols enum value
|
Default |
SSLValidateCertificates |
If Y, the remote party's certificate will be verified against the certificate
specified by the SSLCACertificate setting (or the operating system's list of trusted CAs if that
setting is not specified). NOTE: setting the value to N is a security risk. Setting the value to N will also set SSLCheckCertificateRevocation to N. |
Y
N
|
Y |
SSLCheckCertificateRevocation | Determine if certificate revocation list (CRL) should be used to check if SSL certificates have been revoked. Will be overridden to N if SSLValidateCertificates=N. |
Y
N
|
Y |
SSLCertificate | Specifies which SSL certificate (containing a private key) to use. Required for acceptor, but not for initiator unless client certificates are used. The certificate can be loaded either from a pfx file or from the current user's personal certificate store. |
|
- |
SSLCertificatePassword | Password for the SSL certificate | string | - |
SSLRequireClientCertificate | Determine if acceptor should require client certificates from all acceptors |
Y
N
|
Y |
SSLCACertificate | Specifies the CA certificate used by acceptor to validate client certificates. If not specified, then all certificates installed on the computer's certificate store (under "Trusted Root Certificates") are used. The certificate can be loaded either from a file or from the current user's personal certificate store. |
|
- |
Sample Initiator Settings File
Here is a typical initiator settings file you might find in a firm that wants to connect to several ECNs.
# default settings for sessions
[DEFAULT]
FileStorePath=store
FileLogPath=log
ConnectionType=initiator
ReconnectInterval=60
SenderCompID=TW
# session definition
[SESSION]
# inherit FileStorePath, FileLogPath, ConnectionType,
# ReconnectInterval and SenderCompID from default
BeginString=FIX.4.1
TargetCompID=ARCA
StartTime=12:30:00
EndTime=23:30:00
HeartBtInt=20
SocketConnectPort=9823
SocketConnectHost=123.123.123.123
DataDictionary=somewhere/FIX41.xml
[SESSION]
BeginString=FIX.4.0
TargetCompID=ISLD
StartTime=12:00:00
EndTime=23:00:00
HeartBtInt=30
SocketConnectPort=8323
SocketConnectHost=23.23.23.23
DataDictionary=somewhere/FIX40.xml
[SESSION]
BeginString=FIX.4.2
TargetCompID=INCA
StartTime=12:30:00
EndTime=21:30:00
# overide default setting for RecconnectInterval
ReconnectInterval=30
HeartBtInt=30
SocketConnectPort=6523
SocketConnectHost=3.3.3.3
# (optional) alternate connection ports
# and hosts to cycle through on failover
SocketConnectPort1=8392
SocketConnectHost1=8.8.8.8
SocketConnectPort2=2932
SocketConnectHost2=12.12.12.12
DataDictionary=somewhere/FIX42.xml
Sample Acceptor Settings File
Here is a typical acceptor settings file.
# default settings for sessions
[DEFAULT]
FileStorePath=store
FileLogPath=log
ConnectionType=acceptor
ReconnectInterval=60
SenderCompID=ARCA
# session definition
[SESSION]
# inherit FileStorePath, FileLogPath, ConnectionType,
# ReconnectInterval and SenderCompID from default
BeginString=FIX.4.1
TargetCompID=TW
StartTime=12:30:00
EndTime=23:30:00
HeartBtInt=20
SocketAcceptPort=9823
DataDictionary=somewhere/FIX41.xml
[SESSION]
BeginString=FIX.4.0
TargetCompID=TW
StartTime=12:00:00
EndTime=23:00:00
HeartBtInt=30
SocketAcceptPort=8323
DataDictionary=somewhere/FIX40.xml
[SESSION]
BeginString=FIX.4.2
TargetCompID=TW
StartTime=12:30:00
EndTime=21:30:00
# overide default setting for RecconnectInterval
ReconnectInterval=30
HeartBtInt=30
SocketAcceptPort=6523
# (optional) only listen for incoming connections on a specific host
SocketAcceptHost=127.0.0.1
DataDictionary=somewhere/FIX42.xml