def __init__(self): super(OrderBook, self).__init__() self._logger = logging.getLogger(self.__class__.__name__) self._bids = Side() self._asks = Side() self.completed_orders = []
def __init__(self, message_repository): super(OrderBook, self).__init__() self._logger = logging.getLogger(self.__class__.__name__) assert isinstance(message_repository, MessageRepository), type(message_repository) self.message_repository = message_repository self._bids = Side() self._asks = Side()
def setUp(self): # Object creation self.tick = Tick(OrderId(TraderId('0'), OrderNumber(1)), AssetPair(AssetAmount(60, 'BTC'), AssetAmount(30, 'MB')), Timeout(100), Timestamp.now(), True) self.tick2 = Tick(OrderId(TraderId('1'), OrderNumber(2)), AssetPair(AssetAmount(120, 'BTC'), AssetAmount(30, 'MB')), Timeout(100), Timestamp.now(), True) self.side = Side()
def setUp(self): # Object creation self.tick = Tick(OrderId(TraderId('0'), OrderNumber(1)), Price(400, 'BTC'), Quantity(30, 'MC'), Timeout(float("inf")), Timestamp(float("inf")), True) self.tick2 = Tick(OrderId(TraderId('1'), OrderNumber(2)), Price(800, 'BTC'), Quantity(30, 'MC'), Timeout(float("inf")), Timestamp(float("inf")), True) self.side = Side()