Source code for mlthon.order.books.price_level
from mlthon.basics.defs import Side
from mlthon.basics.price import Price
from mlthon.basics.qty import Qty
[docs]class PriceLevel(object):
def __init__(self, side: Side, price: Price, qty: Qty):
self._side_ = side
self._price_ = price
self._qty_ = qty
[docs] def get_side(self) -> Side:
return self._side_
[docs] def get_price(self) -> Price:
return self._price_
[docs] def get_qty(self) -> Qty:
return self._qty_
[docs] def update_qty(self, new_qty: Qty):
self._qty_ = new_qty
def __str__(self):
return self._side_.name + " " + str(self._qty_) + " @ " + str(self._price_)