Plotting should not fail if one pair didn't produce any trades

This commit is contained in:
Matthias 2020-05-28 19:35:32 +02:00
parent 62ac5a9914
commit 7df786994d
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