Example #1
0
def _add_strategies_requirements(strategies, strategy_config):
    config = get_bot().get_config()
    required_elements = _get_required_element(strategy_config)
    for classKey, klass in strategies.items():
        if not strategy_config[STRATEGIES_KEY][classKey][ADVANCED_CLASS_KEY]:
            # no need for requirement if advanced class: requirements are already in advanced class
            _add_strategy_requirements_and_default_config(strategy_config[STRATEGIES_KEY][classKey], klass, config)
        strategy_config[STRATEGIES_KEY][classKey][REQUIRED_KEY] = classKey in required_elements
Example #2
0
def _add_strategies_requirements(strategies, strategy_config):
    strategies_key = "strategies"
    requirements_key = "requirements"
    advanced_class_key = "advanced_class"
    required = "required"
    config = get_bot().get_config()
    required_elements = _get_required_element(strategy_config)
    for classKey, klass in strategies.items():
        if not strategy_config[strategies_key][classKey][advanced_class_key]:
            # no need for requirement if advanced class: requirements are already in advanced class
            strategy_config[strategies_key][classKey][requirements_key] = \
                [evaluator for evaluator in klass.get_required_evaluators(config)]
        strategy_config[strategies_key][classKey][required] = classKey in required_elements