hedgequantx 1.2.88 → 1.2.89

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 +16 -3
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hedgequantx",
3
- "version": "1.2.88",
3
+ "version": "1.2.89",
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
@@ -455,8 +455,17 @@ const launchAlgo = async (service, account, contract, numContracts, dailyTarget,
455
455
  };
456
456
 
457
457
  // Display full UI with logs (newest first at top)
458
+ // Use ANSI escape codes to avoid flickering
459
+ let firstDraw = true;
458
460
  const displayUI = () => {
459
- console.clear();
461
+ // First time: clear screen, after: just move cursor to top
462
+ if (firstDraw) {
463
+ console.clear();
464
+ firstDraw = false;
465
+ } else {
466
+ // Move cursor to top-left without clearing (avoids flicker)
467
+ process.stdout.write('\x1B[H');
468
+ }
460
469
 
461
470
  // Stats
462
471
  const pnlColor = stats.pnl >= 0 ? chalk.green : chalk.red;
@@ -584,16 +593,20 @@ const launchAlgo = async (service, account, contract, numContracts, dailyTarget,
584
593
  // Logs (without borders) - newest first
585
594
  console.log();
586
595
  if (logs.length === 0) {
587
- console.log(chalk.gray(' Waiting for activity...'));
596
+ console.log(chalk.gray(' Waiting for activity...') + '\x1B[K'); // Clear to end of line
588
597
  } else {
589
598
  // Reverse to show newest first
590
599
  const reversedLogs = [...logs].reverse();
591
600
  reversedLogs.forEach(log => {
592
601
  const color = typeColors[log.type] || chalk.white;
593
602
  const icon = getIcon(log.type);
594
- console.log(color(` [${log.timestamp}] ${icon} ${log.message}`));
603
+ // Pad message and clear to end of line to avoid artifacts
604
+ const logLine = ` [${log.timestamp}] ${icon} ${log.message}`;
605
+ console.log(color(logLine) + '\x1B[K');
595
606
  });
596
607
  }
608
+ // Clear remaining lines below logs
609
+ process.stdout.write('\x1B[J');
597
610
  };
598
611
 
599
612
  // Spinner interval to refresh UI