X-Git-Url: https://git.immae.eu/?p=perso%2FImmae%2FProjets%2FCryptomonnaies%2FCryptoportfolio%2FTrader.git;a=blobdiff_plain;f=portfolio.py;h=c064249af992bcd46a9f5e41f47cd3c1c5fff724;hp=c313fd9067cae8e5624620b7a237001ce48082a4;hb=1902674cbeaa4dc0cdc31e6f0f7a548b3fa7f38e;hpb=52ea19aa73348a523b3b884e2a7fb749b2bf4f19 diff --git a/portfolio.py b/portfolio.py index c313fd9..c064249 100644 --- a/portfolio.py +++ b/portfolio.py @@ -578,12 +578,12 @@ class Order: self.fetch_mouvements() self.mark_disappeared_order() - + self.mark_dust_amount_remaining_order() self.mark_finished_order() - # FIXME: consider open order with dust remaining as closed - def dust_amount_remaining(self): - return self.remaining_amount() < Amount(self.amount.currency, D("0.001")) + def mark_dust_amount_remaining_order(self): + if self.market.ccxt.is_dust_trade(self.remaining_amount().value, self.rate): + self.status = "closed_dust_remaining" def remaining_amount(self): return self.amount - self.filled_amount()