hedgequantx 1.2.90 → 1.2.92

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/pages/algo.js +20 -13
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hedgequantx",
3
- "version": "1.2.90",
3
+ "version": "1.2.92",
4
4
  "description": "Prop Futures Algo Trading CLI - Connect to Topstep, Alpha Futures, and other prop firms",
5
5
  "main": "src/app.js",
6
6
  "bin": {
package/src/pages/algo.js CHANGED
@@ -470,8 +470,10 @@ const launchAlgo = async (service, account, contract, numContracts, dailyTarget,
470
470
  // Stats
471
471
  const pnlColor = stats.pnl >= 0 ? chalk.green : chalk.red;
472
472
  const pnlStr = (stats.pnl >= 0 ? '+$' : '-$') + Math.abs(stats.pnl).toFixed(2);
473
- const latencyStr = hqxConnected ? (latency > 0 ? `${latency}ms` : '--') : '--';
474
- const latencyColor = latency < 100 ? chalk.green : (latency < 300 ? chalk.yellow : chalk.red);
473
+ // Always show latency in ms format
474
+ const latencyMs = latency > 0 ? latency : 0;
475
+ const latencyStr = `${latencyMs}ms`;
476
+ const latencyColor = latencyMs < 100 ? chalk.green : (latencyMs < 300 ? chalk.yellow : chalk.red);
475
477
  const serverStatus = hqxConnected ? 'ON' : 'OFF';
476
478
  const serverColor = hqxConnected ? chalk.green : chalk.red;
477
479
 
@@ -521,10 +523,11 @@ const launchAlgo = async (service, account, contract, numContracts, dailyTarget,
521
523
  const title2 = 'HQX Ultra-Scalping Algorithm';
522
524
  console.log(chalk.cyan(V) + chalk.yellow(center(title2, W)) + chalk.cyan(V));
523
525
 
524
- // Grid layout for metrics - 2 columns per row, 3 rows
525
- // Row 1: Account | Symbol
526
+ // Grid layout for metrics - 2 columns per row, 4 rows
527
+ // Row 1: Account | Symbol + Qty
526
528
  // Row 2: Target | Risk
527
- // Row 3: P&L | Trades | Server | WS
529
+ // Row 3: P&L | Server
530
+ // Row 4: Trades + W/L | Latency
528
531
  const VS = '\u2502'; // Vertical separator (thin)
529
532
 
530
533
  // 2 columns: 48 + 47 + 1 separator = 96
@@ -552,13 +555,15 @@ const launchAlgo = async (service, account, contract, numContracts, dailyTarget,
552
555
  const r2c1 = buildCell('Target', '$' + dailyTarget.toFixed(2), chalk.green, colL);
553
556
  const r2c2 = buildCell('Risk', '$' + maxRisk.toFixed(2), chalk.red, colR);
554
557
 
555
- // Row 3: P&L | Trades | Server | WS (4 items in 2 columns)
556
- const r3c1text = ` P&L: ${pnlColor(pnlStr)} Trades: ${chalk.cyan(stats.trades)} W/L: ${chalk.green(stats.wins)}/${chalk.red(stats.losses)}`;
557
- const r3c1plain = ` P&L: ${pnlStr} Trades: ${stats.trades} W/L: ${stats.wins}/${stats.losses}`;
558
- const r3c1 = r3c1text + safePad(colL - r3c1plain.length);
559
- const r3c2text = ` Server: ${serverColor(serverStatus)} WS: ${latencyColor(latencyStr)}`;
560
- const r3c2plain = ` Server: ${serverStatus} WS: ${latencyStr}`;
561
- const r3c2 = r3c2text + safePad(colR - r3c2plain.length);
558
+ // Row 3: P&L | Server
559
+ const r3c1 = buildCell('P&L', pnlStr, pnlColor, colL);
560
+ const r3c2 = buildCell('Server', serverStatus, serverColor, colR);
561
+
562
+ // Row 4: Trades + W/L | Latency
563
+ const r4c1text = ` Trades: ${chalk.cyan(stats.trades)} W/L: ${chalk.green(stats.wins)}/${chalk.red(stats.losses)}`;
564
+ const r4c1plain = ` Trades: ${stats.trades} W/L: ${stats.wins}/${stats.losses}`;
565
+ const r4c1 = r4c1text + safePad(colL - r4c1plain.length);
566
+ const r4c2 = buildCell('Latency', latencyStr, latencyColor, colR);
562
567
 
563
568
  // Grid separators
564
569
  const GRID_TOP = '\u2560' + '\u2550'.repeat(colL) + '\u2564' + '\u2550'.repeat(colR) + '\u2563';
@@ -571,7 +576,9 @@ const launchAlgo = async (service, account, contract, numContracts, dailyTarget,
571
576
  console.log(chalk.cyan(GRID_MID));
572
577
  console.log(chalk.cyan(V) + r2c1.padded + chalk.cyan(VS) + r2c2.padded + chalk.cyan(V));
573
578
  console.log(chalk.cyan(GRID_MID));
574
- console.log(chalk.cyan(V) + r3c1 + chalk.cyan(VS) + r3c2 + chalk.cyan(V));
579
+ console.log(chalk.cyan(V) + r3c1.padded + chalk.cyan(VS) + r3c2.padded + chalk.cyan(V));
580
+ console.log(chalk.cyan(GRID_MID));
581
+ console.log(chalk.cyan(V) + r4c1 + chalk.cyan(VS) + r4c2.padded + chalk.cyan(V));
575
582
  console.log(chalk.cyan(GRID_BOT));
576
583
 
577
584
  // Activity log header with spinner and centered date