Verify if fee for this side has been updated
This commit is contained in:
@@ -1174,7 +1174,7 @@ class FreqtradeBot:
|
||||
if order_amount is None:
|
||||
order_amount = order['amount']
|
||||
# Only run for closed orders
|
||||
if trade.fee_open_currency is not None or order['status'] == 'open':
|
||||
if trade.fee_updated(order['side']) or order['status'] == 'open':
|
||||
return order_amount
|
||||
|
||||
trade_base_currency = self.exchange.get_pair_base_currency(trade.pair)
|
||||
|
@@ -394,6 +394,15 @@ class Trade(_DECL_BASE):
|
||||
if fee_rate is not None:
|
||||
self.fee_close = fee_rate
|
||||
|
||||
def fee_updated(self, side: str) -> bool:
|
||||
"""
|
||||
Verify if this side (buy / sell) has already been updated
|
||||
"""
|
||||
if side == 'buy':
|
||||
return self.fee_open_currency is not None
|
||||
elif side == 'sell':
|
||||
return self.fee_close_currency is not None
|
||||
|
||||
def _calc_open_trade_price(self) -> float:
|
||||
"""
|
||||
Calculate the open_rate including open_fee.
|
||||
|
Reference in New Issue
Block a user