hedgequantx 2.6.36 → 2.6.37
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
|
@@ -341,6 +341,25 @@ const launchAlgo = async (service, account, contract, config) => {
|
|
|
341
341
|
positionManager.on('exitOrderFired', ({ orderTag, exitReason, latencyMs }) => {
|
|
342
342
|
algoLogger.info(ui, 'EXIT FIRED', `${exitReason.reason} | ${latencyMs.toFixed(1)}ms`);
|
|
343
343
|
});
|
|
344
|
+
|
|
345
|
+
// DEBUG: Listen for raw order notifications from Rithmic
|
|
346
|
+
service.on('orderAccepted', (data) => {
|
|
347
|
+
algoLogger.info(ui, 'ORDER ACCEPTED', `tag=${data.orderTag} basket=${data.basketId}`);
|
|
348
|
+
});
|
|
349
|
+
|
|
350
|
+
service.on('orderNotification', (data) => {
|
|
351
|
+
const status = data.status || 'unknown';
|
|
352
|
+
const fillQty = data.fillQuantity || data.totalFillQuantity || 0;
|
|
353
|
+
if (fillQty > 0) {
|
|
354
|
+
algoLogger.info(ui, 'ORDER FILL', `tag=${data.orderTag} qty=${fillQty} @ ${data.avgFillPrice}`);
|
|
355
|
+
} else {
|
|
356
|
+
algoLogger.info(ui, 'ORDER STATUS', `tag=${data.orderTag} status=${status}`);
|
|
357
|
+
}
|
|
358
|
+
});
|
|
359
|
+
|
|
360
|
+
service.on('orderFilled', (data) => {
|
|
361
|
+
algoLogger.info(ui, 'FILL CONFIRMED', `${data.transactionType === 1 ? 'BUY' : 'SELL'} ${data.fillQuantity}x @ ${data.avgFillPrice}`);
|
|
362
|
+
});
|
|
344
363
|
}
|
|
345
364
|
|
|
346
365
|
// Initialize AI Strategy Supervisor - agents observe, learn & optimize
|
|
@@ -442,9 +461,21 @@ const launchAlgo = async (service, account, contract, config) => {
|
|
|
442
461
|
side: orderSide,
|
|
443
462
|
};
|
|
444
463
|
|
|
464
|
+
// CRITICAL: Use rithmicAccountId (original) not accountId (hash) for Rithmic orders
|
|
465
|
+
// The accountId field is hashed for display, but Rithmic API needs the original
|
|
466
|
+
if (account.rithmicAccountId) {
|
|
467
|
+
orderData.accountId = account.rithmicAccountId;
|
|
468
|
+
}
|
|
469
|
+
|
|
470
|
+
// Log order details before sending
|
|
471
|
+
algoLogger.info(ui, 'ORDER DATA', `acct=${orderData.accountId} sym=${orderData.symbol} side=${orderData.side} qty=${orderData.size}`);
|
|
472
|
+
|
|
445
473
|
// Fire-and-forget entry (no await on fill)
|
|
446
474
|
const entryResult = service.fastEntry(orderData);
|
|
447
475
|
|
|
476
|
+
// Log the order tag for tracking
|
|
477
|
+
algoLogger.info(ui, 'ORDER TAG', `${entryResult.orderTag} | success=${entryResult.success}`);
|
|
478
|
+
|
|
448
479
|
if (entryResult.success) {
|
|
449
480
|
// Register with position manager for lifecycle tracking
|
|
450
481
|
// Pass contract info from API (NOT hardcoded)
|