From 1902674cbeaa4dc0cdc31e6f0f7a548b3fa7f38e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Isma=C3=ABl=20Bouya?= Date: Tue, 1 May 2018 16:02:00 +0200 Subject: =?UTF-8?q?Don=E2=80=99t=20close=20dust=20remaining=20orders=20bef?= =?UTF-8?q?ore=20end=20of=20trade.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes https://git.immae.eu/mantisbt/view.php?id=41 --- ccxt_wrapper.py | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'ccxt_wrapper.py') diff --git a/ccxt_wrapper.py b/ccxt_wrapper.py index f30c7d2..c4aa94d 100644 --- a/ccxt_wrapper.py +++ b/ccxt_wrapper.py @@ -66,6 +66,13 @@ class poloniexE(poloniex): def nanoseconds(): return int(time.time() * 1000000000) + def is_dust_trade(self, amount, rate): + if abs(amount) < decimal.Decimal("0.000001"): + return True + if abs(amount * rate) < decimal.Decimal("0.0001"): + return True + return False + def fetch_margin_balance(self): """ portfolio.market.privatePostGetMarginPosition({"currencyPair": "BTC_DASH"}) -- cgit v1.2.3