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:
commit
003724e400
@ -415,9 +415,12 @@ def generate_profit_graph(pairs: str, data: Dict[str, pd.DataFrame],
|
|||||||
|
|
||||||
for pair in pairs:
|
for pair in pairs:
|
||||||
profit_col = f'cum_profit_{pair}'
|
profit_col = f'cum_profit_{pair}'
|
||||||
df_comb = create_cum_profit(df_comb, trades[trades['pair'] == pair], profit_col, timeframe)
|
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}")
|
fig = add_profit(fig, 3, df_comb, profit_col, f"Profit {pair}")
|
||||||
|
except ValueError:
|
||||||
|
pass
|
||||||
|
|
||||||
return fig
|
return fig
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user