From f243ad4af0b8b1a5e8350db05f0717b16734bd27 Mon Sep 17 00:00:00 2001 From: axel Date: Wed, 4 Aug 2021 19:09:55 -0400 Subject: [PATCH] add custom_exit_price in strategy interface --- freqtrade/strategy/interface.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/freqtrade/strategy/interface.py b/freqtrade/strategy/interface.py index e1aba7d7a..f7d0a0aae 100644 --- a/freqtrade/strategy/interface.py +++ b/freqtrade/strategy/interface.py @@ -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 """