From 7df786994da2dbdbc662367976fa1e647a205d08 Mon Sep 17 00:00:00 2001 From: Matthias Date: Thu, 28 May 2020 19:35:32 +0200 Subject: [PATCH] Plotting should not fail if one pair didn't produce any trades --- freqtrade/plot/plotting.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/freqtrade/plot/plotting.py b/freqtrade/plot/plotting.py index 095ca4133..f1d114e2b 100644 --- a/freqtrade/plot/plotting.py +++ b/freqtrade/plot/plotting.py @@ -415,9 +415,12 @@ def generate_profit_graph(pairs: str, data: Dict[str, pd.DataFrame], for pair in pairs: profit_col = f'cum_profit_{pair}' - df_comb = create_cum_profit(df_comb, trades[trades['pair'] == pair], profit_col, timeframe) - - fig = add_profit(fig, 3, df_comb, profit_col, f"Profit {pair}") + try: + df_comb = create_cum_profit(df_comb, trades[trades['pair'] == pair], profit_col, + timeframe) + fig = add_profit(fig, 3, df_comb, profit_col, f"Profit {pair}") + except ValueError: + pass return fig