GithubHelp home page GithubHelp logo

pylimitbook's Introduction

PyLimitBook

PyLimitBook is an implementation of a fast limit-order book for level-2 US equities data writen in Python. It includes some tools to output sampled data as well as a curses-based application to view the book and move forward or backward in time.

Input files must be for a single day, symbol, and exchange.

This code is aimed at other developers looking for a limit-book implementation to include in their own trading projects.

Requirements

  • Python libraries bintrees (v0.4 used) and pandas.
  • curses and cPickle libraries are also used, but are often installed by default.
  • This code has thus far only been tested on Ubuntu Linux with Python 2.7.2.

Input Data Format

PyLimitBook applications expect the following input format (in a CSV file):

  • bids:

    B,<symbol>,<exchange>,<id>,<quantity>,<price>,<timestamp>

  • asks:

    A,<symbol>,<exchange>,<id>,<quantity>,<price>,<timestamp>

  • trades: (optional)

    T,<symbol>,<exchange>,<quantity>,<price>,<timestamp>

Symbol and exchange values are currently unimportant and can be dummy values. Lines should be in timestamp-order from earliest to latest (the order it is sent by the exchange).

Application Descriptions

  • parse.py - Simple illustration of using the limit book
  • tseries.py - Parse an input file and export 1-second snapshots of the book (Uses pandas library to fill in gaps, etc)
  • convert.py - Convert from an input format that uses ', ' as a CSV separator and different column order to the correct input format.
  • bookViewer.py - Graphically view the book state at any point in time

BookViewer Screenshot

Known Issues

  • There are some resize issues when using bookViewer.py in a (uselessly) small terminal.

pylimitbook's People

Contributors

danielktaylor avatar

Watchers

 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.