From a004bcf00f7740c16577da59de41d4fb65f0b4ef Mon Sep 17 00:00:00 2001 From: Matthias Date: Fri, 25 Mar 2022 08:03:32 +0100 Subject: [PATCH] Small refactor to backtesting --- docs/strategy-customization.md | 2 +- freqtrade/optimize/backtesting.py | 5 +---- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/docs/strategy-customization.md b/docs/strategy-customization.md index 900c6d1b4..fd2119753 100644 --- a/docs/strategy-customization.md +++ b/docs/strategy-customization.md @@ -1092,7 +1092,7 @@ When conflicting signals collide (e.g. both `'enter_long'` and `'exit_long'` are The following rules apply, and entry signals will be ignored if more than one of the 3 signals is set: -- `enter_long` -> `exit_long`, `exit_short` +- `enter_long` -> `exit_long`, `enter_short` - `enter_short` -> `exit_short`, `enter_long` ## Further strategy ideas diff --git a/freqtrade/optimize/backtesting.py b/freqtrade/optimize/backtesting.py index 082effdf2..6c48c841a 100644 --- a/freqtrade/optimize/backtesting.py +++ b/freqtrade/optimize/backtesting.py @@ -19,7 +19,7 @@ from freqtrade.data import history from freqtrade.data.btanalysis import find_existing_backtest_stats, trade_list_to_dataframe from freqtrade.data.converter import trim_dataframe, trim_dataframes from freqtrade.data.dataprovider import DataProvider -from freqtrade.enums import (BacktestState, CandleType, ExitCheckTuple, MarginMode, ExitType, +from freqtrade.enums import (BacktestState, CandleType, ExitCheckTuple, ExitType, MarginMode, TradingMode) from freqtrade.exceptions import DependencyException, OperationalException from freqtrade.exchange import timeframe_to_minutes, timeframe_to_seconds @@ -129,12 +129,9 @@ class Backtesting: self.exchange.validate_required_startup_candles(self.required_startup, self.timeframe) self.trading_mode: TradingMode = config.get('trading_mode', TradingMode.SPOT) - self.margin_mode: MarginMode = config.get('margin_mode', MarginMode.NONE) # strategies which define "can_short=True" will fail to load in Spot mode. self._can_short = self.trading_mode != TradingMode.SPOT - self.progress = BTProgress() - self.abort = False self.init_backtest() def __del__(self):