mirror of
https://github.com/freqtrade/freqtrade.git
synced 2025-12-16 12:51:14 +00:00
Merge pull request #12116 from stash86/fix-recursive
move strategy load to after candle_type_def has been defined
This commit is contained in:
@@ -15,7 +15,6 @@ from freqtrade.loggers.set_log_levels import (
|
||||
)
|
||||
from freqtrade.optimize.backtesting import Backtesting
|
||||
from freqtrade.optimize.base_analysis import BaseAnalysis, VarHolder
|
||||
from freqtrade.resolvers import StrategyResolver
|
||||
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
@@ -33,13 +32,6 @@ class RecursiveAnalysis(BaseAnalysis):
|
||||
|
||||
super().__init__(config, strategy_obj)
|
||||
|
||||
strat = StrategyResolver.load_strategy(config)
|
||||
self._strat_scc = strat.startup_candle_count
|
||||
|
||||
if self._strat_scc not in self._startup_candle:
|
||||
self._startup_candle.append(self._strat_scc)
|
||||
self._startup_candle.sort()
|
||||
|
||||
self.partial_varHolder_array: list[VarHolder] = []
|
||||
self.partial_varHolder_lookahead_array: list[VarHolder] = []
|
||||
|
||||
@@ -149,6 +141,13 @@ class RecursiveAnalysis(BaseAnalysis):
|
||||
self.local_config["candle_type_def"] = prepare_data_config["candle_type_def"]
|
||||
backtesting._set_strategy(backtesting.strategylist[0])
|
||||
|
||||
strat = backtesting.strategy
|
||||
self._strat_scc = strat.startup_candle_count
|
||||
|
||||
if self._strat_scc not in self._startup_candle:
|
||||
self._startup_candle.append(self._strat_scc)
|
||||
self._startup_candle.sort()
|
||||
|
||||
varholder.data, varholder.timerange = backtesting.load_bt_data()
|
||||
varholder.timeframe = backtesting.timeframe
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ class RecursiveAnalysisSubFunctions:
|
||||
@staticmethod
|
||||
def text_table_recursive_analysis_instances(recursive_instances: list[RecursiveAnalysis]):
|
||||
startups = recursive_instances[0]._startup_candle
|
||||
strat_scc = recursive_instances[0]._strat_scc
|
||||
strat_scc = getattr(recursive_instances[0], "_strat_scc", 0) or 0
|
||||
headers = ["Indicators"]
|
||||
for candle in startups:
|
||||
if candle == strat_scc:
|
||||
|
||||
Reference in New Issue
Block a user