switch indicators to nargs argument type
This commit is contained in:
parent
0ef13be577
commit
f8ddb10607
@ -292,14 +292,16 @@ AVAILABLE_CLI_OPTIONS = {
|
|||||||
"indicators1": Arg(
|
"indicators1": Arg(
|
||||||
'--indicators1',
|
'--indicators1',
|
||||||
help='Set indicators from your strategy you want in the first row of the graph. '
|
help='Set indicators from your strategy you want in the first row of the graph. '
|
||||||
'Comma-separated list. Example: `ema3,ema5`. Default: `%(default)s`.',
|
'Space-separated list. Example: `ema3 ema5`. Default: `%(default)s`.',
|
||||||
default='sma,ema3,ema5',
|
default=['sma', 'ema3', 'ema5'],
|
||||||
|
nargs='+',
|
||||||
),
|
),
|
||||||
"indicators2": Arg(
|
"indicators2": Arg(
|
||||||
'--indicators2',
|
'--indicators2',
|
||||||
help='Set indicators from your strategy you want in the third row of the graph. '
|
help='Set indicators from your strategy you want in the third row of the graph. '
|
||||||
'Comma-separated list. Example: `fastd,fastk`. Default: `%(default)s`.',
|
'Space-separated list. Example: `fastd fastk`. Default: `%(default)s`.',
|
||||||
default='macd,macdsignal',
|
default=['macd', 'macdsignal'],
|
||||||
|
nargs='+',
|
||||||
),
|
),
|
||||||
"plot_limit": Arg(
|
"plot_limit": Arg(
|
||||||
'--plot-limit',
|
'--plot-limit',
|
||||||
|
@ -346,8 +346,8 @@ def analyse_and_plot_pairs(config: Dict[str, Any]):
|
|||||||
pair=pair,
|
pair=pair,
|
||||||
data=dataframe,
|
data=dataframe,
|
||||||
trades=trades_pair,
|
trades=trades_pair,
|
||||||
indicators1=config["indicators1"].split(","),
|
indicators1=config["indicators1"],
|
||||||
indicators2=config["indicators2"].split(",")
|
indicators2=config["indicators2"],
|
||||||
)
|
)
|
||||||
|
|
||||||
store_plot_file(fig, filename=generate_plot_filename(pair, config['ticker_interval']),
|
store_plot_file(fig, filename=generate_plot_filename(pair, config['ticker_interval']),
|
||||||
|
@ -294,8 +294,8 @@ def test_analyse_and_plot_pairs(default_conf, mocker, caplog):
|
|||||||
default_conf["datadir"] = history.make_testdata_path(None)
|
default_conf["datadir"] = history.make_testdata_path(None)
|
||||||
default_conf['exportfilename'] = str(
|
default_conf['exportfilename'] = str(
|
||||||
history.make_testdata_path(None) / "backtest-result_test.json")
|
history.make_testdata_path(None) / "backtest-result_test.json")
|
||||||
default_conf['indicators1'] = "sma5,ema10"
|
default_conf['indicators1'] = ["sma5", "ema10"]
|
||||||
default_conf['indicators2'] = "macd"
|
default_conf['indicators2'] = ["macd"]
|
||||||
default_conf['pairs'] = ["ETH/BTC", "LTC/BTC"]
|
default_conf['pairs'] = ["ETH/BTC", "LTC/BTC"]
|
||||||
|
|
||||||
candle_mock = MagicMock()
|
candle_mock = MagicMock()
|
||||||
@ -353,4 +353,4 @@ def test_plot_profit(default_conf, mocker, caplog):
|
|||||||
assert store_mock.call_count == 1
|
assert store_mock.call_count == 1
|
||||||
|
|
||||||
assert profit_mock.call_args_list[0][0][0] == default_conf['pairs']
|
assert profit_mock.call_args_list[0][0][0] == default_conf['pairs']
|
||||||
assert store_mock.call_args_list[0][1]['auto_open'] == True
|
assert store_mock.call_args_list[0][1]['auto_open'] is True
|
||||||
|
Loading…
Reference in New Issue
Block a user