hedgequantx 1.2.111 → 1.2.113
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 +3 -20
- package/src/pages/algo.js +43 -12
package/package.json
CHANGED
package/src/app.js
CHANGED
|
@@ -690,29 +690,12 @@ 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
|
|
706
693
|
try {
|
|
707
|
-
|
|
708
|
-
if (newVersion !== currentVersion) {
|
|
709
|
-
console.log(chalk.green(` [OK] Updated to v${newVersion}`));
|
|
710
|
-
console.log(chalk.cyan(' Restart HQX to apply changes.'));
|
|
711
|
-
}
|
|
694
|
+
exec('npm install -g hedgequantx@latest', { stdio: 'pipe' });
|
|
712
695
|
} catch (e) {
|
|
713
|
-
|
|
696
|
+
spinner.fail('Update failed - try manually: npm install -g hedgequantx@latest');
|
|
697
|
+
return;
|
|
714
698
|
}
|
|
715
|
-
return;
|
|
716
699
|
|
|
717
700
|
spinner.succeed('CLI updated!');
|
|
718
701
|
console.log();
|
package/src/pages/algo.js
CHANGED
|
@@ -160,19 +160,17 @@ const selectSymbolMenu = async (service, account) => {
|
|
|
160
160
|
let availableSymbols = [];
|
|
161
161
|
|
|
162
162
|
// Search for common symbols to get available contracts (including micros)
|
|
163
|
+
// Use various search terms to find all contracts
|
|
163
164
|
const commonSearches = [
|
|
164
|
-
'NQ', '
|
|
165
|
-
'
|
|
166
|
-
'
|
|
167
|
-
'
|
|
168
|
-
'
|
|
169
|
-
'
|
|
170
|
-
'
|
|
171
|
-
'
|
|
172
|
-
'
|
|
173
|
-
'ZB', 'ZN', 'ZF', 'ZT', // Treasuries
|
|
174
|
-
'NG', 'QG', // Natural Gas
|
|
175
|
-
'HG', 'PL' // Copper, Platinum
|
|
165
|
+
'NQ', 'ES', 'YM', 'RTY', // E-mini indices
|
|
166
|
+
'Micro', 'MNQ', 'MES', 'MYM', 'M2K', // Micro indices (try multiple search terms)
|
|
167
|
+
'CL', 'MCL', 'QM', // Crude Oil
|
|
168
|
+
'GC', 'MGC', // Gold
|
|
169
|
+
'SI', 'SIL', // Silver
|
|
170
|
+
'6E', 'M6E', '6B', '6J', '6A', '6C', // Currencies
|
|
171
|
+
'ZB', 'ZN', 'ZF', 'ZT', // Treasuries
|
|
172
|
+
'NG', 'QG', // Natural Gas
|
|
173
|
+
'HG', 'PL' // Copper, Platinum
|
|
176
174
|
];
|
|
177
175
|
|
|
178
176
|
try {
|
|
@@ -210,6 +208,39 @@ const selectSymbolMenu = async (service, account) => {
|
|
|
210
208
|
// Fallback to static list
|
|
211
209
|
}
|
|
212
210
|
|
|
211
|
+
// Add micro contracts if not found from API
|
|
212
|
+
const microContracts = [
|
|
213
|
+
{ symbol: 'MNQ', name: 'Micro E-mini NASDAQ-100' },
|
|
214
|
+
{ symbol: 'MES', name: 'Micro E-mini S&P 500' },
|
|
215
|
+
{ symbol: 'MYM', name: 'Micro E-mini Dow Jones' },
|
|
216
|
+
{ symbol: 'M2K', name: 'Micro E-mini Russell 2000' },
|
|
217
|
+
{ symbol: 'MCL', name: 'Micro Crude Oil' },
|
|
218
|
+
{ symbol: 'MGC', name: 'Micro Gold' }
|
|
219
|
+
];
|
|
220
|
+
|
|
221
|
+
// Get current month code for front month
|
|
222
|
+
const now = new Date();
|
|
223
|
+
const monthCodes = ['F', 'G', 'H', 'J', 'K', 'M', 'N', 'Q', 'U', 'V', 'X', 'Z'];
|
|
224
|
+
const currentMonthCode = monthCodes[now.getMonth()];
|
|
225
|
+
const yearCode = (now.getFullYear() % 100).toString();
|
|
226
|
+
|
|
227
|
+
for (const micro of microContracts) {
|
|
228
|
+
const hasMicro = availableSymbols.some(s =>
|
|
229
|
+
(s.symbol && s.symbol.toUpperCase().startsWith(micro.symbol)) ||
|
|
230
|
+
(s.name && s.name.toUpperCase().includes(micro.symbol))
|
|
231
|
+
);
|
|
232
|
+
if (!hasMicro) {
|
|
233
|
+
// Add micro contract with front month
|
|
234
|
+
availableSymbols.push({
|
|
235
|
+
id: `${micro.symbol}${currentMonthCode}${yearCode}`,
|
|
236
|
+
name: `${micro.symbol}${currentMonthCode}${yearCode}`,
|
|
237
|
+
symbol: `${micro.symbol}${currentMonthCode}${yearCode}`,
|
|
238
|
+
description: micro.name,
|
|
239
|
+
exchange: 'CME'
|
|
240
|
+
});
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
|
|
213
244
|
// If no symbols found from API, use static list
|
|
214
245
|
if (availableSymbols.length === 0) {
|
|
215
246
|
spinner.warn('Using default symbol list');
|