fix pred candles viz

This commit is contained in:
Dobromir Popov
2025-11-22 16:22:13 +02:00
parent 539bd68110
commit 423132dc8f
5 changed files with 140 additions and 25 deletions

View File

@@ -2143,7 +2143,7 @@ class RealTrainingAdapter:
checkpoint_dir = "models/checkpoints/transformer"
os.makedirs(checkpoint_dir, exist_ok=True)
timestamp = datetime.now().strftime("%Y%m%d_%H%M%S")
timestamp = datetime.now(timezone.utc).strftime("%Y%m%d_%H%M%S")
checkpoint_path = os.path.join(checkpoint_dir, f"transformer_epoch{epoch+1}_{timestamp}.pt")
torch.save({
@@ -2872,7 +2872,7 @@ class RealTrainingAdapter:
checkpoint_dir = "models/checkpoints/transformer/realtime"
os.makedirs(checkpoint_dir, exist_ok=True)
timestamp = datetime.now().strftime("%Y%m%d_%H%M%S")
timestamp = datetime.now(timezone.utc).strftime("%Y%m%d_%H%M%S")
checkpoint_type = "BEST" if improved else "periodic"
checkpoint_path = os.path.join(checkpoint_dir, f"realtime_{checkpoint_type}_step{step}_{timestamp}.pt")
@@ -3137,7 +3137,7 @@ class RealTrainingAdapter:
if prediction:
# Store signal
signal = {
'timestamp': datetime.now().isoformat(),
'timestamp': datetime.now(timezone.utc).isoformat(),
'symbol': symbol,
'model': model_name,
'action': prediction['action'],
@@ -3158,7 +3158,7 @@ class RealTrainingAdapter:
# Store prediction for visualization
if self.orchestrator and hasattr(self.orchestrator, 'store_transformer_prediction'):
self.orchestrator.store_transformer_prediction(symbol, {
'timestamp': datetime.now(),
'timestamp': datetime.now(timezone.utc).isoformat(),
'current_price': current_price,
'predicted_price': current_price * (1.01 if prediction['action'] == 'BUY' else 0.99),
'price_change': 1.0 if prediction['action'] == 'BUY' else -1.0,