Edgecli -> Edge for Runmode and start_edge()
This commit is contained in:
parent
201e02e73f
commit
55bdd26439
@ -340,7 +340,7 @@ class Arguments(object):
|
||||
Builds and attaches all subcommands
|
||||
:return: None
|
||||
"""
|
||||
from freqtrade.optimize import start_backtesting, start_hyperopt, start_edgecli
|
||||
from freqtrade.optimize import start_backtesting, start_hyperopt, start_edge
|
||||
|
||||
subparsers = self.parser.add_subparsers(dest='subparser')
|
||||
|
||||
@ -352,7 +352,7 @@ class Arguments(object):
|
||||
|
||||
# Add edge subcommand
|
||||
edge_cmd = subparsers.add_parser('edge', help='Edge module.')
|
||||
edge_cmd.set_defaults(func=start_edgecli)
|
||||
edge_cmd.set_defaults(func=start_edge)
|
||||
self.optimizer_shared_options(edge_cmd)
|
||||
self.edge_options(edge_cmd)
|
||||
|
||||
|
@ -99,7 +99,7 @@ def start_hyperopt(args: Namespace) -> None:
|
||||
# Same in Edge and Backtesting start() functions.
|
||||
|
||||
|
||||
def start_edgecli(args: Namespace) -> None:
|
||||
def start_edge(args: Namespace) -> None:
|
||||
"""
|
||||
Start Edge script
|
||||
:param args: Cli args from Arguments()
|
||||
@ -107,7 +107,7 @@ def start_edgecli(args: Namespace) -> None:
|
||||
"""
|
||||
from freqtrade.optimize.edge_cli import EdgeCli
|
||||
# Initialize configuration
|
||||
config = setup_configuration(args, RunMode.EDGECLI)
|
||||
config = setup_configuration(args, RunMode.EDGE)
|
||||
logger.info('Starting freqtrade in Edge mode')
|
||||
|
||||
# Initialize Edge object
|
||||
|
@ -18,11 +18,11 @@ class State(Enum):
|
||||
class RunMode(Enum):
|
||||
"""
|
||||
Bot running mode (backtest, hyperopt, ...)
|
||||
can be "live", "dry-run", "backtest", "edgecli", "hyperopt".
|
||||
can be "live", "dry-run", "backtest", "edge", "hyperopt".
|
||||
"""
|
||||
LIVE = "live"
|
||||
DRY_RUN = "dry_run"
|
||||
BACKTEST = "backtest"
|
||||
EDGECLI = "edgecli"
|
||||
EDGE = "edge"
|
||||
HYPEROPT = "hyperopt"
|
||||
OTHER = "other" # Used for plotting scripts and test
|
||||
|
@ -7,7 +7,7 @@ from unittest.mock import MagicMock
|
||||
|
||||
from freqtrade.arguments import Arguments
|
||||
from freqtrade.edge import PairInfo
|
||||
from freqtrade.optimize import start_edgecli, setup_configuration
|
||||
from freqtrade.optimize import start_edge, setup_configuration
|
||||
from freqtrade.optimize.edge_cli import EdgeCli
|
||||
from freqtrade.state import RunMode
|
||||
from freqtrade.tests.conftest import log_has, log_has_re, patch_exchange
|
||||
@ -28,8 +28,8 @@ def test_setup_configuration_without_arguments(mocker, default_conf, caplog) ->
|
||||
'edge'
|
||||
]
|
||||
|
||||
config = setup_configuration(get_args(args), RunMode.EDGECLI)
|
||||
assert config['runmode'] == RunMode.EDGECLI
|
||||
config = setup_configuration(get_args(args), RunMode.EDGE)
|
||||
assert config['runmode'] == RunMode.EDGE
|
||||
|
||||
assert 'max_open_trades' in config
|
||||
assert 'stake_currency' in config
|
||||
@ -68,14 +68,14 @@ def test_setup_edge_configuration_with_arguments(mocker, edge_conf, caplog) -> N
|
||||
'--stoplosses=-0.01,-0.10,-0.001'
|
||||
]
|
||||
|
||||
config = setup_configuration(get_args(args), RunMode.EDGECLI)
|
||||
config = setup_configuration(get_args(args), RunMode.EDGE)
|
||||
assert 'max_open_trades' in config
|
||||
assert 'stake_currency' in config
|
||||
assert 'stake_amount' in config
|
||||
assert 'exchange' in config
|
||||
assert 'pair_whitelist' in config['exchange']
|
||||
assert 'datadir' in config
|
||||
assert config['runmode'] == RunMode.EDGECLI
|
||||
assert config['runmode'] == RunMode.EDGE
|
||||
assert log_has(
|
||||
'Using data folder: {} ...'.format(config['datadir']),
|
||||
caplog.record_tuples
|
||||
@ -107,7 +107,7 @@ def test_start(mocker, fee, edge_conf, caplog) -> None:
|
||||
'edge'
|
||||
]
|
||||
args = get_args(args)
|
||||
start_edgecli(args)
|
||||
start_edge(args)
|
||||
assert log_has(
|
||||
'Starting freqtrade in Edge mode',
|
||||
caplog.record_tuples
|
||||
|
Loading…
Reference in New Issue
Block a user