Improve formatting of plotting.py
This commit is contained in:
parent
0d5e94b147
commit
348513c151
@ -84,7 +84,7 @@ def add_indicators(fig, row, indicators: List[str], data: pd.DataFrame) -> tools
|
||||
|
||||
def plot_trades(fig, trades: pd.DataFrame):
|
||||
"""
|
||||
Plot trades to "fig"
|
||||
Add trades to "fig"
|
||||
"""
|
||||
# Trades can be empty
|
||||
if trades is not None and len(trades) > 0:
|
||||
@ -124,13 +124,9 @@ def plot_trades(fig, trades: pd.DataFrame):
|
||||
return fig
|
||||
|
||||
|
||||
def generate_candlestick_graph(
|
||||
pair: str,
|
||||
data: pd.DataFrame,
|
||||
trades: pd.DataFrame = None,
|
||||
indicators1: List[str] = [],
|
||||
indicators2: List[str] = [],
|
||||
) -> go.Figure:
|
||||
def generate_candlestick_graph(pair: str, data: pd.DataFrame, trades: pd.DataFrame = None,
|
||||
indicators1: List[str] = [],
|
||||
indicators2: List[str] = [],) -> go.Figure:
|
||||
"""
|
||||
Generate the graph from the data generated by Backtesting or from DB
|
||||
Volume will always be ploted in row2, so Row 1 and 3 are to our disposal for custom indicators
|
||||
@ -243,6 +239,9 @@ def generate_candlestick_graph(
|
||||
|
||||
|
||||
def generate_plot_filename(pair, ticker_interval) -> str:
|
||||
"""
|
||||
Generate filenames per pair/ticker_interval to be used for storing plots
|
||||
"""
|
||||
pair_name = pair.replace("/", "_")
|
||||
file_name = 'freqtrade-plot-' + pair_name + '-' + ticker_interval + '.html'
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user