hedgequantx 1.2.121 → 1.2.122

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 +47 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hedgequantx",
3
- "version": "1.2.121",
3
+ "version": "1.2.122",
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
@@ -221,8 +221,54 @@ const selectSymbolMenu = async (service, account) => {
221
221
  });
222
222
  }
223
223
 
224
- // Sort by symbol code for better organization
224
+ // Sort by category: E-mini indices first, then Micro E-mini, then others
225
+ const getSymbolPriority = (contract) => {
226
+ const name = (contract.name || contract.symbol || '').toUpperCase();
227
+ const desc = (contract.description || '').toLowerCase();
228
+
229
+ // E-mini indices (NQ, ES, YM, RTY) - highest priority
230
+ if (name.match(/^(NQ|ES|YM|RTY)[A-Z]\d/) && !name.startsWith('M')) {
231
+ if (name.startsWith('NQ')) return 10;
232
+ if (name.startsWith('ES')) return 11;
233
+ if (name.startsWith('YM')) return 12;
234
+ if (name.startsWith('RTY')) return 13;
235
+ return 15;
236
+ }
237
+
238
+ // Micro E-mini indices (MNQ, MES, MYM, M2K)
239
+ if (name.match(/^(MNQ|MES|MYM|M2K)/)) {
240
+ if (name.startsWith('MNQ')) return 20;
241
+ if (name.startsWith('MES')) return 21;
242
+ if (name.startsWith('MYM')) return 22;
243
+ if (name.startsWith('M2K')) return 23;
244
+ return 25;
245
+ }
246
+
247
+ // Energy (CL, MCL, NG)
248
+ if (name.match(/^(CL|MCL|NG|QG)/)) return 30;
249
+
250
+ // Metals (GC, MGC, SI)
251
+ if (name.match(/^(GC|MGC|SI|HG|PL)/)) return 40;
252
+
253
+ // Currencies (6E, 6B, etc)
254
+ if (name.match(/^(6E|6B|6J|6A|6C|M6E)/)) return 50;
255
+
256
+ // Treasuries (ZB, ZN, ZF, ZT)
257
+ if (name.match(/^(ZB|ZN|ZF|ZT)/)) return 60;
258
+
259
+ // Everything else
260
+ return 100;
261
+ };
262
+
225
263
  symbolChoices.sort((a, b) => {
264
+ const priorityA = getSymbolPriority(a.value);
265
+ const priorityB = getSymbolPriority(b.value);
266
+
267
+ if (priorityA !== priorityB) {
268
+ return priorityA - priorityB;
269
+ }
270
+
271
+ // Same priority - sort alphabetically
226
272
  const aCode = a.value.name || a.value.symbol || '';
227
273
  const bCode = b.value.name || b.value.symbol || '';
228
274
  return aCode.localeCompare(bCode);