add custom_exit_price in strategy interface

This commit is contained in:
axel 2021-08-04 19:09:55 -04:00
parent f9f519fd3c
commit f243ad4af0
1 changed files with 5 additions and 2 deletions

View File

@ -297,8 +297,9 @@ class IStrategy(ABC, HyperStrategyMixin):
"""
return proposed_rate
def custom_exit_price(self, pair: str, current_time: datetime, proposed_rate: float,
**kwargs) -> float:
def custom_exit_price(self, pair: str, trade: Trade,
current_time: datetime, proposed_rate: float,
current_rate: float, current_profit: float, **kwargs) -> float:
"""
Custom exit price logic, returning the new exit price.
@ -307,8 +308,10 @@ class IStrategy(ABC, HyperStrategyMixin):
When not implemented by a strategy, returns None, orderbook is used to set exit price
:param pair: Pair that's currently analyzed
:param trade: trade object.
:param current_time: datetime object, containing the current datetime
:param proposed_rate: Rate, calculated based on pricing settings in ask_strategy.
:param current_profit: Current profit (as ratio), calculated based on current_rate.
:param **kwargs: Ensure to keep this here so updates to this won't break your strategy.
:return float: New exit price value if provided
"""