hedgequantx 2.9.121 → 2.9.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hedgequantx",
3
- "version": "2.9.121",
3
+ "version": "2.9.122",
4
4
  "description": "HedgeQuantX - Prop Futures Trading CLI",
5
5
  "main": "src/app.js",
6
6
  "bin": {
@@ -34,9 +34,9 @@ const executeAlgo = async ({ service, account, contract, config, strategy: strat
34
34
  const accountName = showName
35
35
  ? (account.accountName || account.rithmicAccountId || account.accountId)
36
36
  : 'HQX *****';
37
- const symbolName = contract.name; // Display name: "Micro E-mini S&P 500"
38
- const symbolCode = contract.symbol || contract.id; // Rithmic symbol: "MESH6"
39
- const contractId = contract.id;
37
+ const symbolName = contract.name || contract.baseSymbol || 'Unknown';
38
+ const symbolCode = contract.symbol || contract.baseSymbol || contract.id; // Rithmic symbol for subscription
39
+ const contractId = contract.symbol || contract.baseSymbol || contract.id; // For strategy tracking
40
40
  const tickSize = contract.tickSize || 0.25;
41
41
 
42
42
  const ui = new AlgoUI({
@@ -87,6 +87,10 @@ const executeAlgo = async ({ service, account, contract, config, strategy: strat
87
87
  risk: maxRisk
88
88
  });
89
89
 
90
+ // Log detailed contract info for debugging
91
+ sessionLogger.log('CONFIG', `symbolCode=${symbolCode} contractId=${contractId} exchange=${contract.exchange} tickSize=${tickSize}`);
92
+ sessionLogger.log('CONFIG', `account=${account.accountId} rithmicId=${account.rithmicAccountId || 'N/A'}`);
93
+
90
94
  strategy.on('log', (log) => {
91
95
  const type = log.type === 'debug' ? 'debug' : log.type === 'info' ? 'analysis' : 'system';
92
96
  ui.addLog(type, log.message);
@@ -243,6 +247,12 @@ const executeAlgo = async ({ service, account, contract, config, strategy: strat
243
247
  const now = Date.now();
244
248
  const currentSecond = Math.floor(now / 1000);
245
249
 
250
+ // Debug first 5 ticks to verify data
251
+ if (tickCount <= 5) {
252
+ const p = Number(tick.price) || Number(tick.tradePrice) || 'NULL';
253
+ sessionLogger.log('TICK', `#${tickCount} price=${p} symbol=${tick.symbol || tick.contractId || 'N/A'}`);
254
+ }
255
+
246
256
  // Count ticks per second
247
257
  if (currentSecond === lastTickSecond) {
248
258
  ticksPerSecond++;
@@ -347,13 +357,16 @@ const executeAlgo = async ({ service, account, contract, config, strategy: strat
347
357
  lastBid = bid;
348
358
  lastAsk = ask;
349
359
 
350
- strategy.processTick({
351
- contractId: tick.contractId || contractId,
352
- price: price, bid: bid, ask: ask,
353
- volume: volume,
354
- side: tick.side || tick.lastTradeSide || 'unknown',
355
- timestamp: tick.timestamp || Date.now()
356
- });
360
+ // Only process tick if we have a valid price
361
+ if (price && price > 0) {
362
+ strategy.processTick({
363
+ contractId: tick.contractId || contractId,
364
+ price: price, bid: bid, ask: ask,
365
+ volume: volume,
366
+ side: tick.side || tick.lastTradeSide || 'unknown',
367
+ timestamp: tick.timestamp || Date.now()
368
+ });
369
+ }
357
370
 
358
371
  // Calculate latency from Rithmic ssboe/usecs or inter-tick timing
359
372
  if (tick.ssboe && tick.usecs !== undefined) {