plot-profit should fail gracefully if no trade is within the selected timerange

closes #4119
This commit is contained in:
Matthias
2020-12-30 08:30:41 +01:00
parent b8899b39ec
commit 2fdda8e448
2 changed files with 6 additions and 0 deletions

View File

@@ -444,6 +444,8 @@ def generate_profit_graph(pairs: str, data: Dict[str, pd.DataFrame],
# Trim trades to available OHLCV data
trades = extract_trades_of_period(df_comb, trades, date_index=True)
if len(trades) == 0:
raise OperationalException('No trades found in selected timerange.')
# Add combined cumulative profit
df_comb = create_cum_profit(df_comb, trades, 'cum_profit', timeframe)