Giter VIP home page Giter VIP logo

orderbook's Introduction

OrderBook

OrderBook Simulator with Limit and Iceberg functionality

Design

Proof of concept of a Limit Order Book (LOB) where the bid and ask order books are implemented as separate trees. Inspired by the [Limit Book] blog post by Selph where limit levels are stored as nodes inside the trees and each node is a doubly-linked list of orders, sorted chronologically.

Structure

  • Source code stored under orderbook/src/
  • Tests stored under test/

Install

  • python setup.py install

Run

  • runner.py < data/ordersSimple.dat

Test

  • Single: python -m unittest test.testPriceTree
  • All: python -m unittest discover

Notes

  • An order book is an electronic list of buy and sell orders for a security or other instrument organized by price level
  • Order books are used by almost every exchange for various assets like stocks, bonds, currencies, and even cryptocurrencies
  • These lists help improve market transparency as they provide information on price, availability, depth of trade, and who initiates transactions
  • There are three parts to an order book: buy orders, sell orders, and order history
  • => A limit order to sell is called an "ask".
  • Iceberg order is a conditional request made to the broker/system to buy or sell a large required quantity of stock, but in smaller predetermined quantity

Best practices

  • Separate the intentions of a trading model–such as “place limit orders at $10.15 and $10.10″ from the resulting actual positions
  • The data structure chosen to represent the limit order book will be the primary source of market information

References

orderbook's People

Contributors

pgaref avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

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