mirror of
https://github.com/wassname/catalyst.git
synced 2026-07-13 17:42:42 +08:00
BLD: updated CLI with new parameters
This commit is contained in:
+14
-2
@@ -255,8 +255,9 @@ def run(ctx,
|
||||
ctx.fail("must specify a base currency with '-c' in backtest mode")
|
||||
|
||||
if capital_base is None:
|
||||
ctx.fail("must specify a capital base with '--capital-base'"
|
||||
" in backtest mode")
|
||||
ctx.fail("must specify a capital base with '--capital-base'")
|
||||
|
||||
click.echo('Running in backtesting mode.')
|
||||
|
||||
perf = _run(
|
||||
initialize=None,
|
||||
@@ -429,11 +430,22 @@ def live(ctx,
|
||||
|
||||
if exchange_name is None:
|
||||
ctx.fail("must specify an exchange name '-x'")
|
||||
|
||||
if algo_namespace is None:
|
||||
ctx.fail("must specify an algorithm name '-n' in live execution mode")
|
||||
|
||||
if base_currency is None:
|
||||
ctx.fail("must specify a base currency '-c' in live execution mode")
|
||||
|
||||
if capital_base is None:
|
||||
ctx.fail("must specify a capital base with '--capital-base'")
|
||||
|
||||
if simulate_orders:
|
||||
click.echo('Running in paper trading mode.')
|
||||
|
||||
else:
|
||||
click.echo('Running in live trading mode.')
|
||||
|
||||
perf = _run(
|
||||
initialize=None,
|
||||
handle_data=None,
|
||||
|
||||
@@ -141,7 +141,8 @@ def _run(handle_data,
|
||||
else:
|
||||
click.echo(algotext)
|
||||
|
||||
mode = 'live' if live else 'backtest'
|
||||
mode = 'paper-trading' if simulate_orders else 'live-trading' \
|
||||
if live else 'backtest'
|
||||
log.info('running algo in {mode} mode'.format(mode=mode))
|
||||
|
||||
exchange_name = exchange
|
||||
|
||||
Reference in New Issue
Block a user