Test init_plotscript
This commit is contained in:
parent
db59d39e2c
commit
44e0500958
@ -11,8 +11,8 @@ from freqtrade.data.btanalysis import create_cum_profit, load_backtest_data
|
|||||||
from freqtrade.plot.plotting import (add_indicators, add_profit,
|
from freqtrade.plot.plotting import (add_indicators, add_profit,
|
||||||
generate_candlestick_graph,
|
generate_candlestick_graph,
|
||||||
generate_plot_filename,
|
generate_plot_filename,
|
||||||
generate_profit_graph, plot_trades,
|
generate_profit_graph, init_plotscript,
|
||||||
store_plot_file)
|
plot_trades, store_plot_file)
|
||||||
from freqtrade.strategy.default_strategy import DefaultStrategy
|
from freqtrade.strategy.default_strategy import DefaultStrategy
|
||||||
from freqtrade.tests.conftest import log_has, log_has_re
|
from freqtrade.tests.conftest import log_has, log_has_re
|
||||||
|
|
||||||
@ -37,6 +37,26 @@ def generage_empty_figure():
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def test_init_plotscript(default_conf, mocker):
|
||||||
|
default_conf['timerange'] = "20180110-20180112"
|
||||||
|
default_conf['trade_source'] = "file"
|
||||||
|
default_conf['ticker_interval'] = "5m"
|
||||||
|
default_conf["datadir"] = history.make_testdata_path(None)
|
||||||
|
default_conf['exportfilename'] = str(
|
||||||
|
history.make_testdata_path(None) / "backtest-result_test.json")
|
||||||
|
ret = init_plotscript(default_conf)
|
||||||
|
assert "tickers" in ret
|
||||||
|
assert "trades" in ret
|
||||||
|
assert "pairs" in ret
|
||||||
|
assert "strategy" in ret
|
||||||
|
|
||||||
|
default_conf['pairs'] = "POWR/BTC,XLM/BTC"
|
||||||
|
ret = init_plotscript(default_conf)
|
||||||
|
assert "tickers" in ret
|
||||||
|
assert "POWR/BTC" in ret["tickers"]
|
||||||
|
assert "XLM/BTC" in ret["tickers"]
|
||||||
|
|
||||||
|
|
||||||
def test_add_indicators(default_conf, caplog):
|
def test_add_indicators(default_conf, caplog):
|
||||||
pair = "UNITTEST/BTC"
|
pair = "UNITTEST/BTC"
|
||||||
timerange = TimeRange(None, 'line', 0, -1000)
|
timerange = TimeRange(None, 'line', 0, -1000)
|
||||||
|
Loading…
Reference in New Issue
Block a user