hedgequantx 2.9.251 → 2.9.252
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
|
@@ -445,6 +445,11 @@ const executeAlgo = async ({ service, account, contract, config, strategy: strat
|
|
|
445
445
|
if (Date.now() % 10000 < 2000) {
|
|
446
446
|
const posResult = await service.getPositions(accId);
|
|
447
447
|
if (posResult.success && posResult.positions) {
|
|
448
|
+
// Debug: log all positions
|
|
449
|
+
if (posResult.positions.length > 0) {
|
|
450
|
+
console.log('[Position] Raw positions:', JSON.stringify(posResult.positions));
|
|
451
|
+
}
|
|
452
|
+
|
|
448
453
|
const pos = posResult.positions.find(p => {
|
|
449
454
|
const sym = p.contractId || p.symbol || '';
|
|
450
455
|
return sym.includes(contract.name) || sym.includes(contractId);
|
|
@@ -452,6 +457,7 @@ const executeAlgo = async ({ service, account, contract, config, strategy: strat
|
|
|
452
457
|
if (pos && pos.quantity !== 0) {
|
|
453
458
|
// Validate quantity is reasonable (prevent overflow values)
|
|
454
459
|
const qty = parseInt(pos.quantity);
|
|
460
|
+
console.log('[Position] Found:', pos.symbol || pos.contractId, 'qty:', qty);
|
|
455
461
|
if (!isNaN(qty) && Math.abs(qty) < 1000) {
|
|
456
462
|
currentPosition = qty;
|
|
457
463
|
}
|