live position sync for LIMIT orders

This commit is contained in:
Dobromir Popov
2025-07-14 14:50:30 +03:00
parent f861559319
commit d53a2ba75d
5 changed files with 822 additions and 51 deletions

View File

@ -197,6 +197,10 @@ class DashboardLayoutManager:
html.I(className="fas fa-save me-1"),
"Store All Models"
], id="store-models-btn", className="btn btn-info btn-sm w-100 mt-2"),
html.Button([
html.I(className="fas fa-arrows-rotate me-1"),
"Sync Positions/Orders"
], id="manual-sync-btn", className="btn btn-primary btn-sm w-100 mt-2"),
html.Hr(className="my-2"),
html.Small("System Status", className="text-muted d-block mb-1"),
html.Div([
@ -248,7 +252,7 @@ class DashboardLayoutManager:
])
def _create_cob_and_trades_row(self):
"""Creates the row for COB ladders, closed trades, and model status - REORGANIZED LAYOUT"""
"""Creates the row for COB ladders, closed trades, pending orders, and model status"""
return html.Div([
# Top row: COB Ladders (left) and Models/Training (right)
html.Div([
@ -273,7 +277,7 @@ class DashboardLayoutManager:
], className="d-flex")
], style={"width": "60%"}),
# Right side: Models & Training Progress (40% width) - MOVED UP
# Right side: Models & Training Progress (40% width)
html.Div([
html.Div([
html.Div([
@ -283,28 +287,47 @@ class DashboardLayoutManager:
], className="card-title mb-2"),
html.Div(
id="training-metrics",
style={"height": "300px", "overflowY": "auto"}, # Increased height
style={"height": "300px", "overflowY": "auto"},
),
], className="card-body p-2")
], className="card")
], style={"width": "38%", "marginLeft": "2%"}),
], className="d-flex mb-3"),
# Bottom row: Closed Trades (full width) - MOVED BELOW COB
# Second row: Pending Orders (left) and Closed Trades (right)
html.Div([
# Left side: Pending Orders (40% width)
html.Div([
html.Div([
html.H6([
html.I(className="fas fa-history me-2"),
"Recent Closed Trades",
], className="card-title mb-2"),
html.Div(
id="closed-trades-table",
style={"height": "200px", "overflowY": "auto"}, # Reduced height
),
], className="card-body p-2")
], className="card")
])
html.Div([
html.H6([
html.I(className="fas fa-clock me-2"),
"Pending Orders & Position Sync",
], className="card-title mb-2"),
html.Div(
id="pending-orders-content",
style={"height": "200px", "overflowY": "auto"},
),
], className="card-body p-2")
], className="card")
], style={"width": "40%"}),
# Right side: Closed Trades (58% width)
html.Div([
html.Div([
html.Div([
html.H6([
html.I(className="fas fa-history me-2"),
"Recent Closed Trades",
], className="card-title mb-2"),
html.Div(
id="closed-trades-table",
style={"height": "200px", "overflowY": "auto"},
),
], className="card-body p-2")
], className="card")
], style={"width": "58%", "marginLeft": "2%"}),
], className="d-flex")
])
def _create_analytics_and_performance_row(self):