Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Example of a securities exchange
C
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
.gitignore
LICENSE
Makefile
README
TODO
book.c
book.h
fix.h
fix_message.c
fix_message.h
fix_parser.c
fix_parser.h
fix_server.c
fix_server.h
fix_session.c
fix_session.h
fix_session_manager.c
fix_session_manager.h
market.c
market.h
order.c
order.h
spawn_clients.sh
test-client.c
trading-engine.c

README

Trading Engine
==============

This project implements a very simple multi-threaded trading engine
for a securites market. It is based on libcore, and supports creating
a market for trading in multiple securities.

The trading engine code is released under the Modified BSD license.


Prerequisites
=============

The trading engine is dependent on libcore, which is available here:

https://github.com/ChrisWinter/libcore


Building
========

Assuming libcore has been compiled and installed in /usr/local,
then building the trading engine is as simple as:

$ make

If libcore has been installed elsewhere, then specify the location
of libcore's include files and shared library like so:

$ LIBCORE_INCDIR=<path/to/libcore/include/dir> LIBCORE_LIBDIR=<path/to/libcore/libdir> make -e


Running
=======

Start the trading engine server:

$ ./trading-engine

Switch to a different shell, and spawn the test clients that will send orders to
the trading engine server on the localhost:

$ ./spawn_clients.sh

The trading engine server will print out some basic statistics every 5 seconds.

Kill the server with CTRL-C. The test clients will automatically exit when the
server closes the socket.
Something went wrong with that request. Please try again.