list-strategies should find recursively as well

This commit is contained in:
Matthias
2022-04-23 09:11:50 +02:00
parent c6927a1501
commit ba92e09b7b
6 changed files with 20 additions and 9 deletions

View File

@@ -243,7 +243,8 @@ def list_strategies(config=Depends(get_config)):
directory = Path(config.get(
'strategy_path', config['user_data_dir'] / USERPATH_STRATEGIES))
from freqtrade.resolvers.strategy_resolver import StrategyResolver
strategies = StrategyResolver.search_all_objects(directory, False)
strategies = StrategyResolver.search_all_objects(
directory, False, config.get('recursive_strategy_search', False))
strategies = sorted(strategies, key=lambda x: x['name'])
return {'strategies': [x['name'] for x in strategies]}