Added tests for interest_function

This commit is contained in:
Sam Germain
2021-08-09 00:00:50 -06:00
parent 8e941e6836
commit 06206335d9
2 changed files with 67 additions and 29 deletions

View File

@@ -15,20 +15,19 @@ def interest(
rate: Decimal,
hours: Decimal
) -> Decimal:
"""Equation to calculate interest on margin trades
"""
Equation to calculate interest on margin trades
:param exchange_name: The exchanged being trading on
:param borrowed: The amount of currency being borrowed
:param rate: The rate of interest
:param hours: The time in hours that the currency has been borrowed for
:param exchange_name: The exchanged being trading on
:param borrowed: The amount of currency being borrowed
:param rate: The rate of interest
:param hours: The time in hours that the currency has been borrowed for
Raises:
OperationalException: Raised if freqtrade does
not support margin trading for this exchange
Returns: The amount of interest owed (currency matches borrowed)
Raises:
OperationalException: Raised if freqtrade does
not support margin trading for this exchange
Returns: The amount of interest owed (currency matches borrowed)
"""
exchange_name = exchange_name.lower()
if exchange_name == "binance":