From 1970cc65c05eca5a7cd73ecccdb622110024c72e Mon Sep 17 00:00:00 2001 From: Matthias Date: Thu, 20 Feb 2025 07:04:59 +0100 Subject: [PATCH] feat: add "is_entry" attribute for order_replacement --- freqtrade/strategy/interface.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/freqtrade/strategy/interface.py b/freqtrade/strategy/interface.py index d43057b32..69ae94917 100644 --- a/freqtrade/strategy/interface.py +++ b/freqtrade/strategy/interface.py @@ -737,6 +737,7 @@ class IStrategy(ABC, HyperStrategyMixin): current_order_rate: float, entry_tag: str | None, side: str, + is_entry: bool, **kwargs, ) -> float: """ @@ -758,11 +759,12 @@ class IStrategy(ABC, HyperStrategyMixin): :param current_order_rate: Rate of the existing order in place. :param entry_tag: Optional entry_tag (buy_tag) if provided with the buy signal. :param side: 'long' or 'short' - indicating the direction of the proposed trade + :param is_entry: True if the order is an entry order, False if it's an exit order. :param **kwargs: Ensure to keep this here so updates to this won't break your strategy. :return float: New entry price value if provided """ - if order.side == trade.entry_side: + if is_entry: return self.adjust_entry_price( trade=trade, order=order,