# QuickFIX Guide

## About QuickFIX

QuickFIX Engine is an open source implementation of the FIX Protocol. To learn more, visit:

{% embed url="<https://quickfixengine.org/>" %}

## QuickFIX/C++

QuickFIX/C++ is a FIX implementation for C++, Python, and Ruby. Follow these steps to start using sFOX's FIX API with QuickFIX/C++:

1. Compile [QuickFIX/C++](https://github.com/quickfix/quickfix/tree/master/examples/tradeclient): `cmake` then `make` in the root directory
2. Use the [`stunnel` Configuration](#stunnel-configuration) below with `stunnel tunnel.conf`
3. Run the [Test Client](#undefined) `./bin/tradeclient <file_name>.cfg`

{% hint style="warning" %}
Make sure to add your API key to the application (recommended to so do in code). Following these steps without adding your API Key will result in failure to connect
{% endhint %}

#### stunnel Configuration

`tunnel.conf`

```
socket = l:TCP_NODELAY=1
socket = r:TCP_NODELAY=1

sslVersionMin = TLSv1.2
sslVersionMax = TLSv1.3

debug = debug
client = yes
foreground = yes

[order]
accept = 5001
connect = fix.sfox.com:5001
sni = fix.sfox.com
```

#### Test Client

`<file_name>.cfg` (i.e. sfox.cfg)

{% hint style="warning" %}
Update the `SenderCompID` to the name of your choice
{% endhint %}

```ini
[DEFAULT]
ConnectionType=initiator
ReconnectInterval=60

[SESSION]
BeginString=FIX.4.4
SenderCompID=<your_sender_comp_id>
HeartBtInt=10
TargetCompID=SFOX
UseDataDictionary=N
SocketConnectPort=5001
SocketConnectHost=127.0.0.1
StartTime=00:00:00
EndTime=00:00:00
ResetOnLogon=Y
LogonTimeout=60
FileStorePath=./stores
```

## QuickFIX/J (Java)

{% hint style="warning" %}
LOGON responses will arrive after the heart beat interval, you will either need to set the heart beat interval low or set *LogonTimeout > HeartBtInt*&#x20;
{% endhint %}

{% hint style="warning" %}
UseSNI: You must set UseSNI=Y, which is supported in >=2.3.0
{% endhint %}

{% hint style="info" %}
`stunnel` is required for Java versions before 1.17
{% endhint %}

## Quickfix/N (C#)

Example Config

```
[DEFAULT]
ConnectionType=initiator
ReconnectInterval=60

[SESSION]
BeginString=FIX.4.4
SenderCompID=STG-USER-MD-01 # your assigned sender comp id
HeartBtInt=10
TargetCompID=SFOX
UseDataDictionary=N
StartTime=00:00:05
EndTime=00:00:00
StartDay=Sunday
EndDay=Sunday
ResetOnLogon=Y
LogonTimeout=60
FileStorePath=./stores
SSLEnable=Y
SocketConnectPort=5001
SocketConnectHost=fix-md.staging.sfox.com # or fix.staging.sfox.com for OE sessions
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.sfox.com/fix-api/quickfix-guide.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
