Fix a case where the amount was not recalculated. Added additional temporary logging.

This commit is contained in:
Reigo Reinmets
2021-12-16 22:57:56 +02:00
parent 337af44901
commit 462270bc5a
4 changed files with 40 additions and 11 deletions

View File

@@ -160,6 +160,10 @@ class StrategyTestV2(IStrategy):
current_rate: float, current_profit: float, **kwargs):
if current_profit < -0.0075:
for order in trade.orders:
if order.ft_is_open:
return None
return self.wallets.get_trade_stake_amount(pair, None)
return None

View File

@@ -1563,7 +1563,7 @@ def test_recalc_trade_from_orders_ignores_bad_orders(fee):
side="buy",
price=1,
average=2,
filled=3,
filled=0,
remaining=4,
cost=5,
order_date=arrow.utcnow().shift(hours=-1).datetime,
@@ -1590,7 +1590,7 @@ def test_recalc_trade_from_orders_ignores_bad_orders(fee):
side="buy",
price=1,
average=2,
filled=3,
filled=0,
remaining=4,
cost=5,
order_date=arrow.utcnow().shift(hours=-1).datetime,