updated mkdocs and leverage docs

Added tests for set_liquidation_price and set_stop_loss
updated params in interestmode enum
This commit is contained in:
Sam Germain
2021-07-12 19:39:35 -06:00
parent 256160740e
commit af8875574c
7 changed files with 169 additions and 80 deletions

View File

@@ -17,14 +17,12 @@ class InterestMode(Enum):
HOURSPER4 = "HOURSPER4" # Hours per 4 hour segment
NONE = "NONE"
def __call__(self, *args, **kwargs):
borrowed, rate, hours = kwargs["borrowed"], kwargs["rate"], kwargs["hours"]
def __call__(self, borrowed: Decimal, rate: Decimal, hours: Decimal):
if self.name == "HOURSPERDAY":
return borrowed * rate * ceil(hours)/twenty_four
elif self.name == "HOURSPER4":
# Probably rounded based on https://kraken-fees-calculator.github.io/
# Rounded based on https://kraken-fees-calculator.github.io/
return borrowed * rate * (1+ceil(hours/four))
else:
raise OperationalException("Leverage not available on this exchange with freqtrade")