Test and document leverage strategy callback

This commit is contained in:
Matthias
2021-09-22 20:14:52 +02:00
parent c791b95405
commit 5928ba9c88
5 changed files with 83 additions and 20 deletions

View File

@@ -1,5 +1,6 @@
# pragma pylint: disable=missing-docstring, invalid-name, pointless-string-statement
from datetime import datetime
import talib.abstract as ta
from pandas import DataFrame
@@ -159,3 +160,11 @@ class StrategyTestV3(IStrategy):
# TODO-lev: Add short logic
return dataframe
def leverage(self, pair: str, current_time: datetime, current_rate: float,
proposed_leverage: float, max_leverage: float, side: str,
**kwargs) -> float:
# Return 3.0 in all cases.
# Bot-logic must make sure it's an allowed leverage and eventually adjust accordingly.
return 3.0