• Stars
    star
    371
  • Rank 115,103 (Top 3 %)
  • Language
    Go
  • License
    GNU General Publi...
  • Created over 6 years ago
  • Updated 4 months ago

Reviews

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

Repository Details

financial exchange written in Go, designed for algorithmic trading tests

go-trader

A financial exchange written in Go including complete order book, fix protocol, and market data distribution.

Uses quickfixgo or gRPC for client/server communication.

Uses UDP multicast for market distribution.

It uses the high-performance fixed point library fixed.

There is a sample client with a command line GUI, a sample "market maker", and a sample "playback".

The exchange itself has a bare bones web interface, that uses web sockets to provide real-time book updates.

The exchange is designed to allow for easy back-testing of trading strategies. It supports limit and market orders.

There is a very simple sample "algo". The program structure is applicable to many strategies that use an entry and exit price. This can be run in conjunction with the 'marketmaker' sample to test the "algo". Hint: it has a 50/50 chance of being successful EXCEPT the market maker bid/ask spread must be accounted for - which makes it far less than a 50/50 chance of being profitable...

It was primarily developed to further my knowledge of Go and test its suitability for high-performance financial applications.

install

go get github.com/robaho/go-trader

build

go install github.com/robaho/go-trader/cmd/exchange

go install github.com/robaho/go-trader/cmd/client

go install github.com/robaho/go-trader/cmd/marketmaker

go install github.com/robaho/go-trader/cmd/playback

run

cd $GOPATH/src/github.com/robaho/go-trader/cmd

exchange &

marketmaker -symbol IBM

client

performance

Using the quickfixgo connector:

  • test machine is a 3.4 ghz i7 (4 core,8 thread), running osx
  • clients and exchange process are running on the same machine
  • a quote is a double-sided (bid & ask)
  • a timing is measured from the quote message generation to the reception of the multicast market data

1 market maker can perform 6k round-trip quotes/sec

4 market makers can perform 16k round-trip quotes/sec

Using the gRPC connector:

1 market maker can perform 12k round-trip quotes/sec

4 market makers can perform 30k round-trip quotes/sec

REST api

access full book (use guest/password to login)

localhost:8080/api/book/SYMBOL

localhost:8080/api/stats/SYMBOL

screen shots

client screen shot web screen shot

More Repositories

1

seashore

easy to use mac osx image editing application for the rest of us
Objective-C
445
star
2

fixed

high performance fixed decimal place math library for Go
Go
312
star
3

keydb

high performance key value database written in Go. Deprecated. Use robaho/leveldb
Go
85
star
4

goanalyzer

improved go tool trace goroutine analysis
Go
31
star
5

go-concurrency-test

Test the performance of Go's concurrency structures
Go
28
star
6

leveldb

high performance key-value database written in Go. Based on Google LevelDB api.
Go
15
star
7

lrmp

Go and Java implementations of LRMP - light weight reliable multicast protocol
Java
10
star
8

keydbr

remote protocol layer for keydb using gRPC. deprecated. use robaho/leveldbr
Go
8
star
9

httpserver

a lightweight zero dependency JDK http server implementation designed for embedding and optimized for virtual threads
Java
8
star
10

leveldbr

remote access to robaho/leveldb databases
Go
7
star
11

jnatsd

Java port of message broker service gnatsd from nats.io
Java
4
star
12

jkeydb

Java version of keydb. Deprecated. Use robaho/jleveldb
Java
3
star
13

closablequeue

a Java FIFO blocking queue with "close" semantics. designed for virtual threads.
Java
2
star
14

generators

Java
1
star
15

scope_trace

Java
1
star
16

timingattack

Go
1
star
17

WifiHotspotWidget

Java
1
star
18

go-network-test

compare relative performance of go networking to Java and C
C
1
star
19

cpp_orderbook

a financial exchange in C++
C++
1
star
20

cpp_leveldb

A port of the ultra-high-performance robaho key-value database using modern C++.
C++
1
star
21

cpp_fixed

C++
1
star
22

bmw_radio

custom iBus radio for BMWs with iPod and HD-Radio support
C++
1
star
23

jleveldb

Java version of Google's leveldb based on the original implementation of robaho/jkeydb
Java
1
star
24

helidon_test

Java
1
star
25

vthread_test

Java
1
star
26

SmartShareToCalendar

android app where you can share text, messages, emails, etc. and automatically create calendar events
Java
1
star
27

OSSRH-96597

1
star