diff options
author | Ismaël Bouya <ismael.bouya@normalesup.org> | 2018-02-26 12:07:07 +0100 |
---|---|---|
committer | Ismaël Bouya <ismael.bouya@normalesup.org> | 2018-02-26 12:07:07 +0100 |
commit | d24bb10c3cad1f144b76022481f46b4524873f4b (patch) | |
tree | ee08dfb7118ea9a5af311250b036c067b9277ef4 /portfolio.py | |
parent | 516a2517aa428596199e56cc105c7b0132064ade (diff) | |
download | Trader-d24bb10c3cad1f144b76022481f46b4524873f4b.tar.gz Trader-d24bb10c3cad1f144b76022481f46b4524873f4b.tar.zst Trader-d24bb10c3cad1f144b76022481f46b4524873f4b.zip |
Fix dust amount error
Diffstat (limited to 'portfolio.py')
-rw-r--r-- | portfolio.py | 4 |
1 files changed, 2 insertions, 2 deletions
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 | |||
3 | from decimal import Decimal as D, ROUND_DOWN | 3 | from decimal import Decimal as D, ROUND_DOWN |
4 | from json import JSONDecodeError | 4 | from json import JSONDecodeError |
5 | from simplejson.errors import JSONDecodeError as SimpleJSONDecodeError | 5 | from simplejson.errors import JSONDecodeError as SimpleJSONDecodeError |
6 | from ccxt import ExchangeError, ExchangeNotAvailable | 6 | from ccxt import ExchangeError, ExchangeNotAvailable, InvalidOrder |
7 | import requests | 7 | import requests |
8 | 8 | ||
9 | # FIXME: correctly handle web call timeouts | 9 | # FIXME: correctly handle web call timeouts |
@@ -532,7 +532,7 @@ class Order: | |||
532 | else: | 532 | else: |
533 | try: | 533 | try: |
534 | self.results.append(self.market.ccxt.create_order(symbol, 'limit', self.action, amount, price=self.rate, account=self.account)) | 534 | self.results.append(self.market.ccxt.create_order(symbol, 'limit', self.action, amount, price=self.rate, account=self.account)) |
535 | except ExchangeNotAvailable: | 535 | except (ExchangeNotAvailable, InvalidOrder): |
536 | # Impossible to honor the order (dust amount) | 536 | # Impossible to honor the order (dust amount) |
537 | self.status = "closed" | 537 | self.status = "closed" |
538 | self.mark_finished_order() | 538 | self.mark_finished_order() |