From 700bab7279bd37d97528123d60b43dfba8b9e882 Mon Sep 17 00:00:00 2001 From: Matthias Date: Sun, 30 Jun 2019 09:28:34 +0200 Subject: [PATCH] Rename generate_plot_file to store_plot_file --- freqtrade/plot/plotting.py | 2 +- freqtrade/tests/test_plotting.py | 4 ++-- scripts/plot_dataframe.py | 5 ++--- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/freqtrade/plot/plotting.py b/freqtrade/plot/plotting.py index f8a010068..68d61bb92 100644 --- a/freqtrade/plot/plotting.py +++ b/freqtrade/plot/plotting.py @@ -213,7 +213,7 @@ def generate_plot_filename(pair, ticker_interval) -> str: return file_name -def generate_plot_file(fig, filename: str, auto_open: bool = False) -> None: +def store_plot_file(fig, filename: str, auto_open: bool = False) -> None: """ Generate a plot html file from pre populated fig plotly object :param fig: Plotly Figure to plot diff --git a/freqtrade/tests/test_plotting.py b/freqtrade/tests/test_plotting.py index 527534522..0e93e8fad 100644 --- a/freqtrade/tests/test_plotting.py +++ b/freqtrade/tests/test_plotting.py @@ -9,7 +9,7 @@ from freqtrade.arguments import TimeRange from freqtrade.data import history from freqtrade.data.btanalysis import load_backtest_data from freqtrade.plot.plotting import (generate_candlestick_graph, - generate_plot_file, + store_plot_file, generate_plot_filename, generate_row, plot_trades) from freqtrade.strategy.default_strategy import DefaultStrategy @@ -188,7 +188,7 @@ def test_generate_Plot_filename(): def test_generate_plot_file(mocker, caplog): fig = generage_empty_figure() plot_mock = mocker.patch("freqtrade.plot.plotting.plot", MagicMock()) - generate_plot_file(fig, filename="freqtrade-plot-UNITTEST_BTC-5m.html") + store_plot_file(fig, filename="freqtrade-plot-UNITTEST_BTC-5m.html") assert plot_mock.call_count == 1 assert plot_mock.call_args[0][0] == fig diff --git a/scripts/plot_dataframe.py b/scripts/plot_dataframe.py index dfd31e9ab..a0f4ef778 100755 --- a/scripts/plot_dataframe.py +++ b/scripts/plot_dataframe.py @@ -24,7 +24,7 @@ from freqtrade.data import history from freqtrade.data.btanalysis import extract_trades_of_period, load_trades from freqtrade.optimize import setup_configuration from freqtrade.plot.plotting import (generate_candlestick_graph, - generate_plot_file, + store_plot_file, generate_plot_filename) from freqtrade.resolvers import ExchangeResolver, StrategyResolver from freqtrade.state import RunMode @@ -67,7 +67,6 @@ def analyse_and_plot_pairs(config: Dict[str, Any]): # Set timerange to use timerange = Arguments.parse_timerange(config["timerange"]) - ticker_interval = strategy.ticker_interval tickers = history.load_data( datadir=Path(str(config.get("datadir"))), @@ -100,7 +99,7 @@ def analyse_and_plot_pairs(config: Dict[str, Any]): indicators2=config["indicators2"].split(",") ) - generate_plot_file(fig, generate_plot_filename(pair, ticker_interval)) + store_plot_file(fig, generate_plot_filename(pair, config['ticker_interval'])) logger.info('End of ploting process %s plots generated', pair_counter)