hedgequantx 2.6.60 → 2.6.62

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hedgequantx",
3
- "version": "2.6.60",
3
+ "version": "2.6.62",
4
4
  "description": "HedgeQuantX - Prop Futures Trading CLI",
5
5
  "main": "src/app.js",
6
6
  "bin": {
@@ -877,12 +877,14 @@ const launchCopyTrading = async (config) => {
877
877
  platform: lead.type === 'rithmic' ? 'Rithmic' : 'ProjectX',
878
878
  startTime: Date.now(),
879
879
  aiSupervision: false,
880
- aiMode: null
880
+ aiMode: null,
881
+ agentCount: 0 // Number of AI agents active
881
882
  };
882
883
 
883
884
  // Initialize AI Supervisor - only if user enabled it
884
885
  if (enableAI) {
885
886
  const aiAgents = aiService.getAgents();
887
+ stats.agentCount = aiAgents.length;
886
888
  if (aiAgents.length > 0) {
887
889
  const supervisorResult = StrategySupervisor.initialize(null, aiAgents, lead.service, lead.account.accountId);
888
890
  stats.aiSupervision = supervisorResult.success;
@@ -269,6 +269,7 @@ const launchAlgo = async (service, account, contract, config) => {
269
269
  startTime: Date.now(),
270
270
  aiSupervision: false,
271
271
  aiMode: null,
272
+ agentCount: 0, // Number of AI agents active
272
273
  // Fast path stats
273
274
  fastPath: useFastPath,
274
275
  avgEntryLatency: 0,
@@ -320,7 +321,8 @@ const launchAlgo = async (service, account, contract, config) => {
320
321
  stats.entryLatencies.push(fillLatencyMs);
321
322
  stats.avgFillLatency = stats.entryLatencies.reduce((a, b) => a + b, 0) / stats.entryLatencies.length;
322
323
  const side = position.side === 0 ? 'LONG' : 'SHORT';
323
- algoLogger.info(ui, 'FILLED', `${side} ${position.size}x ${symbolName} @ ${position.entryPrice} | ${fillLatencyMs}ms`);
324
+ // Use 'filled' type for colored FILL icon
325
+ ui.addLog('filled', `${side} ${position.size}x ${symbolName} @ ${position.entryPrice} | ${fillLatencyMs}ms`);
324
326
  });
325
327
 
326
328
  positionManager.on('exitFilled', ({ orderTag, exitPrice, pnlTicks, holdDurationMs }) => {
@@ -331,19 +333,21 @@ const launchAlgo = async (service, account, contract, config) => {
331
333
  stats.sessionPnl += pnlDollars; // Track session P&L
332
334
  if (pnlDollars >= 0) {
333
335
  stats.wins++;
334
- algoLogger.info(ui, 'WIN', `+$${pnlDollars.toFixed(2)} @ ${exitPrice} | ${holdSec}s`);
336
+ // Use 'win' type for green WIN icon
337
+ ui.addLog('win', `+$${pnlDollars.toFixed(2)} @ ${exitPrice} | ${holdSec}s`);
335
338
  } else {
336
339
  stats.losses++;
337
- algoLogger.info(ui, 'LOSS', `-$${Math.abs(pnlDollars).toFixed(2)} @ ${exitPrice} | ${holdSec}s`);
340
+ // Use 'loss' type for red LOSS icon
341
+ ui.addLog('loss', `-$${Math.abs(pnlDollars).toFixed(2)} @ ${exitPrice} | ${holdSec}s`);
338
342
  }
339
343
  } else {
340
344
  // Log with ticks only if tickValue unavailable
341
345
  if (pnlTicks !== null && pnlTicks >= 0) {
342
346
  stats.wins++;
343
- algoLogger.info(ui, 'WIN', `+${pnlTicks} ticks | ${holdSec}s`);
347
+ ui.addLog('win', `+${pnlTicks} ticks | ${holdSec}s`);
344
348
  } else if (pnlTicks !== null) {
345
349
  stats.losses++;
346
- algoLogger.info(ui, 'LOSS', `${pnlTicks} ticks | ${holdSec}s`);
350
+ ui.addLog('loss', `${pnlTicks} ticks | ${holdSec}s`);
347
351
  }
348
352
  }
349
353
  stats.trades++;
@@ -353,11 +357,13 @@ const launchAlgo = async (service, account, contract, config) => {
353
357
  });
354
358
 
355
359
  positionManager.on('holdComplete', ({ orderTag, position }) => {
356
- algoLogger.info(ui, 'READY', `Hold complete - monitoring exit`);
360
+ // Use 'ready' type for green READY icon
361
+ ui.addLog('ready', `Hold complete - monitoring exit`);
357
362
  });
358
363
 
359
364
  positionManager.on('breakevenActivated', ({ orderTag, position, breakevenPrice, pnlTicks }) => {
360
- algoLogger.info(ui, 'BE', `Breakeven activated @ ${breakevenPrice} | +${pnlTicks} ticks`);
365
+ // Use 'be' type for yellow BE icon
366
+ ui.addLog('be', `Breakeven @ ${breakevenPrice} | +${pnlTicks} ticks`)
361
367
  });
362
368
 
363
369
  positionManager.on('exitOrderFired', ({ orderTag, exitReason, latencyMs }) => {
@@ -454,6 +460,7 @@ const launchAlgo = async (service, account, contract, config) => {
454
460
  if (config.enableAI) {
455
461
  const aiAgents = aiService.getAgents();
456
462
  aiAgentCount = aiAgents.length;
463
+ stats.agentCount = aiAgentCount;
457
464
  if (aiAgents.length > 0) {
458
465
  const supervisorResult = StrategySupervisor.initialize(strategy, aiAgents, service, account.accountId);
459
466
  stats.aiSupervision = supervisorResult.success;
@@ -552,8 +559,8 @@ const launchAlgo = async (service, account, contract, config) => {
552
559
  orderData.accountId = account.rithmicAccountId;
553
560
  }
554
561
 
555
- // Log entry attempt (single line)
556
- algoLogger.info(ui, 'ENTRY', `${sideStr} ${contracts}x ${symbolName} | risk: $${riskAmount} (${riskPct}%)`);
562
+ // Log entry attempt (single line) - use 'entry' type for cyan ENTRY icon
563
+ ui.addLog('entry', `${sideStr} ${contracts}x ${symbolName} | risk: $${riskAmount} (${riskPct}%)`);
557
564
 
558
565
  // Fire-and-forget entry (no await on fill)
559
566
  const entryResult = service.fastEntry(orderData);
@@ -19,16 +19,21 @@ const SPINNER = ['\u280B', '\u2819', '\u2839', '\u2838', '\u283C', '\u2834', '\u
19
19
  const LOG_COLORS = {
20
20
  fill_buy: chalk.green,
21
21
  fill_sell: chalk.red,
22
- fill_win: chalk.green.bold,
23
- fill_loss: chalk.red.bold,
22
+ fill_win: chalk.green,
23
+ fill_loss: chalk.red,
24
+ win: chalk.green,
25
+ loss: chalk.red,
26
+ be: chalk.yellow,
27
+ entry: chalk.cyan,
28
+ filled: chalk.green,
24
29
  connected: chalk.cyan,
25
30
  ready: chalk.green,
26
31
  error: chalk.red,
27
32
  reject: chalk.red,
28
- info: chalk.cyan,
33
+ info: chalk.white,
29
34
  system: chalk.magenta,
30
- signal: chalk.yellow.bold,
31
- trade: chalk.green.bold,
35
+ signal: chalk.yellow,
36
+ trade: chalk.green,
32
37
  warning: chalk.yellow,
33
38
  success: chalk.green,
34
39
  analysis: chalk.magenta
@@ -40,6 +45,11 @@ const LOG_ICONS = {
40
45
  fill_sell: 'SELL ',
41
46
  fill_win: 'WIN ',
42
47
  fill_loss: 'LOSS ',
48
+ win: 'WIN ',
49
+ loss: 'LOSS ',
50
+ be: 'BE ',
51
+ entry: 'ENTRY ',
52
+ filled: 'FILL ',
43
53
  connected: 'CONN ',
44
54
  ready: 'READY ',
45
55
  error: 'ERR ',
@@ -239,6 +249,18 @@ class AlgoUI {
239
249
  const r4c2 = buildCell('PROPFIRM', stats.propfirm || 'N/A', chalk.cyan, colR);
240
250
  row(r4c1t + pad(colL - r4c1p.length), r4c2.padded);
241
251
 
252
+ this._line(chalk.cyan(GM));
253
+
254
+ // Row 5: Connection | Agents
255
+ const connectionType = stats.platform || stats.connection || 'N/A';
256
+ const connectionColor = connectionType.toLowerCase().includes('rithmic') ? chalk.green : chalk.yellow;
257
+ const agentCount = stats.agentCount || 0;
258
+ const agentStr = agentCount > 0 ? `${agentCount} agent${agentCount > 1 ? 's' : ''} active` : 'None';
259
+ const agentColor = agentCount > 0 ? chalk.green : chalk.gray;
260
+ const r5c1 = buildCell('CONNECTION', connectionType, connectionColor, colL);
261
+ const r5c2 = buildCell('AGENTS', agentStr, agentColor, colR);
262
+ row(r5c1.padded, r5c2.padded);
263
+
242
264
  this._line(chalk.cyan(GB));
243
265
  }
244
266