Recursively search subdirectories in user_data/strategies for a strategy
This commit is contained in:
@@ -7,8 +7,9 @@ import logging
|
||||
import tempfile
|
||||
from base64 import urlsafe_b64decode
|
||||
from inspect import getfullargspec
|
||||
from os import walk
|
||||
from pathlib import Path
|
||||
from typing import Any, Dict, Optional
|
||||
from typing import Any, Dict, List, Optional
|
||||
|
||||
from freqtrade.constants import REQUIRED_ORDERTIF, REQUIRED_ORDERTYPES, USERPATH_STRATEGIES
|
||||
from freqtrade.exceptions import OperationalException
|
||||
@@ -166,10 +167,15 @@ class StrategyResolver(IResolver):
|
||||
:param extra_dir: additional directory to search for the given strategy
|
||||
:return: Strategy instance or None
|
||||
"""
|
||||
extra_dirs: List[str] = [
|
||||
path[0] for path in walk(f"{config['user_data_dir']}/{USERPATH_STRATEGIES}")
|
||||
] # sub-directories
|
||||
if extra_dir:
|
||||
extra_dirs.append(extra_dir)
|
||||
|
||||
abs_paths = StrategyResolver.build_search_paths(config,
|
||||
user_subdir=USERPATH_STRATEGIES,
|
||||
extra_dir=extra_dir)
|
||||
extra_dirs=extra_dirs)
|
||||
|
||||
if ":" in strategy_name:
|
||||
logger.info("loading base64 encoded strategy")
|
||||
|
Reference in New Issue
Block a user