Fix analyze_commands setup

This commit is contained in:
froggleston 2022-05-22 23:55:59 +01:00
parent ae1ede58da
commit 80c6190c05

View File

@ -26,11 +26,10 @@ def setup_analyze_configuration(args: Dict[str, Any], method: RunMode) -> Dict[s
if method in no_unlimited_runmodes.keys(): if method in no_unlimited_runmodes.keys():
from freqtrade.data.btanalysis import get_latest_backtest_filename from freqtrade.data.btanalysis import get_latest_backtest_filename
btp = Path(config.get('user_data_dir'), "backtest_results") btfile = get_latest_backtest_filename(config['user_data_dir'] / 'backtest_results')
btfile = get_latest_backtest_filename(btp)
signals_file = f"{os.path.basename(os.path.splitext(btfile)[0])}_signals.pkl" signals_file = f"{os.path.basename(os.path.splitext(btfile)[0])}_signals.pkl"
if (not os.path.exists(Path(btp, signals_file))): if (not os.path.exists(config['user_data_dir'] / 'backtest_results' / signals_file)):
raise OperationalException( raise OperationalException(
"Cannot find latest backtest signals file. Run backtesting with --export signals." "Cannot find latest backtest signals file. Run backtesting with --export signals."
) )