chore: Remove protections from config logic
This commit is contained in:
@@ -273,10 +273,6 @@ class Backtesting:
|
|||||||
|
|
||||||
def _load_protections(self, strategy: IStrategy):
|
def _load_protections(self, strategy: IStrategy):
|
||||||
if self.config.get("enable_protections", False):
|
if self.config.get("enable_protections", False):
|
||||||
conf = self.config
|
|
||||||
if hasattr(strategy, "protections"):
|
|
||||||
conf = deepcopy(conf)
|
|
||||||
conf["protections"] = strategy.protections
|
|
||||||
self.protections = ProtectionManager(self.config, strategy.protections)
|
self.protections = ProtectionManager(self.config, strategy.protections)
|
||||||
|
|
||||||
def load_bt_data(self) -> Tuple[Dict[str, DataFrame], TimeRange]:
|
def load_bt_data(self) -> Tuple[Dict[str, DataFrame], TimeRange]:
|
||||||
|
|||||||
@@ -69,7 +69,6 @@ class StrategyResolver(IResolver):
|
|||||||
("order_time_in_force", None),
|
("order_time_in_force", None),
|
||||||
("stake_currency", None),
|
("stake_currency", None),
|
||||||
("stake_amount", None),
|
("stake_amount", None),
|
||||||
("protections", None),
|
|
||||||
("startup_candle_count", None),
|
("startup_candle_count", None),
|
||||||
("unfilledtimeout", None),
|
("unfilledtimeout", None),
|
||||||
("use_exit_signal", True),
|
("use_exit_signal", True),
|
||||||
|
|||||||
@@ -77,7 +77,6 @@ def __run_backtest_bg(btconfig: Config):
|
|||||||
|
|
||||||
lastconfig["timerange"] = btconfig["timerange"]
|
lastconfig["timerange"] = btconfig["timerange"]
|
||||||
lastconfig["timeframe"] = strat.timeframe
|
lastconfig["timeframe"] = strat.timeframe
|
||||||
lastconfig["protections"] = btconfig.get("protections", [])
|
|
||||||
lastconfig["enable_protections"] = btconfig.get("enable_protections")
|
lastconfig["enable_protections"] = btconfig.get("enable_protections")
|
||||||
lastconfig["dry_run_wallet"] = btconfig.get("dry_run_wallet")
|
lastconfig["dry_run_wallet"] = btconfig.get("dry_run_wallet")
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user