Configuration Guide
===================
FIX-FastTrade uses XML-based configuration files to manage system settings, FIX sessions, and performance parameters.
Configuration Files
-------------------
Main Configuration Files
~~~~~~~~~~~~~~~~~~~~~~~~
* **fix-config.xml** - Main FIX session configuration
* **system/performance.json** - Performance tuning parameters
* **examples/** - Working configuration templates
Configuration Structure
~~~~~~~~~~~~~~~~~~~~~~~
The main configuration file follows this structure:
.. code-block:: xml
SENDER
TARGET
localhost
9878
FIX.4.4
30
INFO
logs/fix-fasttrade.log
true
true
-10
Session Configuration
---------------------
Basic Session Settings
~~~~~~~~~~~~~~~~~~~~~~
.. code-block:: xml
YOUR_COMPANY_ID
EXCHANGE_ID
fix.exchange.com
9878
FIX.4.4
30
Advanced Session Settings
~~~~~~~~~~~~~~~~~~~~~~~~~
.. code-block:: xml
5
10
30
8192
true
true
true
true
1
1
Performance Configuration
-------------------------
CPU Affinity Settings
~~~~~~~~~~~~~~~~~~~~~
.. code-block:: xml
true
0
1
2
3
Memory Management
~~~~~~~~~~~~~~~~~
.. code-block:: xml
true
1048576
true
Threading Configuration
~~~~~~~~~~~~~~~~~~~~~~~
.. code-block:: xml
-10
true
8388608
Logging Configuration
---------------------
Basic Logging
~~~~~~~~~~~~~
.. code-block:: xml
INFO
logs/fix-fasttrade.log
100MB
10
Advanced Logging
~~~~~~~~~~~~~~~~
.. code-block:: xml
DEBUG
true
logs/fix-fasttrade.log
true
%Y-%m-%d %H:%M:%S.%f
DEBUG
INFO
WARN
Environment-Specific Configurations
-----------------------------------
Development Configuration
~~~~~~~~~~~~~~~~~~~~~~~~~
.. code-block:: xml
DEV_TRADER
DEV_EXCHANGE
localhost
9878
60
DEBUG
true
false
false
Production Configuration
~~~~~~~~~~~~~~~~~~~~~~~~
.. code-block:: xml
PROD_TRADER_001
EXCHANGE_PROD
fix.exchange.com
9878
30
true
INFO
/var/log/fix-fasttrade/fix-fasttrade.log
true
true
0
1
2
true
-10
Configuration Validation
------------------------
Validate Configuration
~~~~~~~~~~~~~~~~~~~~~~
Before starting the system, validate your configuration:
.. code-block:: bash
# Validate XML syntax
xmllint --noout config/fix-config.xml
# Test configuration with dry-run
./bin/fix-fasttrade --config config/fix-config.xml --validate
Common Configuration Issues
~~~~~~~~~~~~~~~~~~~~~~~~~~~
**Invalid XML Syntax**
.. code-block:: text
Error: XML parsing failed at line 15: mismatched tag
Solution: Use xmllint to check syntax:
.. code-block:: bash
xmllint --noout config/fix-config.xml
**Missing Required Fields**
.. code-block:: text
Error: Required field 'senderCompID' not found
Solution: Ensure all required fields are present in the session configuration.
**Port Already in Use**
.. code-block:: text
Error: Cannot bind to port 9878: Address already in use
Solution: Change the port number or stop the conflicting service:
.. code-block:: bash
# Find process using the port
lsof -i :9878
# Kill the process or use a different port
9879
Configuration Examples
----------------------
The ``config/examples/`` directory contains working configuration templates:
* **basic-config.xml** - Minimal working configuration
* **high-performance-config.xml** - Optimized for low latency
* **development-config.xml** - Development environment settings
* **production-config.xml** - Production deployment configuration
Command Line Configuration
--------------------------
Many configuration options can be overridden via command line:
.. code-block:: bash
./bin/fix-fasttrade \
--config config/fix-config.xml \
--cpu-main 0 \
--cpu-fix 1 \
--cpu-order 2 \
--memory-lock \
--priority -10 \
--stats-interval 30 \
--log-level DEBUG
For a complete list of command line options:
.. code-block:: bash
./bin/fix-fasttrade --help