Additional unit-tests

This commit is contained in:
Reigo Reinmets
2021-12-09 20:03:41 +02:00
parent 28d0b5165a
commit 00366c5c88
2 changed files with 131 additions and 3 deletions

View File

@@ -577,8 +577,9 @@ class LocalTrade():
tmp_amount = temp_order.amount
if temp_order.filled is not None:
tmp_amount = temp_order.filled
total_amount += tmp_amount
total_stake += temp_order.average * tmp_amount
if tmp_amount is not None and temp_order.average is not None:
total_amount += tmp_amount
total_stake += temp_order.average * tmp_amount
if total_amount > 0:
self.open_rate = total_stake / total_amount
@@ -586,7 +587,7 @@ class LocalTrade():
self.amount = total_amount
self.fee_open_cost = self.fee_open * self.stake_amount
self.recalc_open_trade_value()
def select_order(self, order_side: str, is_open: Optional[bool]) -> Optional[Order]:
"""