From d24bb10c3cad1f144b76022481f46b4524873f4b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Isma=C3=ABl=20Bouya?= Date: Mon, 26 Feb 2018 12:07:07 +0100 Subject: Fix dust amount error --- portfolio.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'portfolio.py') diff --git a/portfolio.py b/portfolio.py index 43a39c4..0797de0 100644 --- a/portfolio.py +++ b/portfolio.py @@ -3,7 +3,7 @@ from datetime import datetime, timedelta from decimal import Decimal as D, ROUND_DOWN from json import JSONDecodeError from simplejson.errors import JSONDecodeError as SimpleJSONDecodeError -from ccxt import ExchangeError, ExchangeNotAvailable +from ccxt import ExchangeError, ExchangeNotAvailable, InvalidOrder import requests # FIXME: correctly handle web call timeouts @@ -532,7 +532,7 @@ class Order: else: try: self.results.append(self.market.ccxt.create_order(symbol, 'limit', self.action, amount, price=self.rate, account=self.account)) - except ExchangeNotAvailable: + except (ExchangeNotAvailable, InvalidOrder): # Impossible to honor the order (dust amount) self.status = "closed" self.mark_finished_order() -- cgit v1.2.3