• Stars
    star
    129
  • Rank 279,262 (Top 6 %)
  • Language
    C
  • Created almost 11 years ago
  • Updated almost 11 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Fast C++ adaptation of the QuantCup (http://www.quantcup.org/) limit order book.

QuantCup limit order book in C++

Matching Engine in C++

This is an implementation of the limit order matching engine interface from the QuantCup problem.

The winning implementation was a classic C implementation - hand-coded intrusive linked lists, global variables, etc.

I wanted to see if it was possible to reimplement this in C++ with heavy usage of C++ STL and Boost libraries to reduce the amount of code used, to reduce the amount of code, not hand-roll our own data structures, etc. It seemed an interesting question to see if such a solution could be as fast as the highly-tuned C implementation.

Files

Relevant files are

  • order_book.cpp
  • order_book.h
  • constants.h
  • types.h

The rest is provided by the QuantCup competition.

Performance

On my 2.4 GHz Intel i7, there is no statistically signficant difference between the winning C implementation and the C++ implementation. The C++ implementation is significantly cleaner (eschewing global variables, using boost::intrusive for our linked list implementation, etc).

Replication

To replicate these results, just run:

$ git checkout winning-cpp-engine
$ make build && build/test && for i in {1..10}; do echo $i && \
build/score 2>&1 | tail -n1 | cut -d ' ' -f 3; done

$ git checkout winning-c-engine
$ make build && build/test && for i in {1..10}; do echo $i && \
build/score 2>&1 | tail -n1 | cut -d ' ' -f 3; done

More Repositories

1

dnngraph

A DSL for deep neural networks, supporting Caffe and Torch
Haskell
697
star
2

Elements-of-Statistical-Learning

Contains LaTeX, SciPy and R code providing solutions to exercises in Elements of Statistical Learning (Hastie, Tibshirani & Friedman)
R
291
star
3

svmpy

Basic soft-margin kernel SVM implementation in Python
Python
244
star
4

sklearn-compiledtrees

Compiled Decision Trees for scikit-learn
Python
224
star
5

adpredictor

A simple implementation of Microsoft's AdPredictor (http://bit.ly/SFgcq8) in Python
Python
90
star
6

decisiontrees

High performance implementations of gradient boosting, random forests, etc. in Go
JavaScript
60
star
7

haskell-ml

Haskell implementations of various ML algorithms.
Haskell
56
star
8

deeplearning-hs

Haskell
53
star
9

LaTeX2Markdown

An AMS-LaTeX compatible converter that maps a subset of LaTeX to Markdown/MathJaX.
Python
39
star
10

SydneyUniversityMathematicsNotes

Contains lecture notes for several Sydney University advanced mathematics courses. Contributions welcomed!
Ruby
34
star
11

admmlrspark

ADMM Logistic Regression implemented in Spark
Scala
32
star
12

caffe.rs

Rust
23
star
13

IntensityCreditModels

Code used to implement various stochastic intensity models for univariate and multivariate credit risk models.
Python
21
star
14

dots

Vim Script
17
star
15

hopfield-networks

Hopfield Networks for unsupervised learning in Haskell
Haskell
16
star
16

phabricator.el

Emacs Lisp
14
star
17

freelearning

Haskell
11
star
18

Isotonic.jl

Julia
10
star
19

sparse-ads-baselines

Python
8
star
20

decisiontree-performance

C++ code examining decision tree evaluation strategies, accompanying tullo.ch/articles/decision-tree-evaluation/
C++
7
star
21

boggle

Haskell
5
star
22

DeepLearning.jl

Julia
5
star
23

mkdown.el

CSS
4
star
24

lrucache.cpp

C++
3
star
25

NaiveBayesSpamFilter

An implementation of the Naive Bayes machine learning algorithm, applied to spam filtering
Python
3
star
26

tullo-ch

tullo.ch static website content
TeX
2
star
27

bgess

C++
2
star
28

spacemacs-tulloch

Emacs Lisp
2
star
29

ajtulloch.github.com

Contains the Jekyll code for the old tullo.ch site
JavaScript
2
star
30

UniTables

Collaborative timetabling management for students
JavaScript
1
star
31

phash-hs

Haskell
1
star
32

Dantzig.jl

Julia
1
star
33

DecisionTreePerformance.jl

Julia
1
star
34

tensorflow-rs

Rust
1
star
35

cascalog-tfidf

Cascalog implementation of TF-IDF document processing
Clojure
1
star
36

julia-thrift

Julia
1
star
37

sparse

1
star
38

mla

CSS
1
star
39

lpcnet_benchmark

C
1
star
40

dotfiles

tmux, vim, bash
Vim Script
1
star
41

c-decl-parsec

Haskell
1
star
42

Utilities

Contains Python code for various simple and not-so-simple algorithms.
Python
1
star
43

isotonic.cpp

C++
1
star
44

DropboxChallenges

Python solutions for the Dropbox challenges
Python
1
star