Don't convert between the same currency

This commit is contained in:
Mark Veidemanis 2022-11-11 07:20:00 +00:00
parent 3f855dfb59
commit 67404fc161
Signed by: m
GPG Key ID: 5ACFCEED46C0904F
1 changed files with 6 additions and 3 deletions

View File

@ -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