add custom_exit_price in strategy interface
This commit is contained in:
parent
f9f519fd3c
commit
f243ad4af0
@ -297,8 +297,9 @@ class IStrategy(ABC, HyperStrategyMixin):
|
|||||||
"""
|
"""
|
||||||
return proposed_rate
|
return proposed_rate
|
||||||
|
|
||||||
def custom_exit_price(self, pair: str, current_time: datetime, proposed_rate: float,
|
def custom_exit_price(self, pair: str, trade: Trade,
|
||||||
**kwargs) -> float:
|
current_time: datetime, proposed_rate: float,
|
||||||
|
current_rate: float, current_profit: float, **kwargs) -> float:
|
||||||
"""
|
"""
|
||||||
Custom exit price logic, returning the new exit price.
|
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
|
When not implemented by a strategy, returns None, orderbook is used to set exit price
|
||||||
|
|
||||||
:param pair: Pair that's currently analyzed
|
:param pair: Pair that's currently analyzed
|
||||||
|
:param trade: trade object.
|
||||||
:param current_time: datetime object, containing the current datetime
|
:param current_time: datetime object, containing the current datetime
|
||||||
:param proposed_rate: Rate, calculated based on pricing settings in ask_strategy.
|
: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.
|
:param **kwargs: Ensure to keep this here so updates to this won't break your strategy.
|
||||||
:return float: New exit price value if provided
|
:return float: New exit price value if provided
|
||||||
"""
|
"""
|
||||||
|
Loading…
Reference in New Issue
Block a user