Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -100,6 +100,9 @@ def predict_next_day(symbol, timeframe):
|
|
100 |
|
101 |
def plot_candlestick(data, symbol, timeframe, predicted_price=None):
|
102 |
"""Plots the candlestick chart with technical indicators."""
|
|
|
|
|
|
|
103 |
fig, ax = plt.subplots(figsize=(12, 6))
|
104 |
mpf.plot(data, type='candle', style='charles', ax=ax, volume=True, show_nontrading=True)
|
105 |
|
|
|
100 |
|
101 |
def plot_candlestick(data, symbol, timeframe, predicted_price=None):
|
102 |
"""Plots the candlestick chart with technical indicators."""
|
103 |
+
if not isinstance(data, pd.DataFrame) or data.empty:
|
104 |
+
raise ValueError("No valid data to plot. Please check your inputs.")
|
105 |
+
|
106 |
fig, ax = plt.subplots(figsize=(12, 6))
|
107 |
mpf.plot(data, type='candle', style='charles', ax=ax, volume=True, show_nontrading=True)
|
108 |
|