Beispiel #1
0
def setup_configuration(args: Namespace, method: RunMode) -> Dict[str, Any]:
    """
    Prepare the configuration for the Hyperopt module
    :param args: Cli args from Arguments()
    :return: Configuration
    """
    config = setup_utils_configuration(args, method)

    if method == RunMode.BACKTEST:
        if config['stake_amount'] == constants.UNLIMITED_STAKE_AMOUNT:
            raise DependencyException(
                'stake amount could not be "%s" for backtesting' %
                constants.UNLIMITED_STAKE_AMOUNT)

    if method == RunMode.HYPEROPT:
        # Special cases for Hyperopt
        if config.get(
                'strategy') and config.get('strategy') != 'DefaultStrategy':
            logger.error("Please don't use --strategy for hyperopt.")
            logger.error(
                "Read the documentation at "
                "https://github.com/freqtrade/freqtrade/blob/develop/docs/hyperopt.md "
                "to understand how to configure hyperopt.")
            raise DependencyException(
                "--strategy configured but not supported for hyperopt")

    return config
def test_setup_utils_configuration():
    args = [
        '--config', 'config.json.example',
    ]

    config = setup_utils_configuration(get_args(args), RunMode.OTHER)
    assert "exchange" in config
    assert config['exchange']['dry_run'] is True
    assert config['exchange']['key'] == ''
    assert config['exchange']['secret'] == ''
def start_plot_profit(args: Namespace) -> None:
    """
    Entrypoint for plot_profit
    """
    # Import here to avoid errors if plot-dependencies are not installed.
    from freqtrade.plot.plotting import plot_profit
    validate_plot_args(args)
    config = setup_utils_configuration(args, RunMode.PLOT)

    plot_profit(config)
def start_plot_dataframe(args: Namespace) -> None:
    """
    Entrypoint for dataframe plotting
    """
    # Import here to avoid errors if plot-dependencies are not installed.
    from freqtrade.plot.plotting import analyse_and_plot_pairs
    validate_plot_args(args)
    config = setup_utils_configuration(args, RunMode.PLOT)

    analyse_and_plot_pairs(config)
Beispiel #5
0
def start_plot_dataframe(args: Dict[str, Any]) -> None:
    """
    Entrypoint for dataframe plotting
    """
    # Import here to avoid errors if plot-dependencies are not installed.
    from freqtrade.plot.plotting import load_and_plot_trades
    validate_plot_args(args)
    config = setup_utils_configuration(args, RunMode.PLOT)

    load_and_plot_trades(config)
Beispiel #6
0
def setup_configuration(args: Dict[str, Any],
                        method: RunMode) -> Dict[str, Any]:
    """
    Prepare the configuration for the Hyperopt module
    :param args: Cli args from Arguments()
    :return: Configuration
    """
    config = setup_utils_configuration(args, method)

    if method == RunMode.BACKTEST:
        if config['stake_amount'] == constants.UNLIMITED_STAKE_AMOUNT:
            raise DependencyException(
                'stake amount could not be "%s" for backtesting' %
                constants.UNLIMITED_STAKE_AMOUNT)

    return config
Beispiel #7
0
def plot_parse_args(args: Dict[str, Any]) -> Dict[str, Any]:
    config = setup_utils_configuration(args, RunMode.OTHER)
    return config