Rename generate_graph to generate_candlestick_graph
This commit is contained in:
parent
edd3fc8825
commit
79b4e2dc85
@ -86,7 +86,7 @@ def plot_trades(fig, trades: pd.DataFrame):
|
|||||||
return fig
|
return fig
|
||||||
|
|
||||||
|
|
||||||
def generate_graph(
|
def generate_candlestick_graph(
|
||||||
pair: str,
|
pair: str,
|
||||||
data: pd.DataFrame,
|
data: pd.DataFrame,
|
||||||
trades: pd.DataFrame = None,
|
trades: pd.DataFrame = None,
|
||||||
|
@ -8,7 +8,7 @@ from copy import deepcopy
|
|||||||
from freqtrade.arguments import TimeRange
|
from freqtrade.arguments import TimeRange
|
||||||
from freqtrade.data import history
|
from freqtrade.data import history
|
||||||
from freqtrade.data.btanalysis import load_backtest_data
|
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)
|
generate_row, plot_trades)
|
||||||
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
|
||||||
@ -95,7 +95,7 @@ def test_plot_trades(caplog):
|
|||||||
assert trade_sell.marker.color == 'red'
|
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',
|
row_mock = mocker.patch('freqtrade.plot.plotting.generate_row',
|
||||||
MagicMock(side_effect=fig_generating_mock))
|
MagicMock(side_effect=fig_generating_mock))
|
||||||
trades_mock = mocker.patch('freqtrade.plot.plotting.plot_trades',
|
trades_mock = mocker.patch('freqtrade.plot.plotting.plot_trades',
|
||||||
@ -110,8 +110,8 @@ def test_generate_graph_no_signals_no_trades(default_conf, mocker, caplog):
|
|||||||
|
|
||||||
indicators1 = []
|
indicators1 = []
|
||||||
indicators2 = []
|
indicators2 = []
|
||||||
fig = generate_graph(pair=pair, data=data, trades=None,
|
fig = generate_candlestick_graph(pair=pair, data=data, trades=None,
|
||||||
indicators1=indicators1, indicators2=indicators2)
|
indicators1=indicators1, indicators2=indicators2)
|
||||||
assert isinstance(fig, go.Figure)
|
assert isinstance(fig, go.Figure)
|
||||||
assert fig.layout.title.text == pair
|
assert fig.layout.title.text == pair
|
||||||
figure = fig.layout.figure
|
figure = fig.layout.figure
|
||||||
@ -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)
|
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',
|
row_mock = mocker.patch('freqtrade.plot.plotting.generate_row',
|
||||||
MagicMock(side_effect=fig_generating_mock))
|
MagicMock(side_effect=fig_generating_mock))
|
||||||
trades_mock = mocker.patch('freqtrade.plot.plotting.plot_trades',
|
trades_mock = mocker.patch('freqtrade.plot.plotting.plot_trades',
|
||||||
@ -147,8 +147,8 @@ def test_generate_graph_no_trades(default_conf, mocker):
|
|||||||
|
|
||||||
indicators1 = []
|
indicators1 = []
|
||||||
indicators2 = []
|
indicators2 = []
|
||||||
fig = generate_graph(pair=pair, data=data, trades=None,
|
fig = generate_candlestick_graph(pair=pair, data=data, trades=None,
|
||||||
indicators1=indicators1, indicators2=indicators2)
|
indicators1=indicators1, indicators2=indicators2)
|
||||||
assert isinstance(fig, go.Figure)
|
assert isinstance(fig, go.Figure)
|
||||||
assert fig.layout.title.text == pair
|
assert fig.layout.title.text == pair
|
||||||
figure = fig.layout.figure
|
figure = fig.layout.figure
|
||||||
|
@ -36,7 +36,7 @@ from freqtrade.data import history
|
|||||||
from freqtrade.data.btanalysis import (extract_trades_of_period,
|
from freqtrade.data.btanalysis import (extract_trades_of_period,
|
||||||
load_backtest_data, load_trades_from_db)
|
load_backtest_data, load_trades_from_db)
|
||||||
from freqtrade.optimize import setup_configuration
|
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.resolvers import ExchangeResolver, StrategyResolver
|
||||||
from freqtrade.state import RunMode
|
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 = trades.loc[trades['pair'] == pair]
|
||||||
trades = extract_trades_of_period(dataframe, trades)
|
trades = extract_trades_of_period(dataframe, trades)
|
||||||
|
|
||||||
fig = generate_graph(
|
fig = generate_candlestick_graph(
|
||||||
pair=pair,
|
pair=pair,
|
||||||
data=dataframe,
|
data=dataframe,
|
||||||
trades=trades,
|
trades=trades,
|
||||||
|
Loading…
Reference in New Issue
Block a user