try to fix input dimentions

This commit is contained in:
Dobromir Popov
2025-07-13 23:41:47 +03:00
parent bcc13a5db3
commit ebf65494a8
7 changed files with 358 additions and 145 deletions

View File

@ -984,6 +984,10 @@ class CleanTradingDashboard:
timestamp = pred.get('timestamp', datetime.now())
price = pred.get('price', 0)
# FILTER OUT INVALID PRICES - Skip predictions with price 0 or None
if price is None or price <= 0:
continue
if confidence > 0.3: # Only show predictions with reasonable confidence
pred_data = {
'x': timestamp,
@ -1096,7 +1100,12 @@ class CleanTradingDashboard:
current_price = pred.get('current_price', 0)
predicted_price = pred.get('predicted_price', current_price)
if confidence > 0.4 and current_price > 0: # Only show confident predictions
# FILTER OUT INVALID PRICES - Skip predictions with price 0 or None
if (current_price is None or current_price <= 0 or
predicted_price is None or predicted_price <= 0):
continue
if confidence > 0.4: # Only show confident predictions
# Calculate prediction end point (5 minutes ahead)
end_time = timestamp + timedelta(minutes=5)
@ -1171,10 +1180,10 @@ class CleanTradingDashboard:
if not cob_predictions:
return # No real predictions to display
# Separate predictions by direction
up_predictions = [p for p in cob_predictions if p['direction'] == 2]
down_predictions = [p for p in cob_predictions if p['direction'] == 0]
sideways_predictions = [p for p in cob_predictions if p['direction'] == 1]
# Separate predictions by direction and filter out invalid prices
up_predictions = [p for p in cob_predictions if p['direction'] == 2 and p.get('price', 0) > 0]
down_predictions = [p for p in cob_predictions if p['direction'] == 0 and p.get('price', 0) > 0]
sideways_predictions = [p for p in cob_predictions if p['direction'] == 1 and p.get('price', 0) > 0]
# Add COB_RL UP predictions (blue diamonds)
if up_predictions: