hedgequantx 1.2.109 → 1.2.111
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/app.js +20 -13
- package/src/pages/algo.js +9 -8
package/package.json
CHANGED
package/src/app.js
CHANGED
|
@@ -690,22 +690,29 @@ const handleUpdate = async () => {
|
|
|
690
690
|
|
|
691
691
|
// Update via npm
|
|
692
692
|
spinner.text = `Updating v${currentVersion} -> v${latestVersion}...`;
|
|
693
|
+
spinner.stop();
|
|
694
|
+
|
|
695
|
+
console.log();
|
|
696
|
+
console.log(chalk.cyan(' Run this command to update:'));
|
|
697
|
+
console.log();
|
|
698
|
+
console.log(chalk.yellow(` npm install -g hedgequantx@latest`));
|
|
699
|
+
console.log();
|
|
700
|
+
console.log(chalk.gray(' (Use sudo if permission denied)'));
|
|
701
|
+
console.log();
|
|
702
|
+
|
|
703
|
+
await inquirer.prompt([{ type: 'input', name: 'continue', message: 'Press Enter after update...' }]);
|
|
704
|
+
|
|
705
|
+
// Check if updated
|
|
693
706
|
try {
|
|
694
|
-
exec('npm
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
try {
|
|
699
|
-
exec('sudo npm install -g hedgequantx@latest', { stdio: 'pipe' });
|
|
700
|
-
} catch (e2) {
|
|
701
|
-
spinner.fail('Update failed - try manually: npm install -g hedgequantx@latest');
|
|
702
|
-
return;
|
|
703
|
-
}
|
|
704
|
-
} else {
|
|
705
|
-
spinner.fail('Update failed - try manually: npm install -g hedgequantx@latest');
|
|
706
|
-
return;
|
|
707
|
+
const newVersion = exec('npm show hedgequantx version', { stdio: 'pipe' }).toString().trim();
|
|
708
|
+
if (newVersion !== currentVersion) {
|
|
709
|
+
console.log(chalk.green(` [OK] Updated to v${newVersion}`));
|
|
710
|
+
console.log(chalk.cyan(' Restart HQX to apply changes.'));
|
|
707
711
|
}
|
|
712
|
+
} catch (e) {
|
|
713
|
+
// Ignore
|
|
708
714
|
}
|
|
715
|
+
return;
|
|
709
716
|
|
|
710
717
|
spinner.succeed('CLI updated!');
|
|
711
718
|
console.log();
|
package/src/pages/algo.js
CHANGED
|
@@ -988,21 +988,22 @@ const launchAlgo = async (service, account, contract, numContracts, dailyTarget,
|
|
|
988
988
|
// Small delay to ensure all cleanup is done
|
|
989
989
|
await new Promise(r => setTimeout(r, 500));
|
|
990
990
|
|
|
991
|
-
//
|
|
992
|
-
|
|
993
|
-
process.stdout.write('\x1B[?25h'); // Make sure cursor is visible
|
|
991
|
+
// Show cursor again (don't clear screen - show summary below logs)
|
|
992
|
+
process.stdout.write('\x1B[?25h');
|
|
994
993
|
|
|
994
|
+
// Print stop reason message
|
|
995
|
+
console.log();
|
|
995
996
|
console.log();
|
|
996
997
|
if (stopReason === 'target') {
|
|
997
|
-
console.log(chalk.green.bold('
|
|
998
|
+
console.log(chalk.green.bold(' [OK] Daily target reached! Algo stopped.'));
|
|
998
999
|
} else if (stopReason === 'risk') {
|
|
999
|
-
console.log(chalk.red.bold('
|
|
1000
|
+
console.log(chalk.red.bold(' [X] Max risk reached! Algo stopped.'));
|
|
1000
1001
|
} else if (stopReason === 'disconnected' || stopReason === 'connection_error') {
|
|
1001
|
-
console.log(chalk.red.bold('
|
|
1002
|
+
console.log(chalk.red.bold(' [X] Connection lost! Algo stopped.'));
|
|
1002
1003
|
} else if (stopReason === 'user') {
|
|
1003
|
-
console.log(chalk.yellow('
|
|
1004
|
+
console.log(chalk.yellow(' [OK] Algo stopped by user'));
|
|
1004
1005
|
} else {
|
|
1005
|
-
console.log(chalk.yellow('
|
|
1006
|
+
console.log(chalk.yellow(' [OK] Algo stopped by user'));
|
|
1006
1007
|
}
|
|
1007
1008
|
console.log();
|
|
1008
1009
|
|