Merge branch 'freqtrade:develop' into fix-docs

This commit is contained in:
Stefano Ariestasia
2022-01-25 10:30:03 +09:00
committed by GitHub
21 changed files with 255 additions and 99 deletions

View File

@@ -594,18 +594,19 @@ class LocalTrade():
total_amount = 0.0
total_stake = 0.0
for temp_order in self.orders:
if (temp_order.ft_is_open or
(temp_order.ft_order_side != 'buy') or
(temp_order.status not in NON_OPEN_EXCHANGE_STATES)):
for o in self.orders:
if (o.ft_is_open or
(o.ft_order_side != 'buy') or
(o.status not in NON_OPEN_EXCHANGE_STATES)):
continue
tmp_amount = temp_order.amount
if temp_order.filled is not None:
tmp_amount = temp_order.filled
if tmp_amount > 0.0 and temp_order.average is not None:
tmp_amount = o.amount
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:
total_amount += tmp_amount
total_stake += temp_order.average * tmp_amount
total_stake += tmp_price * tmp_amount
if total_amount > 0:
self.open_rate = total_stake / total_amount