コード例 #1
0
ファイル: orderbook.py プロジェクト: yanheven/tribler
    def __init__(self):
        super(OrderBook, self).__init__()

        self._logger = logging.getLogger(self.__class__.__name__)
        self._bids = Side()
        self._asks = Side()
        self.completed_orders = []
コード例 #2
0
    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()
コード例 #3
0
    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()
コード例 #4
0
ファイル: test_side.py プロジェクト: coldstacks/tribler
    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()