All Projects → chronoxor → Cpptrader

chronoxor / Cpptrader

Licence: mit
High performance components for building Trading Platform such as ultra fast matching engine, order book processor

Projects that are alternatives of or similar to Cpptrader

Babl
Low-latency WebSocket Server
Stars: ✭ 37 (-87.99%)
Mutual labels:  performance, low-latency
Netcoreserver
Ultra fast and low latency asynchronous socket server & client C# .NET Core library with support TCP, SSL, UDP, HTTP, HTTPS, WebSocket protocols and 10K connections problem solution
Stars: ✭ 799 (+159.42%)
Mutual labels:  performance, low-latency
Fastbinaryencoding
Fast Binary Encoding is ultra fast and universal serialization solution for C++, C#, Go, Java, JavaScript, Kotlin, Python, Ruby, Swift
Stars: ✭ 421 (+36.69%)
Mutual labels:  performance, low-latency
Directory
General information about the Open Markets Initiative
Stars: ✭ 31 (-89.94%)
Mutual labels:  trading, low-latency
Roq Api
API for algorithmic and high-frequency trading
Stars: ✭ 132 (-57.14%)
Mutual labels:  trading, low-latency
Xpedite
A non-sampling profiler purpose built to measure and optimize performance of ultra low latency/real time systems
Stars: ✭ 89 (-71.1%)
Mutual labels:  performance, low-latency
Cppserver
Ultra fast and low latency asynchronous socket server & client C++ library with support TCP, SSL, UDP, HTTP, HTTPS, WebSocket protocols and 10K connections problem solution
Stars: ✭ 528 (+71.43%)
Mutual labels:  performance, low-latency
Chronicle Queue
Micro second messaging that stores everything to disk
Stars: ✭ 2,489 (+708.12%)
Mutual labels:  performance, low-latency
Interactivebrokers Algo System
Java/MySQL live algorithmic trading using Interactive Brokers API
Stars: ✭ 151 (-50.97%)
Mutual labels:  trading, low-latency
roq-samples
How to use the Roq C++20 API for Live Cryptocurrency Algorithmic and High-Frequency Trading as well as for Back-Testing and Historical Simulation
Stars: ✭ 119 (-61.36%)
Mutual labels:  trading, low-latency
Pyroscope
Continuous Profiling Platform! Debug performance issues down to a single line of code
Stars: ✭ 4,816 (+1463.64%)
Mutual labels:  performance
Stagesepx
detect stages in video automatically
Stars: ✭ 293 (-4.87%)
Mutual labels:  performance
Hint
💡 A hinting engine for the web
Stars: ✭ 3,280 (+964.94%)
Mutual labels:  performance
Waterdrop
💧Waterdrop is a high performance micro service framework. Waterdrop comes from (The Three Body Problem).
Stars: ✭ 305 (-0.97%)
Mutual labels:  performance
Webpack Libs Optimizations
Using a library in your webpack project? Here’s how to optimize it
Stars: ✭ 3,187 (+934.74%)
Mutual labels:  performance
React Native Performance
Monitor and measure React Native performance
Stars: ✭ 269 (-12.66%)
Mutual labels:  performance
Minit
A WordPress plugin to combine CSS and Javascript files.
Stars: ✭ 293 (-4.87%)
Mutual labels:  performance
Laravel Varnish
Making Varnish and Laravel play nice together
Stars: ✭ 291 (-5.52%)
Mutual labels:  performance
Linux Network Performance Parameters
Learn where some of the network sysctl variables fit into the Linux/Kernel network flow
Stars: ✭ 3,112 (+910.39%)
Mutual labels:  performance
Wipe Modules
🗑️ Easily remove the node_modules folder of non-active projects
Stars: ✭ 304 (-1.3%)
Mutual labels:  performance

CppTrader

Linux build status OSX build status Cygwin build status MSYS2 build status MinGW build status Windows build status

C++ Trader is a set of components for building high performance Trading Platform:

  • Ultra fast matching engine
  • Order book processor
  • NASDAQ ITCH handler

CppTrader API reference

Contents

Features

  • Cross platform (Linux, OSX, Windows)
  • Benchmarks
  • Examples
  • Tests
  • Doxygen API documentation
  • Continuous integration (Travis CI, AppVeyor)

Requirements

Optional:

How to build?

Install gil (git links) tool

pip3 install gil

