@property
def finished(self):
- return self.status == "closed" or self.status == "canceled"
+ return self.status == "closed" or self.status == "canceled" or self.status == "error"
def run(self, debug=False):
symbol = "{}/{}".format(self.amount.currency, self.base_currency)
try:
self.result = self.market.create_order(symbol, 'limit', self.action, amount, price=self.rate)
self.status = "open"
- except Exception:
- pass
+ except Exception as e:
+ self.status = "error"
+ print("error when running market.create_order('{}', 'limit', '{}', {}, price={})".format(
+ symbol, self.action, amount, self.rate))
+ self.error_message = str("{}: {}".format(e.__class__.__name__, e))
+ print(self.error_message)
def get_status(self):
# other states are "closed" and "canceled"