Giter Club home page Giter Club logo

go-trader's Introduction

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...

There are two different web interfaces available:

  • the default interface at / uses Go templates and server side rendering
  • the alternative UI is written with Lit, and is available at /lit

Use npm run build in the web_lit directory to build the Lit assets.

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

go-trader's People

Contributors

robaho avatar swordkee avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.