hedgequantx 1.2.67 → 1.2.69
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 +1 -1
- package/src/pages/algo.js +29 -33
package/package.json
CHANGED
package/src/pages/algo.js
CHANGED
|
@@ -381,52 +381,48 @@ const launchAlgo = async (service, account, contract, numContracts, dailyTarget,
|
|
|
381
381
|
console.clear();
|
|
382
382
|
const marketStatus = checkMarketStatus();
|
|
383
383
|
|
|
384
|
-
//
|
|
385
|
-
const
|
|
386
|
-
|
|
387
|
-
'██║ ██║██╔═══██╗╚██╗██╔╝',
|
|
388
|
-
'███████║██║ ██║ ╚███╔╝ ',
|
|
389
|
-
'██╔══██║██║▄▄ ██║ ██╔██╗ ',
|
|
390
|
-
'██║ ██║╚██████╔╝██╔╝ ██╗',
|
|
391
|
-
'╚═╝ ╚═╝ ╚══▀▀═╝ ╚═╝ ╚═╝'
|
|
392
|
-
];
|
|
393
|
-
|
|
394
|
-
console.log();
|
|
395
|
-
logo.forEach(line => {
|
|
396
|
-
console.log(chalk.cyan(' ' + line));
|
|
397
|
-
});
|
|
398
|
-
console.log(chalk.gray(' Ultra-Scalping Algorithm'));
|
|
399
|
-
console.log();
|
|
400
|
-
|
|
401
|
-
// Info Box
|
|
402
|
-
console.log(chalk.cyan(' ╔════════════════════════════════════════════════════════════════════╗'));
|
|
403
|
-
console.log(chalk.cyan(' ║') + chalk.white(` Account: ${chalk.cyan(accountName.padEnd(25))} Symbol: ${chalk.yellow(symbolName.padEnd(10))} Qty: ${chalk.cyan(numContracts.toString().padEnd(3))}`) + chalk.cyan('║'));
|
|
384
|
+
// Stats
|
|
385
|
+
const pnlColor = stats.pnl >= 0 ? chalk.green : chalk.red;
|
|
386
|
+
const pnlStr = (stats.pnl >= 0 ? '+$' : '-$') + Math.abs(stats.pnl).toFixed(2);
|
|
404
387
|
const latencyStr = hqxConnected ? (latency > 0 ? `${latency}ms` : '---') : '---';
|
|
405
388
|
const latencyColor = latency < 100 ? chalk.green : (latency < 300 ? chalk.yellow : chalk.red);
|
|
406
|
-
|
|
389
|
+
const serverStatus = hqxConnected ? chalk.green('ON') : chalk.red('OFF');
|
|
407
390
|
|
|
408
|
-
//
|
|
409
|
-
const
|
|
410
|
-
const
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
console.log(
|
|
414
|
-
console.log(chalk.cyan('
|
|
391
|
+
// Current date
|
|
392
|
+
const now = new Date();
|
|
393
|
+
const dateStr = now.toLocaleDateString('en-US', { weekday: 'short', month: 'short', day: 'numeric', year: 'numeric' });
|
|
394
|
+
|
|
395
|
+
// Full header with logo inside box
|
|
396
|
+
console.log();
|
|
397
|
+
console.log(chalk.cyan('+=================================================================================================================+'));
|
|
398
|
+
console.log(chalk.cyan('|') + chalk.cyan(' ## ## ###### ##### #### ###### #### ## ## #### ## ## ###### ## ## ') + chalk.cyan('|'));
|
|
399
|
+
console.log(chalk.cyan('|') + chalk.cyan(' ## ## ## ## ## ## ## ## ## ## ## ## ## ### ## ## #### ') + chalk.cyan('|'));
|
|
400
|
+
console.log(chalk.cyan('|') + chalk.cyan(' ###### #### ## ## ## ### #### ## ## ## ## ###### ## ### ## ## ') + chalk.cyan('|'));
|
|
401
|
+
console.log(chalk.cyan('|') + chalk.cyan(' ## ## ## ## ## ## ## ## ## ### ## ## ## ## ## ## ## #### ') + chalk.cyan('|'));
|
|
402
|
+
console.log(chalk.cyan('|') + chalk.cyan(' ## ## ###### ##### #### ###### #### ## #### ## ## ## ## ## ## ## ') + chalk.cyan('|'));
|
|
403
|
+
console.log(chalk.cyan('+=================================================================================================================+'));
|
|
404
|
+
console.log(chalk.cyan('|') + chalk.white(' HQX Ultra-Scalping Algorithm ') + chalk.cyan('|'));
|
|
405
|
+
console.log(chalk.cyan('+=================================================================================================================+'));
|
|
406
|
+
console.log(chalk.cyan('|') + chalk.white(` Account: ${chalk.cyan(accountName.padEnd(28))} Symbol: ${chalk.yellow(symbolName.padEnd(12))} Qty: ${chalk.cyan(numContracts.toString().padEnd(4))} Server: ${serverStatus} ${latencyColor(latencyStr.padEnd(8))}`) + chalk.cyan('|'));
|
|
407
|
+
console.log(chalk.cyan('|') + chalk.white(` Target: ${chalk.green(('$' + dailyTarget.toFixed(2)).padEnd(12))} Risk: ${chalk.red(('$' + maxRisk.toFixed(2)).padEnd(12))} P&L: ${pnlColor(pnlStr.padEnd(12))} Trades: ${chalk.cyan(stats.trades.toString())} W:${chalk.green(stats.wins.toString())} L:${chalk.red(stats.losses.toString())} `) + chalk.cyan('|'));
|
|
408
|
+
console.log(chalk.cyan('+=================================================================================================================+'));
|
|
409
|
+
console.log(chalk.cyan('|') + chalk.white(` Activity Log - ${chalk.gray(dateStr)} `) + chalk.yellow('Press X to stop') + chalk.cyan(' |'));
|
|
410
|
+
console.log(chalk.cyan('+=================================================================================================================+'));
|
|
415
411
|
|
|
416
|
-
// Logs (
|
|
412
|
+
// Logs (without date, just time)
|
|
417
413
|
if (logs.length === 0) {
|
|
418
|
-
console.log(chalk.cyan('
|
|
414
|
+
console.log(chalk.cyan('|') + chalk.gray(' Waiting for activity...'.padEnd(111)) + chalk.cyan('|'));
|
|
419
415
|
} else {
|
|
420
416
|
logs.forEach(log => {
|
|
421
417
|
const color = typeColors[log.type] || chalk.white;
|
|
422
418
|
const icon = getIcon(log.type);
|
|
423
419
|
const logLine = `[${log.timestamp}] ${icon} ${log.message}`;
|
|
424
|
-
const truncated = logLine.length >
|
|
425
|
-
console.log(chalk.cyan('
|
|
420
|
+
const truncated = logLine.length > 109 ? logLine.substring(0, 106) + '...' : logLine;
|
|
421
|
+
console.log(chalk.cyan('|') + ' ' + color(truncated.padEnd(110)) + chalk.cyan('|'));
|
|
426
422
|
});
|
|
427
423
|
}
|
|
428
424
|
|
|
429
|
-
console.log(chalk.cyan('
|
|
425
|
+
console.log(chalk.cyan('+=================================================================================================================+'));
|
|
430
426
|
};
|
|
431
427
|
|
|
432
428
|
// Connect to HQX Server
|