Merge branch 'cleanup' of https://git.d-popov.com/popov/gogo2 into cleanup

This commit is contained in:
Dobromir Popov
2025-11-22 20:45:37 +02:00
25 changed files with 2825 additions and 258 deletions

View File

@@ -10,6 +10,7 @@
/* Chart Panel */
.chart-panel {
height: calc(100vh - 150px);
transition: all 0.3s ease;
}
.chart-panel .card-body {
@@ -17,6 +18,29 @@
overflow: hidden;
}
/* Maximized Chart View */
.chart-maximized {
width: 100% !important;
max-width: 100% !important;
flex: 0 0 100% !important;
transition: all 0.3s ease;
}
.chart-panel-maximized {
height: calc(100vh - 80px) !important;
position: fixed;
top: 60px;
left: 0;
right: 0;
z-index: 1040;
margin: 0 !important;
border-radius: 0 !important;
}
.chart-panel-maximized .card-body {
height: calc(100% - 60px);
}
#chart-container {
height: 100%;
overflow-y: auto;
@@ -236,11 +260,32 @@
padding: 1rem;
}
/* Maximized View - Larger Charts */
.chart-panel-maximized .chart-plot {
height: 400px;
}
@media (min-width: 1400px) {
.chart-panel-maximized .chart-plot {
height: 450px;
}
}
@media (min-width: 1920px) {
.chart-panel-maximized .chart-plot {
height: 500px;
}
}
/* Responsive Adjustments */
@media (max-width: 1200px) {
.chart-plot {
height: 250px;
}
.chart-panel-maximized .chart-plot {
height: 350px;
}
}
@media (max-width: 768px) {

File diff suppressed because it is too large Load Diff

View File

@@ -99,6 +99,18 @@ class LiveUpdatesWebSocket {
console.error('Prediction error:', data);
});
this.socket.on('executed_trade', (data) => {
console.log('Executed trade received:', data);
if (this.onExecutedTrade) {
this.onExecutedTrade(data);
}
});
this.socket.on('training_update', (data) => {
console.log('Training update received:', data);
// Training feedback from incremental learning
});
// Error events
this.socket.on('connect_error', (error) => {
console.error('WebSocket connection error:', error);
@@ -230,6 +242,26 @@ document.addEventListener('DOMContentLoaded', function() {
}
};
window.liveUpdatesWS.onExecutedTrade = function(data) {
// Visualize executed trade on chart
if (window.appState && window.appState.chartManager) {
window.appState.chartManager.addExecutedTradeMarker(data.trade, data.position_state);
}
// Update position state display
if (typeof updatePositionStateDisplay === 'function') {
updatePositionStateDisplay(data.position_state, data.session_metrics);
}
// Log trade details
console.log('Executed Trade:', {
action: data.trade.action,
price: data.trade.price,
pnl: data.trade.pnl ? `$${data.trade.pnl.toFixed(2)} (${data.trade.pnl_pct.toFixed(2)}%)` : 'N/A',
position: data.position_state.has_position ? `${data.position_state.position_type.toUpperCase()} @ $${data.position_state.entry_price}` : 'CLOSED'
});
};
// Auto-connect
console.log('Auto-connecting to WebSocket...');
window.liveUpdatesWS.connect();