hedgequantx 1.2.93 → 1.2.94
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 +15 -8
package/package.json
CHANGED
package/src/pages/algo.js
CHANGED
|
@@ -205,18 +205,25 @@ const selectSymbolMenu = async (service, account) => {
|
|
|
205
205
|
|
|
206
206
|
// Format symbols for display
|
|
207
207
|
const symbolChoices = availableSymbols.map(symbol => {
|
|
208
|
-
// Extract short code and description
|
|
209
208
|
const name = symbol.name || symbol.symbol || symbol.id;
|
|
210
|
-
|
|
211
|
-
let displayName = name;
|
|
212
|
-
let code = symbol.symbol || '';
|
|
209
|
+
const symbolCode = symbol.symbol || symbol.id || '';
|
|
213
210
|
|
|
214
|
-
//
|
|
215
|
-
const
|
|
216
|
-
|
|
211
|
+
// Extract base symbol (e.g., NQ from NQH6) and month code
|
|
212
|
+
const baseMatch = symbolCode.match(/^([A-Z]{1,4})([FGHJKMNQUVXZ])(\d{1,2})$/i);
|
|
213
|
+
let baseSymbol = symbolCode;
|
|
214
|
+
let monthYear = '';
|
|
217
215
|
|
|
216
|
+
if (baseMatch) {
|
|
217
|
+
baseSymbol = baseMatch[1];
|
|
218
|
+
const monthCodes = { F: 'Jan', G: 'Feb', H: 'Mar', J: 'Apr', K: 'May', M: 'Jun', N: 'Jul', Q: 'Aug', U: 'Sep', V: 'Oct', X: 'Nov', Z: 'Dec' };
|
|
219
|
+
const monthCode = baseMatch[2].toUpperCase();
|
|
220
|
+
const year = baseMatch[3].length === 1 ? '2' + baseMatch[3] : baseMatch[3];
|
|
221
|
+
monthYear = (monthCodes[monthCode] || monthCode) + year;
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
// Format: "NQ Mar26 E-mini NASDAQ-100 Mar26"
|
|
218
225
|
return {
|
|
219
|
-
name: chalk.yellow(
|
|
226
|
+
name: chalk.yellow(baseSymbol.padEnd(5)) + chalk.cyan(monthYear.padEnd(7)) + chalk.white(name),
|
|
220
227
|
value: symbol
|
|
221
228
|
};
|
|
222
229
|
});
|