Order book

Order book implementation.

Matching engine

Order book matching engine.

Created on Apr 28, 2013

class oxberrypis.orderbook.matching_engine.MatchingEngine(callback=None)[source]

Matching engine.

Main class for processing each individual stock, it implements rules and logic of stock exchange and maintains orders in correct order. It allows adding, changing, and removing orders.

The book

Order book implementation.

Created on Apr 28, 2013

class oxberrypis.orderbook.book.OrderBook[source]

Order book.

Keeps order in either demand or supply for single stock.

Order

Order implementation.

Created on Apr 28, 2013

Internal data structures

Fibonacci heap

Fibonacci Heap implementation.

Fibonacci heaps are especially desirable when the number of extract_min and delete operations is small relative to the number of other operations performed.

class oxberrypis.orderbook.fibonacci_heap.FibonacciHeap[source]

Fibonacci heap.

decrease_key(node, new_key)[source]

Decrease node’s key.

extract()[source]

Extract minimum node from the heap.

front()[source]

Returns minimum node from the heap.

insert(key, data)[source]

Insert a pair of key and data into the heap.

is_empty()[source]

Check if the heap is empty.

class oxberrypis.orderbook.fibonacci_heap.FibonacciHeapNode(key, data)[source]

Fibonacci heap node.

Linked list

Linked lists implementation.

Created on Apr 28, 2013

class oxberrypis.orderbook.linked_list.LinkedList[source]

Double linked list.

Implementation of double linked list, which is used for keeping orders at one prize. Ii allows adding a data at the end, removing node by pointer, getting and extracting first element, and check for empty.

class oxberrypis.orderbook.linked_list.LinkedListNode(data)[source]

Node in a double linked list.

Table Of Contents

Previous topic

Parsing

Next topic

Visualisation

This Page