hedgequantx 2.6.138 → 2.6.139
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
CHANGED
|
@@ -1416,11 +1416,13 @@ const launchMultiSymbolRithmic = async (service, account, contracts, config) =>
|
|
|
1416
1416
|
: 'HQX *****';
|
|
1417
1417
|
const rithmicAccountId = account.rithmicAccountId || account.accountId;
|
|
1418
1418
|
|
|
1419
|
-
// Build symbols string for UI (
|
|
1419
|
+
// Build symbols string for UI (clean names without X1 suffix, show qty only if > 1)
|
|
1420
1420
|
const symbolsDisplay = contracts.map(c => {
|
|
1421
|
-
|
|
1421
|
+
let name = c.name || c.symbol;
|
|
1422
|
+
// Remove X1, X2 suffix (Rithmic internal suffixes)
|
|
1423
|
+
name = name.replace(/X\d+$/, '');
|
|
1422
1424
|
const qty = c.qty || 1;
|
|
1423
|
-
return `${name}x${qty}
|
|
1425
|
+
return qty > 1 ? `${name}x${qty}` : name;
|
|
1424
1426
|
}).join(', ');
|
|
1425
1427
|
|
|
1426
1428
|
const ui = new AlgoUI({
|
|
@@ -1502,6 +1504,22 @@ const launchMultiSymbolRithmic = async (service, account, contracts, config) =>
|
|
|
1502
1504
|
};
|
|
1503
1505
|
});
|
|
1504
1506
|
|
|
1507
|
+
// ═══════════════════════════════════════════════════════════════════════════
|
|
1508
|
+
// AI SUPERVISOR INITIALIZATION (same as single-symbol)
|
|
1509
|
+
// ═══════════════════════════════════════════════════════════════════════════
|
|
1510
|
+
let aiAgentCount = 0;
|
|
1511
|
+
if (enableAI) {
|
|
1512
|
+
const aiAgents = aiService.getAgents();
|
|
1513
|
+
aiAgentCount = aiAgents.length;
|
|
1514
|
+
stats.agentCount = aiAgentCount;
|
|
1515
|
+
if (aiAgents.length > 0) {
|
|
1516
|
+
// Use first symbol's strategy for AI supervisor
|
|
1517
|
+
const firstContract = contracts[0];
|
|
1518
|
+
const firstSymbolName = firstContract.name || firstContract.symbol;
|
|
1519
|
+
// Strategy will be created below, so we init supervisor after strategies
|
|
1520
|
+
}
|
|
1521
|
+
}
|
|
1522
|
+
|
|
1505
1523
|
// ═══════════════════════════════════════════════════════════════════════════
|
|
1506
1524
|
// POSITION MANAGERS & STRATEGIES - One per symbol
|
|
1507
1525
|
// ═══════════════════════════════════════════════════════════════════════════
|
|
@@ -1675,6 +1693,22 @@ const launchMultiSymbolRithmic = async (service, account, contracts, config) =>
|
|
|
1675
1693
|
});
|
|
1676
1694
|
});
|
|
1677
1695
|
|
|
1696
|
+
// ═══════════════════════════════════════════════════════════════════════════
|
|
1697
|
+
// AI SUPERVISOR - Initialize after strategies are created
|
|
1698
|
+
// ═══════════════════════════════════════════════════════════════════════════
|
|
1699
|
+
if (enableAI && aiAgentCount > 0) {
|
|
1700
|
+
const aiAgents = aiService.getAgents();
|
|
1701
|
+
const firstSymbol = Object.keys(strategies)[0];
|
|
1702
|
+
const firstStrategy = strategies[firstSymbol];
|
|
1703
|
+
const supervisorResult = StrategySupervisor.initialize(firstStrategy, aiAgents, service, rithmicAccountId);
|
|
1704
|
+
stats.aiSupervision = supervisorResult.success;
|
|
1705
|
+
stats.aiMode = supervisorResult.mode;
|
|
1706
|
+
|
|
1707
|
+
if (stats.aiSupervision) {
|
|
1708
|
+
algoLogger.info(ui, 'AI SUPERVISION', `${aiAgentCount} agent(s) - ${stats.aiMode} mode - LEARNING ACTIVE`);
|
|
1709
|
+
}
|
|
1710
|
+
}
|
|
1711
|
+
|
|
1678
1712
|
// ═══════════════════════════════════════════════════════════════════════════
|
|
1679
1713
|
// MARKET DATA FEED - Single connection, multiple subscriptions
|
|
1680
1714
|
// ═══════════════════════════════════════════════════════════════════════════
|