Skip to main content

Limit Order Book Trading Engine

Project description

OrderBook
=========

Matching engine based on a limit order book written in Python.

Features:
* Standard price-time priority
* Supports both market and limit orders
* Add, cancel, update orders

Requirements:
* bintrees

Key Functions
=============

process_order

cancel_order

modify_order

get_volume_at_price

get_best_bid

get_best_ask

Data Structure
==============

Orders are sent to the order book using the process_order function. The Order is created using a quote.

```python
# For a limit order
quote = {'type' : 'limit',
'side' : 'bid',
'quantity' : 6,
'price' : 108.2,
'trade_id' : 001}

# and for a market order:
quote = {'type' : 'market',
'side' : 'ask',
'quantity' : 6,
'trade_id' : 002}
```

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

OrderBook-0.1.1.tar.gz (6.3 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page