This commit is contained in:
hroff-1902 2019-06-27 01:03:38 +03:00
parent ca7080c2bb
commit 05d93cda16

View File

@ -478,8 +478,11 @@ class FreqtradeBot(object):
return order_amount return order_amount
# use fee from order-dict if possible # use fee from order-dict if possible
if 'fee' in order and order['fee'] and (order['fee'].keys() >= {'currency', 'cost'}): if 'fee' in order and order['fee'] is not None and \
if trade.pair.startswith(order['fee']['currency']): (order['fee'].keys() >= {'currency', 'cost'}):
if order['fee']['currency'] is not None and \
order['fee']['cost'] is not None and \
trade.pair.startswith(order['fee']['currency']):
new_amount = order_amount - order['fee']['cost'] new_amount = order_amount - order['fee']['cost']
logger.info("Applying fee on amount for %s (from %s to %s) from Order", logger.info("Applying fee on amount for %s (from %s to %s) from Order",
trade, order['amount'], new_amount) trade, order['amount'], new_amount)
@ -496,9 +499,12 @@ class FreqtradeBot(object):
fee_abs = 0 fee_abs = 0
for exectrade in trades: for exectrade in trades:
amount += exectrade['amount'] amount += exectrade['amount']
if "fee" in exectrade and (exectrade['fee'].keys() >= {'currency', 'cost'}): if "fee" in exectrade and exectrade['fee'] is not None and \
(exectrade['fee'].keys() >= {'currency', 'cost'}):
# only applies if fee is in quote currency! # only applies if fee is in quote currency!
if trade.pair.startswith(exectrade['fee']['currency']): if exectrade['fee']['currency'] is not None and \
exectrade['fee']['cost'] is not None and \
trade.pair.startswith(exectrade['fee']['currency']):
fee_abs += exectrade['fee']['cost'] fee_abs += exectrade['fee']['cost']
if amount != order_amount: if amount != order_amount: