Fix group 0 table, add pathlib.Path use

This commit is contained in:
froggleston
2022-05-24 12:48:13 +01:00
parent 80c6190c05
commit 8c03ebb78f
3 changed files with 16 additions and 11 deletions

View File

@@ -1,5 +1,4 @@
import logging
import os
from pathlib import Path
from typing import Any, Dict
@@ -26,14 +25,19 @@ def setup_analyze_configuration(args: Dict[str, Any], method: RunMode) -> Dict[s
if method in no_unlimited_runmodes.keys():
from freqtrade.data.btanalysis import get_latest_backtest_filename
btfile = get_latest_backtest_filename(config['user_data_dir'] / 'backtest_results')
signals_file = f"{os.path.basename(os.path.splitext(btfile)[0])}_signals.pkl"
btfile = Path(get_latest_backtest_filename(config['user_data_dir'] / 'backtest_results'))
signals_file = f"{btfile.stem}_signals.pkl"
if (not os.path.exists(config['user_data_dir'] / 'backtest_results' / signals_file)):
if (not (config['user_data_dir'] / 'backtest_results' / signals_file).exists()):
raise OperationalException(
"Cannot find latest backtest signals file. Run backtesting with --export signals."
)
if ('strategy' not in config):
raise OperationalException(
"No strategy defined. Use --strategy or supply in config."
)
return config
@@ -48,6 +52,8 @@ def start_analysis_entries_exits(args: Dict[str, Any]) -> None:
# Initialize configuration
config = setup_analyze_configuration(args, RunMode.BACKTEST)
print(config)
logger.info('Starting freqtrade in analysis mode')
process_entry_exit_reasons(Path(config['user_data_dir'], 'backtest_results'),

View File

@@ -644,5 +644,6 @@ AVAILABLE_CLI_OPTIONS = {
help=("Comma separated list of indicators to analyse. ",
"e.g. 'close,rsi,bb_lowerband,profit_abs'"),
nargs='?',
default='',
),
}