X-Git-Url: https://git.immae.eu/?p=perso%2FImmae%2FProjets%2FCryptomonnaies%2FCryptoportfolio%2FTrader.git;a=blobdiff_plain;f=portfolio.py;h=0797de0a0489542ce02c20863625d33a2bb3eab8;hp=43a39c4506c7caa6ba6fdbea4f48c5c6c10e4397;hb=d24bb10c3cad1f144b76022481f46b4524873f4b;hpb=516a2517aa428596199e56cc105c7b0132064ade 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()