hedgequantx 1.2.99 → 1.2.100
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 +2 -1
- package/src/pages/algo.js +18 -6
package/package.json
CHANGED
package/src/app.js
CHANGED
|
@@ -579,7 +579,8 @@ const mainMenu = async () => {
|
|
|
579
579
|
*/
|
|
580
580
|
const dashboardMenu = async (service) => {
|
|
581
581
|
const user = service.user;
|
|
582
|
-
const
|
|
582
|
+
const boxWidth = getLogoWidth();
|
|
583
|
+
const W = boxWidth - 2; // Same width as logo (inner width)
|
|
583
584
|
|
|
584
585
|
// Helper to center text
|
|
585
586
|
const centerLine = (text, width) => {
|
package/src/pages/algo.js
CHANGED
|
@@ -241,8 +241,11 @@ const selectSymbolMenu = async (service, account) => {
|
|
|
241
241
|
'ZW': 'Wheat'
|
|
242
242
|
};
|
|
243
243
|
|
|
244
|
-
// Format symbols for display
|
|
245
|
-
const
|
|
244
|
+
// Format symbols for display - deduplicate by base symbol + month
|
|
245
|
+
const seenSymbols = new Set();
|
|
246
|
+
const symbolChoices = [];
|
|
247
|
+
|
|
248
|
+
for (const symbol of availableSymbols) {
|
|
246
249
|
const symbolCode = symbol.symbol || symbol.id || '';
|
|
247
250
|
|
|
248
251
|
// Extract base symbol (e.g., NQ from NQH6) and month code
|
|
@@ -258,15 +261,20 @@ const selectSymbolMenu = async (service, account) => {
|
|
|
258
261
|
monthYear = (monthCodes[monthCode] || monthCode) + year;
|
|
259
262
|
}
|
|
260
263
|
|
|
264
|
+
// Create unique key to deduplicate
|
|
265
|
+
const uniqueKey = `${baseSymbol}-${monthYear}`;
|
|
266
|
+
if (seenSymbols.has(uniqueKey)) continue;
|
|
267
|
+
seenSymbols.add(uniqueKey);
|
|
268
|
+
|
|
261
269
|
// Get descriptive name from mapping
|
|
262
270
|
const description = symbolDescriptions[baseSymbol] || symbol.name || baseSymbol;
|
|
263
271
|
|
|
264
272
|
// Format: "NQ Mar26 E-mini NASDAQ-100"
|
|
265
|
-
|
|
273
|
+
symbolChoices.push({
|
|
266
274
|
name: chalk.yellow(baseSymbol.padEnd(5)) + chalk.cyan(monthYear.padEnd(7)) + chalk.white(description),
|
|
267
275
|
value: symbol
|
|
268
|
-
};
|
|
269
|
-
}
|
|
276
|
+
});
|
|
277
|
+
}
|
|
270
278
|
|
|
271
279
|
symbolChoices.push(new inquirer.Separator());
|
|
272
280
|
symbolChoices.push({ name: chalk.yellow('< Back'), value: 'back' });
|
|
@@ -506,9 +514,10 @@ const launchAlgo = async (service, account, contract, numContracts, dailyTarget,
|
|
|
506
514
|
// Use ANSI escape codes to avoid flickering
|
|
507
515
|
let firstDraw = true;
|
|
508
516
|
const displayUI = () => {
|
|
509
|
-
// First time: clear screen, after: just move cursor to top
|
|
517
|
+
// First time: clear screen and hide cursor, after: just move cursor to top
|
|
510
518
|
if (firstDraw) {
|
|
511
519
|
console.clear();
|
|
520
|
+
process.stdout.write('\x1B[?25l'); // Hide cursor
|
|
512
521
|
firstDraw = false;
|
|
513
522
|
} else {
|
|
514
523
|
// Move cursor to top-left without clearing (avoids flicker)
|
|
@@ -871,6 +880,9 @@ const launchAlgo = async (service, account, contract, numContracts, dailyTarget,
|
|
|
871
880
|
// Clear spinner interval
|
|
872
881
|
clearInterval(spinnerInterval);
|
|
873
882
|
|
|
883
|
+
// Show cursor again
|
|
884
|
+
process.stdout.write('\x1B[?25h');
|
|
885
|
+
|
|
874
886
|
// Stop algo
|
|
875
887
|
console.log();
|
|
876
888
|
if (!stopReason) {
|