diff options
author | Ismaël Bouya <ismael.bouya@normalesup.org> | 2018-05-01 16:02:00 +0200 |
---|---|---|
committer | Ismaël Bouya <ismael.bouya@normalesup.org> | 2018-05-01 16:02:00 +0200 |
commit | 1902674cbeaa4dc0cdc31e6f0f7a548b3fa7f38e (patch) | |
tree | 8773f0fbba805f0e4f76fb742da766b4f1a56073 /ccxt_wrapper.py | |
parent | 52ea19aa73348a523b3b884e2a7fb749b2bf4f19 (diff) | |
download | Trader-1902674cbeaa4dc0cdc31e6f0f7a548b3fa7f38e.tar.gz Trader-1902674cbeaa4dc0cdc31e6f0f7a548b3fa7f38e.tar.zst Trader-1902674cbeaa4dc0cdc31e6f0f7a548b3fa7f38e.zip |
Don’t close dust remaining orders before end of trade.
Fixes https://git.immae.eu/mantisbt/view.php?id=41
Diffstat (limited to 'ccxt_wrapper.py')
-rw-r--r-- | ccxt_wrapper.py | 7 |
1 files changed, 7 insertions, 0 deletions
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): | |||
66 | def nanoseconds(): | 66 | def nanoseconds(): |
67 | return int(time.time() * 1000000000) | 67 | return int(time.time() * 1000000000) |
68 | 68 | ||
69 | def is_dust_trade(self, amount, rate): | ||
70 | if abs(amount) < decimal.Decimal("0.000001"): | ||
71 | return True | ||
72 | if abs(amount * rate) < decimal.Decimal("0.0001"): | ||
73 | return True | ||
74 | return False | ||
75 | |||
69 | def fetch_margin_balance(self): | 76 | def fetch_margin_balance(self): |
70 | """ | 77 | """ |
71 | portfolio.market.privatePostGetMarginPosition({"currencyPair": "BTC_DASH"}) | 78 | portfolio.market.privatePostGetMarginPosition({"currencyPair": "BTC_DASH"}) |