@ -52,6 +52,8 @@ def to_currency(direction, account, amount, from_currency, to_currency):
:param to_currency: Currency to convert to
:return: Converted amount
"""
inverted = False
# This is needed because OANDA has different values for bid and ask
if direction == "buy":
price_index = "bids"