Setup repository

git clone https://github.com/chronoxor/CppTrader.git
cd CppTrader
gil update

Linux

cd build
./unix.sh

OSX

cd build
./unix.sh

Windows (Cygwin)

cd build
unix.bat

Windows (MSYS2)

cd build
unix.bat

Windows (MinGW)

cd build
mingw.bat

Windows (Visual Studio)

cd build
vs.bat

Performance

Here comes several micro-benchmarks for trading components.

Benchmark environment is the following:

CPU architecutre: Intel(R) Core(TM) i7-4790K CPU @ 4.00GHz
CPU logical cores: 8
CPU physical cores: 4
CPU clock speed: 3.998 GHz
CPU Hyper-Threading: enabled
RAM total: 31.962 GiB
RAM free: 21.623 GiB

OS version: Microsoft Windows 8 Enterprise Edition (build 9200), 64-bit
OS bits: 64-bit
Process bits: 64-bit
Process configuaraion: release

NASDAQ ITCH handler

Benchmark measures the performance of the NASDAQ ITCH handler. It shows how fast it can parse and handle ITCH messages from the input stream.

Sample ITCH file could be downloaded from ftp://emi.nasdaq.com/ITCH

ITCH processing...Done!

Errors: 0

Processing time: 6.831 s
Total ITCH messages: 283238832
ITCH message latency: 24 ns
ITCH message throughput: 41460256 msg/s

Market manager

Benchmark measures the performance of the Market manager. It shows how fast it can handle orders operations (add, reduce, modify, delete, execute) and build an order book.

Sample ITCH file could be downloaded from ftp://emi.nasdaq.com/ITCH

ITCH processing...Done!

Errors: 0

Processing time: 1:27.616 m
Total ITCH messages: 283238832
ITCH message latency: 309 ns
ITCH message throughput: 3232727 msg/s
Total market updates: 631217516
Market update latency: 138 ns
Market update throughput: 7204359 upd/s

Market statistics:
Max symbols: 8371
Max order books: 8371
Max order book levels: 2422
Max order book orders: 2975
Max orders: 1647972

Order statistics:
Add order operations: 152865456
Update order operations: 7037619
Delete order operations: 152865456
Execute order operations: 5663712

Market manager (optimized version)

This is an optimized version of the Market manager. Optimization tricks are the following:

  • Symbols and order books are stored in fixed size pre-allocated arrays.
  • Orders are stored in the pre-allocated array instead of HashMap. This gives O(1) for all orders operations with no overhead (get, insert, update, delete).
  • Orders linked list is not maintained for price levels, just orders count.
  • Price levels are stored in sorted arrays instead of Red-Black trees. The sort order keeps best prices (best bid / best ask) at the end of arrays which gives good CPU cache locality and near to O(1) search time for orders with close to market prices, but has a penalty for orders with far from market prices!
  • Price levels are taken from the pool, which is implemented using a pre-allocated array with O(1) for create and delete each price level.

Sample ITCH file could be downloaded from ftp://emi.nasdaq.com/ITCH

ITCH processing...Done!

Errors: 0

Processing time: 34.150 s
Total ITCH messages: 283238832
ITCH message latency: 120 ns
ITCH message throughput: 8293747 msg/s
Total market updates: 631217516
Market update latency: 54 ns
Market update throughput: 18483195 upd/s

Market statistics:
Max symbols: 8371
Max order books: 8371
Max order book levels: 38
Max orders: 1647972

Order statistics:
Add order operations: 152865456
Update order operations: 7037619
Delete order operations: 152865456
Execute order operations: 5663712

Market manager (aggressive optimized version)

This is a very aggressive optimized version of the Market manager. It shows values of latency and throughput close to optimal with the cost of some more optimization tricks which might be hard to keep in real trading platforms:

  • Symbols are not maintained
  • Orders and price limits structures are optimized to be optimal. Most of useful filds are removed.
  • Price values are stored as signed 32-bit integer values. Positive values for bids and negative values for asks.
  • Market handler is not used. No way to receive notifications from the Market manager.

Sample ITCH file could be downloaded from ftp://emi.nasdaq.com/ITCH

ITCH processing...Done!

Errors: 0
Processing time: 29.047 s
Total ITCH messages: 283238832
ITCH messages latency: 102 ns
ITCH messages throughput: 9751044 msg/s
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].