QuickFIX/Go Examples
If you are interested in writing your own code right away, take a look at the sub-applications descriptions below, navigate to their READMEs to get a better sense of the required ins and outs of FIX apps, and then browse their source code for an example that fits your needs.
- TradeClient is a simple FIX initiator console-based trading client
- Executor is a FIX acceptor service that fills every limit order it receives
- OrderMatch is a primitive matching engine and FIX acceptor service
All examples have been ported from QuickFIX
Usage
This project builds a cli tool qf
with 3 commands corresponding to each example.
The generalized usage is of the form:
qf [GLOBAL FLAGS] [COMMAND] [COMMAND FLAGS] [ARGS]
The examples are meant to be run in pairs- the TradeClient as a client of either the Executor or OrderMatcher. By default, the examples will load the default configurations named after the example apps provided in the config/
root directory. i.e., running qf tradeclient
will load the config/tradeclient.cfg
configuration. Each example can be run with a custom configuration as a command line argument (qf tradeclient my_trade_client.cfg
).
Installation
In order to use this awesome tool, you'll need to get it on your machine!
From Homebrew
If you're on macOS, the easiest way to get the examples is through the homebrew tap.
brew tap quickfixgo/qf
brew install qf
Run the command qf help
in your shell for the list of possible example subcommands.
From Release
- Head over to the official releases page
- Determine the appropriate distribution for your operating system (mac | windows | linux)
- Download and untar the distribution. Shortcut for macs:
curl -sL https://github.com/quickfixgo/examples/releases/download/v{VERSION}/qf_{VERSION}_Darwin_x86_64.tar.gz | tar zx
- Move the binary into your local
$PATH
. - Run the command
qf help
in your shell for the list of possible example subcommands.
From Source
To build and run the examples, you will first need Go installed on your machine
Next, clone this repository with git clone [email protected]:quickfixgo/examples.git
. This project uses go modules, so you just need to type make build
. This will compile the examples executable in the ./bin
dir in your local copy of the repo. If this exits with exit status 0, then everything is working! You may need to pull the module deps with go mod download
.
make build
Run the command ./bin/qf help
in your shell for the list of possible example subcommands.
From Snapcraft
Linux OS users can install the examples through the snap store.
sudo snap install quickfixgo-qf
Run the command qf help
in your shell for the list of possible example subcommands.
From Scoop
Windows users can install the examples via the Scoop package manager.
scoop bucket add auth0 https://github.com/auth0/scoop-auth0-cli.git
scoop install auth0
Run the command qf help
in your shell for the list of possible example subcommands.
Docker Image
The quickfix examples are also available as a docker image here. To pull and run the latest
, use the following command:
docker run -it quickfixgo/qf
To run a specific example, you can do something like this:
docker run -it -p 5001:5001 quickfixgo/qf ordermatch
Note: The docker image comes pre-loaded with the default configs. If you want to supply your own, you can specify a volume binding to your local directory in the run command.
Licensing
This software is available under the QuickFIX Software License. Please see the LICENSE for the terms specified by the QuickFIX Software License.