wip training and inference stats

This commit is contained in:
Dobromir Popov
2025-07-27 19:20:23 +03:00
parent 2a21878ed5
commit 87c0dc8ac4
8 changed files with 833 additions and 84 deletions

View File

@ -1203,8 +1203,20 @@ class CleanTradingDashboard:
# Find overlap point - where live data starts
live_start = df_live.index[0]
# FIXED: Normalize timezone for comparison
# Convert both to UTC timezone-naive for safe comparison
if hasattr(live_start, 'tz') and live_start.tz is not None:
live_start = live_start.tz_localize(None)
# Normalize historical index timezone
if hasattr(df_historical.index, 'tz') and df_historical.index.tz is not None:
df_historical_normalized = df_historical.copy()
df_historical_normalized.index = df_historical_normalized.index.tz_localize(None)
else:
df_historical_normalized = df_historical
# Keep historical data up to live data start
df_historical_clean = df_historical[df_historical.index < live_start]
df_historical_clean = df_historical_normalized[df_historical_normalized.index < live_start]
# Combine: historical (older) + live (newer)
df_main = pd.concat([df_historical_clean, df_live]).tail(180)