hedgequantx 2.9.209 → 2.9.211

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.209",
3
+ "version": "2.9.211",
4
4
  "description": "HedgeQuantX - Prop Futures Trading CLI",
5
5
  "main": "src/app.js",
6
6
  "bin": {
@@ -51,6 +51,7 @@ class SmartLogsEngine {
51
51
  this.symbolCode = symbol;
52
52
  this.counter = 0;
53
53
  this.lastState = null;
54
+ this.lastHeartbeat = 0;
54
55
 
55
56
  // State tracking for event detection (both strategies)
56
57
  this.lastBias = null;
@@ -220,8 +221,22 @@ class SmartLogsEngine {
220
221
  this.lastVpinToxic = vpinToxic;
221
222
 
222
223
  if (event && message) {
224
+ this.lastHeartbeat = Date.now();
223
225
  return { type: logType, message, logToSession: event === 'z_regime' || event === 'bias_flip' };
224
226
  }
227
+
228
+ // HEARTBEAT: Show status every 30s when no events (proves strategy is active)
229
+ const now = Date.now();
230
+ if (this.warmupLogged && now - this.lastHeartbeat >= 30000) {
231
+ this.lastHeartbeat = now;
232
+ const liveMsg = smartLogs.getLiveAnalysisLog({ trend: bias, bars: ticks, swings: 0, zones: 0, nearZone: false, setupForming: false });
233
+ return {
234
+ type: 'analysis',
235
+ message: `[${sym}] ${price} | Z: ${zScore.toFixed(1)}σ | OFI: ${(ofi * 100).toFixed(0)}% | ${liveMsg}`,
236
+ logToSession: false
237
+ };
238
+ }
239
+
225
240
  return null;
226
241
  }
227
242
 
@@ -230,6 +245,7 @@ class SmartLogsEngine {
230
245
  this.counter = 0;
231
246
  this.lastBias = null;
232
247
  this.warmupLogged = false;
248
+ this.lastHeartbeat = 0;
233
249
  // HQX-2B
234
250
  this.lastBars = 0;
235
251
  this.lastSwings = 0;
@@ -344,20 +344,25 @@ const executeAlgo = async ({ service, account, contract, config, strategy: strat
344
344
  await marketFeed.connect(rithmicCredentials);
345
345
  await marketFeed.subscribe(symbolCode, contract.exchange || 'CME');
346
346
 
347
- // Load historical bars for instant warmup
347
+ // Load historical data for model warmup (optional - works with live data too)
348
348
  if (strategy.preloadBars) {
349
- ui.addLog('system', 'Loading historical data...');
349
+ ui.addLog('system', 'Loading warmup data...');
350
350
  try {
351
351
  const histBars = await marketFeed.getHistoricalBars(symbolCode, contract.exchange || 'CME', 30);
352
352
  if (histBars && histBars.length > 0) {
353
353
  strategy.preloadBars(contractId, histBars);
354
- ui.addLog('system', `Loaded ${histBars.length} historical bars - ready to trade!`);
355
- sessionLogger.log('HISTORY', `Preloaded ${histBars.length} bars`);
354
+ // Different message for tick-based vs bar-based strategies
355
+ const isTickBased = strategyId === 'ultra-scalping';
356
+ const msg = isTickBased
357
+ ? `Warmup data loaded - QUANT models initializing...`
358
+ : `Loaded ${histBars.length} historical bars - ready to trade!`;
359
+ ui.addLog('system', msg);
360
+ sessionLogger.log('HISTORY', `Preloaded ${histBars.length} bars for warmup`);
356
361
  } else {
357
- ui.addLog('system', 'No history available - warming up with live data...');
362
+ ui.addLog('system', 'No history - warming up with live ticks...');
358
363
  }
359
364
  } catch (histErr) {
360
- ui.addLog('system', `History load failed: ${histErr.message} - using live data`);
365
+ ui.addLog('system', `Warmup skipped - using live data`);
361
366
  sessionLogger.log('HISTORY', `Failed: ${histErr.message}`);
362
367
  }
363
368
  }