def _buildOrder(self, price, amount): jsonDict = { 'id': self.__nextOrderId, 'datetime': str(datetime.datetime.now()), 'type': 0 if amount > 0 else 1, 'price': str(price), 'amount': str(abs(amount)), } self.__nextOrderId += 1 return httpclient.Order(jsonDict)
def getOpenOrders(self): return [httpclient.Order(jsonDict) for jsonDict in self.__openOrders]