All persistence margin tests pass
Flake8 compliant, passed mypy, ran isort .
This commit is contained in:
@@ -1,16 +1,20 @@
|
||||
from enum import Enum, auto
|
||||
from decimal import Decimal
|
||||
from enum import Enum
|
||||
|
||||
from freqtrade.exceptions import OperationalException
|
||||
|
||||
|
||||
one = Decimal(1.0)
|
||||
four = Decimal(4.0)
|
||||
twenty_four = Decimal(24.0)
|
||||
|
||||
|
||||
class InterestMode(Enum):
|
||||
"""Equations to calculate interest"""
|
||||
|
||||
HOURSPERDAY = "HOURSPERDAY"
|
||||
HOURSPER4 = "HOURSPER4" # Hours per 4 hour segment
|
||||
NONE = "NONE"
|
||||
|
||||
def __call__(self, *args, **kwargs):
|
||||
|
||||
@@ -21,4 +25,4 @@ class InterestMode(Enum):
|
||||
elif self.name == "HOURSPER4":
|
||||
return borrowed * rate * (1 + max(0, (hours-four)/four))
|
||||
else:
|
||||
raise OperationalException(f"Leverage not available on this exchange with freqtrade")
|
||||
raise OperationalException("Leverage not available on this exchange with freqtrade")
|
||||
|
Reference in New Issue
Block a user