diff --git a/freqtrade/strategy/strategy_wrapper.py b/freqtrade/strategy/strategy_wrapper.py index 9250f54cd..25d44fae7 100644 --- a/freqtrade/strategy/strategy_wrapper.py +++ b/freqtrade/strategy/strategy_wrapper.py @@ -23,9 +23,11 @@ def strategy_safe_wrapper(f: F, message: str = "", default_retval=None, supress_ @wraps(f) def wrapper(*args, **kwargs): try: - if "trade" in kwargs: - # Protect accidental modifications from within the strategy - kwargs["trade"] = deepcopy(kwargs["trade"]) + if not (getattr(f, "__qualname__", "")).startswith("IStrategy."): + # Don't deep-copy if the function is not implemented in the user strategy.`` + if "trade" in kwargs: + # Protect accidental modifications from within the strategy + kwargs["trade"] = deepcopy(kwargs["trade"]) return f(*args, **kwargs) except ValueError as error: logger.warning(f"{message}Strategy caused the following exception: {error}{f}")