hedgequantx 1.2.119 → 1.2.121
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 +7 -17
- package/src/pages/algo.js +7 -2
package/package.json
CHANGED
package/src/app.js
CHANGED
|
@@ -7,7 +7,7 @@ const chalk = require('chalk');
|
|
|
7
7
|
const inquirer = require('inquirer');
|
|
8
8
|
const ora = require('ora');
|
|
9
9
|
const figlet = require('figlet');
|
|
10
|
-
const { execSync } = require('child_process');
|
|
10
|
+
const { execSync, spawn } = require('child_process');
|
|
11
11
|
const path = require('path');
|
|
12
12
|
|
|
13
13
|
const { ProjectXService, connections } = require('./services');
|
|
@@ -691,32 +691,22 @@ const handleUpdate = async () => {
|
|
|
691
691
|
// Update via npm
|
|
692
692
|
spinner.text = `Updating v${currentVersion} -> v${latestVersion}...`;
|
|
693
693
|
try {
|
|
694
|
-
|
|
694
|
+
execSync('npm install -g hedgequantx@latest', { stdio: 'pipe' });
|
|
695
695
|
} catch (e) {
|
|
696
696
|
spinner.fail('Update failed - try manually: npm install -g hedgequantx@latest');
|
|
697
|
+
console.log(chalk.gray(` Error: ${e.message}`));
|
|
697
698
|
return;
|
|
698
699
|
}
|
|
699
700
|
|
|
700
701
|
spinner.succeed('CLI updated!');
|
|
701
702
|
console.log();
|
|
702
|
-
console.log(chalk.green(`
|
|
703
|
+
console.log(chalk.green(` Updated: v${currentVersion} -> v${latestVersion}`));
|
|
703
704
|
console.log();
|
|
704
|
-
console.log(chalk.cyan('
|
|
705
|
+
console.log(chalk.cyan(' Please restart HQX to apply changes.'));
|
|
705
706
|
console.log();
|
|
706
707
|
|
|
707
|
-
//
|
|
708
|
-
|
|
709
|
-
const child = spawn(process.argv[0], [path.join(cliPath, 'hedgequantx', 'bin', 'cli.js')], {
|
|
710
|
-
stdio: 'inherit',
|
|
711
|
-
shell: true
|
|
712
|
-
});
|
|
713
|
-
|
|
714
|
-
child.on('exit', (code) => {
|
|
715
|
-
process.exit(code);
|
|
716
|
-
});
|
|
717
|
-
|
|
718
|
-
// Stop current process loop
|
|
719
|
-
return 'restart';
|
|
708
|
+
// Exit so user can restart
|
|
709
|
+
process.exit(0);
|
|
720
710
|
|
|
721
711
|
} catch (error) {
|
|
722
712
|
spinner.fail('Update failed: ' + error.message);
|
package/src/pages/algo.js
CHANGED
|
@@ -792,6 +792,11 @@ const launchAlgo = async (service, account, contract, numContracts, dailyTarget,
|
|
|
792
792
|
if (hqxConnected) {
|
|
793
793
|
printLog('info', 'Starting HQX Ultra-Scalping...');
|
|
794
794
|
printLog('info', `Target: $${dailyTarget.toFixed(2)} | Risk: $${maxRisk.toFixed(2)}`);
|
|
795
|
+
|
|
796
|
+
// Get propfirm token for real market data
|
|
797
|
+
const propfirmToken = service.getToken ? service.getToken() : null;
|
|
798
|
+
const propfirmId = service.getPropfirm ? service.getPropfirm() : (account.propfirm || 'topstep');
|
|
799
|
+
|
|
795
800
|
hqxServer.startAlgo({
|
|
796
801
|
accountId: account.accountId,
|
|
797
802
|
contractId: contract.id || contract.contractId,
|
|
@@ -799,8 +804,8 @@ const launchAlgo = async (service, account, contract, numContracts, dailyTarget,
|
|
|
799
804
|
contracts: numContracts,
|
|
800
805
|
dailyTarget: dailyTarget,
|
|
801
806
|
maxRisk: maxRisk,
|
|
802
|
-
propfirm:
|
|
803
|
-
propfirmToken:
|
|
807
|
+
propfirm: propfirmId,
|
|
808
|
+
propfirmToken: propfirmToken
|
|
804
809
|
});
|
|
805
810
|
algoRunning = true;
|
|
806
811
|
} else {
|