No predictions yet...
';
+ return;
+ }
+
+ // Display last 5 predictions (most recent first)
+ const html = predictionHistory.slice(0, 5).map(pred => {
+ const time = new Date(pred.timestamp).toLocaleTimeString();
+ const actionColor = pred.action === 'BUY' ? 'text-success' :
+ pred.action === 'SELL' ? 'text-danger' : 'text-secondary';
+ const confidence = (pred.confidence * 100).toFixed(1);
+ const price = pred.predicted_price ? pred.predicted_price.toFixed(2) : '--';
+
+ return `
+
+
+ ${pred.action}
+ ${time}
+
+
+
${confidence}%
+
$${price}
+
+
+ `;
+ }).join('');
+
+ historyDiv.innerHTML = html;
+ }
+
function startSignalPolling() {
signalPollInterval = setInterval(function () {
// Poll for signals
@@ -580,6 +613,18 @@
document.getElementById('latest-confidence').textContent =
(latest.confidence * 100).toFixed(1) + '%';
+ // Add to prediction history (keep last 5)
+ predictionHistory.unshift({
+ timestamp: latest.timestamp || new Date().toISOString(),
+ action: latest.action,
+ confidence: latest.confidence,
+ predicted_price: latest.predicted_price
+ });
+ if (predictionHistory.length > 5) {
+ predictionHistory = predictionHistory.slice(0, 5);
+ }
+ updatePredictionHistory();
+
// Update chart with signal markers
if (appState.chartManager) {
displaySignalOnChart(latest);