Rename generate_graph to generate_candlestick_graph

This commit is contained in:
Matthias 2019-06-29 17:23:03 +02:00
parent edd3fc8825
commit 79b4e2dc85
3 changed files with 10 additions and 10 deletions

View File

@ -86,7 +86,7 @@ def plot_trades(fig, trades: pd.DataFrame):
return fig
def generate_graph(
def generate_candlestick_graph(
pair: str,
data: pd.DataFrame,
trades: pd.DataFrame = None,

View File

@ -8,7 +8,7 @@ from copy import deepcopy
from freqtrade.arguments import TimeRange
from freqtrade.data import history
from freqtrade.data.btanalysis import load_backtest_data
from freqtrade.plot.plotting import (generate_graph, generate_plot_file,
from freqtrade.plot.plotting import (generate_candlestick_graph, generate_plot_file,
generate_row, plot_trades)
from freqtrade.strategy.default_strategy import DefaultStrategy
from freqtrade.tests.conftest import log_has, log_has_re
@ -95,7 +95,7 @@ def test_plot_trades(caplog):
assert trade_sell.marker.color == 'red'
def test_generate_graph_no_signals_no_trades(default_conf, mocker, caplog):
def test_generate_candlestick_graph_no_signals_no_trades(default_conf, mocker, caplog):
row_mock = mocker.patch('freqtrade.plot.plotting.generate_row',
MagicMock(side_effect=fig_generating_mock))
trades_mock = mocker.patch('freqtrade.plot.plotting.plot_trades',
@ -110,7 +110,7 @@ def test_generate_graph_no_signals_no_trades(default_conf, mocker, caplog):
indicators1 = []
indicators2 = []
fig = generate_graph(pair=pair, data=data, trades=None,
fig = generate_candlestick_graph(pair=pair, data=data, trades=None,
indicators1=indicators1, indicators2=indicators2)
assert isinstance(fig, go.Figure)
assert fig.layout.title.text == pair
@ -131,7 +131,7 @@ def test_generate_graph_no_signals_no_trades(default_conf, mocker, caplog):
assert log_has("No sell-signals found.", caplog.record_tuples)
def test_generate_graph_no_trades(default_conf, mocker):
def test_generate_candlestick_graph_no_trades(default_conf, mocker):
row_mock = mocker.patch('freqtrade.plot.plotting.generate_row',
MagicMock(side_effect=fig_generating_mock))
trades_mock = mocker.patch('freqtrade.plot.plotting.plot_trades',
@ -147,7 +147,7 @@ def test_generate_graph_no_trades(default_conf, mocker):
indicators1 = []
indicators2 = []
fig = generate_graph(pair=pair, data=data, trades=None,
fig = generate_candlestick_graph(pair=pair, data=data, trades=None,
indicators1=indicators1, indicators2=indicators2)
assert isinstance(fig, go.Figure)
assert fig.layout.title.text == pair

View File

@ -36,7 +36,7 @@ from freqtrade.data import history
from freqtrade.data.btanalysis import (extract_trades_of_period,
load_backtest_data, load_trades_from_db)
from freqtrade.optimize import setup_configuration
from freqtrade.plot.plotting import generate_graph, generate_plot_file
from freqtrade.plot.plotting import generate_candlestick_graph, generate_plot_file
from freqtrade.resolvers import ExchangeResolver, StrategyResolver
from freqtrade.state import RunMode
@ -105,7 +105,7 @@ def analyse_and_plot_pairs(config: Dict[str, Any]):
trades = trades.loc[trades['pair'] == pair]
trades = extract_trades_of_period(dataframe, trades)
fig = generate_graph(
fig = generate_candlestick_graph(
pair=pair,
data=dataframe,
trades=trades,