hedgequantx 1.2.92 → 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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/pages/algo.js +15 -8
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hedgequantx",
3
- "version": "1.2.92",
3
+ "version": "1.2.94",
4
4
  "description": "Prop Futures Algo Trading CLI - Connect to Topstep, Alpha Futures, and other prop firms",
5
5
  "main": "src/app.js",
6
6
  "bin": {
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
- // Parse name like "E-mini NASDAQ-100 Mar26" or "NQH6"
211
- let displayName = name;
212
- let code = symbol.symbol || '';
209
+ const symbolCode = symbol.symbol || symbol.id || '';
213
210
 
214
- // Try to extract month/year from name
215
- const monthMatch = name.match(/(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)(\d{2})/i);
216
- const monthYear = monthMatch ? `${monthMatch[1]}${monthMatch[2]}` : '';
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(code.padEnd(5)) + chalk.cyan((monthYear || '').padEnd(7)) + chalk.white(displayName),
226
+ name: chalk.yellow(baseSymbol.padEnd(5)) + chalk.cyan(monthYear.padEnd(7)) + chalk.white(name),
220
227
  value: symbol
221
228
  };
222
229
  });