Don't convert between the same currency

Mark Veidemanis 2 years ago
parent 3f855dfb59
commit 67404fc161
Signed by: m
GPG Key ID: 5ACFCEED46C0904F

@ -104,9 +104,12 @@ def get_trade_size_in_base(direction, account, strategy, cash_balance, base):
log.debug(f"Trade size: {amount_fiat}")
# Convert the trade size to the base currency
trade_size_in_base = to_currency(
direction, account, amount_fiat, account.currency, base
)
if account.currency.lower() == base.lower():
trade_size_in_base = amount_fiat
else:
trade_size_in_base = to_currency(
direction, account, amount_fiat, account.currency, base
)
log.debug(f"Trade size in base: {trade_size_in_base}")
return trade_size_in_base

Loading…
Cancel
Save