hedgequantx 1.2.94 → 1.2.95

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 +15 -10
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hedgequantx",
3
- "version": "1.2.94",
3
+ "version": "1.2.95",
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
@@ -604,26 +604,31 @@ const launchAlgo = async (service, account, contract, numContracts, dailyTarget,
604
604
  console.log(chalk.cyan(V) + chalk.white(actLeft) + dateSection + chalk.yellow(actRight) + chalk.cyan(V));
605
605
  console.log(chalk.cyan(BOT));
606
606
 
607
- // Logs (without borders) - newest first
607
+ // Logs (without borders) - newest first, fixed number of lines
608
+ const MAX_VISIBLE_LOGS = 15;
608
609
  console.log();
610
+
609
611
  if (logs.length === 0) {
610
- console.log(chalk.gray(' Waiting for activity...') + '\x1B[K'); // Clear to end of line
612
+ console.log(chalk.gray(' Waiting for activity...') + '\x1B[K');
613
+ // Fill remaining lines with empty
614
+ for (let i = 0; i < MAX_VISIBLE_LOGS - 1; i++) {
615
+ console.log('\x1B[K');
616
+ }
611
617
  } else {
612
- // Reverse to show newest first
613
- const reversedLogs = [...logs].reverse();
618
+ // Show newest first (reverse), limited to MAX_VISIBLE_LOGS
619
+ const reversedLogs = [...logs].reverse().slice(0, MAX_VISIBLE_LOGS);
614
620
  reversedLogs.forEach(log => {
615
621
  const color = typeColors[log.type] || chalk.white;
616
622
  const icon = getIcon(log.type);
617
- // Pad message and clear to end of line to avoid artifacts
618
623
  const logLine = ` [${log.timestamp}] ${icon} ${log.message}`;
619
624
  console.log(color(logLine) + '\x1B[K');
620
625
  });
626
+ // Fill remaining lines with empty to keep fixed height
627
+ for (let i = reversedLogs.length; i < MAX_VISIBLE_LOGS; i++) {
628
+ console.log('\x1B[K');
629
+ }
621
630
  }
622
- // Add 30 empty lines so old logs scroll down further
623
- for (let i = 0; i < 30; i++) {
624
- console.log('\x1B[K');
625
- }
626
- // Clear remaining lines below
631
+ // Clear anything below
627
632
  process.stdout.write('\x1B[J');
628
633
  };
629
634