MLThon Order Book Package¶
Submodules¶
mlthon.order.books.book_utils module¶
mlthon.order.books.level module¶
mlthon.order.books.level_book module¶
- class LevelBook[source]¶
Bases:
object
- add_lvl(id, side, price, qty)[source]¶
Add level to level book. Bid ask levels are SortedDicts to maintain order of prices. Two levels with same price are not allowed :param id: level id :param side: order side :param price: order price :param qty: order quantity :return:
- get_best_ask_level_with_aggregate_quantity(qty)[source]¶
Get best ask level at which aggregate quantity is reached :param qty: Aggregate quantity :return:
- get_best_bid_level_with_aggregate_quantity(qty)[source]¶
Get best bid level at which aggregate quantity is reached :param qty: Aggregate quantity :return:
- get_top_five_ask_lvls()[source]¶
Get best five ask levels. Check if best levels have updated since last time. Used to trigger BBO events :return:
- get_top_five_bid_lvls()[source]¶
Get best five bid levels. Check if best levels have updated since last time. Used to trigger BBO events :return: