Improve order filled handling

This commit is contained in:
Matthias 2022-06-13 13:24:27 +00:00
parent 848a5d85c6
commit d5fd1f9c38

View File

@ -74,7 +74,7 @@ class Order(_DECL_BASE):
@property @property
def safe_filled(self) -> float: def safe_filled(self) -> float:
return self.filled or self.amount or 0.0 return self.filled if self.filled is not None else self.amount or 0.0
@property @property
def safe_fee_base(self) -> float: def safe_fee_base(self) -> float:
@ -847,8 +847,6 @@ class LocalTrade():
tmp_amount = o.safe_amount_after_fee tmp_amount = o.safe_amount_after_fee
tmp_price = o.average or o.price tmp_price = o.average or o.price
if o.filled is not None:
tmp_amount = o.filled
if tmp_amount > 0.0 and tmp_price is not None: if tmp_amount > 0.0 and tmp_price is not None:
total_amount += tmp_amount total_amount += tmp_amount
total_stake += tmp_price * tmp_amount total_stake += tmp_price * tmp_amount