hedgequantx 2.5.32 → 2.5.33
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/pages/stats.js +37 -9
package/package.json
CHANGED
package/src/pages/stats.js
CHANGED
|
@@ -428,15 +428,43 @@ const showStats = async (service) => {
|
|
|
428
428
|
|
|
429
429
|
// Calculate max agent name length to fit in column (label=18 + space=1 + padding buffer)
|
|
430
430
|
const maxAgentNameLen = col1 - 20;
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
431
|
+
|
|
432
|
+
// Performance column data (right side)
|
|
433
|
+
const perfData = [
|
|
434
|
+
{ label: 'SUPERVISED ACCOUNTS:', value: chalk.white(String(supervisedAccounts)) },
|
|
435
|
+
{ label: 'SUPERVISED P&L:', value: supervisedPnL >= 0 ? chalk.green('$' + supervisedPnL.toFixed(2)) : chalk.red('$' + supervisedPnL.toFixed(2)) },
|
|
436
|
+
{ label: 'POSITIONS:', value: chalk.white(String(supervisionData.totalPositions)) },
|
|
437
|
+
{ label: 'OPEN ORDERS:', value: chalk.white(String(supervisionData.totalOrders)) },
|
|
438
|
+
{ label: 'TRADES TODAY:', value: chalk.white(String(supervisionData.totalTrades)) }
|
|
439
|
+
];
|
|
440
|
+
|
|
441
|
+
// Agents column data (left side) - each agent on its own line
|
|
442
|
+
const agentsData = [
|
|
443
|
+
{ label: 'CONNECTED AGENTS:', value: chalk.green(String(aiAgents.length)) },
|
|
444
|
+
{ label: 'MODE:', value: modeColor(agentMode) },
|
|
445
|
+
{ label: 'SESSION TIME:', value: sessionTimeStr === 'INACTIVE' ? chalk.yellow(sessionTimeStr) : chalk.white(sessionTimeStr) }
|
|
446
|
+
];
|
|
447
|
+
|
|
448
|
+
// Add each agent as a separate line
|
|
449
|
+
aiAgents.forEach((agent, idx) => {
|
|
450
|
+
const agentLabel = idx === 0 ? 'AGENTS:' : '';
|
|
451
|
+
const isActive = activeAgent && agent.id === activeAgent.id;
|
|
452
|
+
const agentName = agent.name.length > maxAgentNameLen
|
|
453
|
+
? agent.name.substring(0, maxAgentNameLen - 2) + '..'
|
|
454
|
+
: agent.name;
|
|
455
|
+
const agentDisplay = isActive
|
|
456
|
+
? chalk.green('● ') + chalk.green(agentName)
|
|
457
|
+
: chalk.white('○ ') + chalk.white(agentName);
|
|
458
|
+
agentsData.push({ label: agentLabel, value: agentDisplay });
|
|
459
|
+
});
|
|
460
|
+
|
|
461
|
+
// Print rows - match left and right columns
|
|
462
|
+
const maxRows = Math.max(agentsData.length, perfData.length);
|
|
463
|
+
for (let i = 0; i < maxRows; i++) {
|
|
464
|
+
const leftData = agentsData[i] || { label: '', value: '' };
|
|
465
|
+
const rightData = perfData[i] || { label: '', value: '' };
|
|
466
|
+
console.log(chalk.cyan('\u2551') + fmtRow(leftData.label, leftData.value, col1) + chalk.cyan('\u2502') + fmtRow(rightData.label, rightData.value, col2) + chalk.cyan('\u2551'));
|
|
467
|
+
}
|
|
440
468
|
|
|
441
469
|
drawBoxFooter(boxWidth);
|
|
442
470
|
}
|