test bybit opening/closing orders

This commit is contained in:
Dobromir Popov
2025-07-15 00:03:59 +03:00
parent 5b2dd3b0b8
commit a7905ce4e9
6 changed files with 849 additions and 32 deletions

View File

@ -528,7 +528,7 @@ class EnhancedCNN(nn.Module):
state_tensor = torch.as_tensor(state, dtype=torch.float32, device=self.device)
if state_tensor.dim() == 1:
state_tensor = state_tensor.unsqueeze(0)
with torch.no_grad():
q_values, extrema_pred, price_predictions, features, advanced_predictions = self(state_tensor)
@ -537,7 +537,7 @@ class EnhancedCNN(nn.Module):
action_idx = int(torch.argmax(action_probs_tensor, dim=1).item())
confidence = float(action_probs_tensor[0, action_idx].item()) # Confidence of the chosen action
action_probs = action_probs_tensor.squeeze(0).tolist() # Convert to list of floats for return
# Log advanced predictions for better decision making
if hasattr(self, '_log_predictions') and self._log_predictions:
# Log volatility prediction