Merge pull request #3388 from freqtrade/plotting_fixplot

[minor] Plotting should not fail if one pair didn't produce any trades
This commit is contained in:
hroff-1902 2020-05-28 21:53:26 +03:00 committed by GitHub
commit 003724e400
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 3 deletions

View File

@ -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