hedgequantx 2.9.166 → 2.9.167
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
CHANGED
|
@@ -359,53 +359,12 @@ class RithmicBrokerDaemon {
|
|
|
359
359
|
error: result.error
|
|
360
360
|
});
|
|
361
361
|
|
|
362
|
-
// If no contracts found, return fallback list for common futures
|
|
363
|
-
if (!result.success || result.contracts?.length === 0) {
|
|
364
|
-
log('WARN', 'Using fallback contracts list');
|
|
365
|
-
const fallbackContracts = this._getFallbackContracts();
|
|
366
|
-
return { type: 'contracts', payload: { success: true, contracts: fallbackContracts, source: 'fallback' }, requestId };
|
|
367
|
-
}
|
|
368
|
-
|
|
369
362
|
return { type: 'contracts', payload: result, requestId };
|
|
370
363
|
} catch (err) {
|
|
371
364
|
log('ERROR', 'getContracts exception', { propfirm: payload.propfirmKey, error: err.message, stack: err.stack?.split('\n')[1] });
|
|
372
|
-
|
|
373
|
-
log('WARN', 'Using fallback contracts due to error');
|
|
374
|
-
const fallbackContracts = this._getFallbackContracts();
|
|
375
|
-
return { type: 'contracts', payload: { success: true, contracts: fallbackContracts, source: 'fallback' }, requestId };
|
|
365
|
+
return { type: 'contracts', payload: { success: false, error: err.message, contracts: [] }, requestId };
|
|
376
366
|
}
|
|
377
367
|
}
|
|
378
|
-
|
|
379
|
-
/**
|
|
380
|
-
* Get fallback contracts list when TICKER_PLANT fails
|
|
381
|
-
* These are common futures that most prop firms support
|
|
382
|
-
*/
|
|
383
|
-
_getFallbackContracts() {
|
|
384
|
-
const now = new Date();
|
|
385
|
-
const month = now.getMonth();
|
|
386
|
-
const year = now.getFullYear();
|
|
387
|
-
|
|
388
|
-
// Determine front month code (H=Mar, M=Jun, U=Sep, Z=Dec for indices)
|
|
389
|
-
const monthCodes = ['H', 'H', 'H', 'M', 'M', 'M', 'U', 'U', 'U', 'Z', 'Z', 'Z'];
|
|
390
|
-
const frontMonth = monthCodes[month];
|
|
391
|
-
const yearCode = String(year).slice(-1);
|
|
392
|
-
const suffix = frontMonth + yearCode;
|
|
393
|
-
|
|
394
|
-
return [
|
|
395
|
-
{ symbol: `MNQ${suffix}`, baseSymbol: 'MNQ', name: 'Micro E-mini Nasdaq-100', exchange: 'CME', tickSize: 0.25 },
|
|
396
|
-
{ symbol: `MES${suffix}`, baseSymbol: 'MES', name: 'Micro E-mini S&P 500', exchange: 'CME', tickSize: 0.25 },
|
|
397
|
-
{ symbol: `NQ${suffix}`, baseSymbol: 'NQ', name: 'E-mini Nasdaq-100', exchange: 'CME', tickSize: 0.25 },
|
|
398
|
-
{ symbol: `ES${suffix}`, baseSymbol: 'ES', name: 'E-mini S&P 500', exchange: 'CME', tickSize: 0.25 },
|
|
399
|
-
{ symbol: `MCL${suffix}`, baseSymbol: 'MCL', name: 'Micro WTI Crude Oil', exchange: 'NYMEX', tickSize: 0.01 },
|
|
400
|
-
{ symbol: `MGC${suffix}`, baseSymbol: 'MGC', name: 'Micro Gold', exchange: 'COMEX', tickSize: 0.10 },
|
|
401
|
-
{ symbol: `M2K${suffix}`, baseSymbol: 'M2K', name: 'Micro E-mini Russell 2000', exchange: 'CME', tickSize: 0.10 },
|
|
402
|
-
{ symbol: `MYM${suffix}`, baseSymbol: 'MYM', name: 'Micro E-mini Dow', exchange: 'CBOT', tickSize: 0.50 },
|
|
403
|
-
{ symbol: `RTY${suffix}`, baseSymbol: 'RTY', name: 'E-mini Russell 2000', exchange: 'CME', tickSize: 0.10 },
|
|
404
|
-
{ symbol: `YM${suffix}`, baseSymbol: 'YM', name: 'E-mini Dow', exchange: 'CBOT', tickSize: 1.00 },
|
|
405
|
-
{ symbol: `CL${suffix}`, baseSymbol: 'CL', name: 'Crude Oil', exchange: 'NYMEX', tickSize: 0.01 },
|
|
406
|
-
{ symbol: `GC${suffix}`, baseSymbol: 'GC', name: 'Gold', exchange: 'COMEX', tickSize: 0.10 },
|
|
407
|
-
];
|
|
408
|
-
}
|
|
409
368
|
|
|
410
369
|
async _handleSearchContracts(payload, requestId) {
|
|
411
370
|
const conn = this.connections.get(payload.propfirmKey);
|