hedgequantx 2.9.123 → 2.9.124
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 +1 -1
- package/src/pages/algo/algo-executor.js +15 -25
package/package.json
CHANGED
|
@@ -277,11 +277,18 @@ const executeAlgo = async ({ service, account, contract, config, strategy: strat
|
|
|
277
277
|
else if (price < lastPrice) sellVolume += volume;
|
|
278
278
|
}
|
|
279
279
|
|
|
280
|
-
// Log first tick
|
|
280
|
+
// Log first tick and periodic tick count
|
|
281
281
|
if (tickCount === 1) {
|
|
282
282
|
ui.addLog('connected', `First tick @ ${price?.toFixed(2) || 'N/A'}`);
|
|
283
283
|
}
|
|
284
284
|
|
|
285
|
+
// Log tick count every 10 seconds to confirm data flow
|
|
286
|
+
if (tickCount % 1000 === 0 || (currentSecond % 10 === 0 && currentSecond !== lastLogSecond)) {
|
|
287
|
+
const state = strategy.getAnalysisState?.(contractId, price);
|
|
288
|
+
const bars = state?.barsProcessed || 0;
|
|
289
|
+
ui.addLog('debug', `Ticks: ${tickCount} | Bars: ${bars} | Price: ${price?.toFixed(2)}`);
|
|
290
|
+
}
|
|
291
|
+
|
|
285
292
|
// === SMART LOGS - REDUCED FREQUENCY ===
|
|
286
293
|
if (currentSecond !== lastLogSecond && tickCount > 1) {
|
|
287
294
|
lastLogSecond = currentSecond;
|
|
@@ -291,12 +298,15 @@ const executeAlgo = async ({ service, account, contract, config, strategy: strat
|
|
|
291
298
|
const delta = buyVolume - sellVolume;
|
|
292
299
|
|
|
293
300
|
let bias = buyPressure > 55 ? 'LONG' : buyPressure < 45 ? 'SHORT' : 'FLAT';
|
|
294
|
-
|
|
295
|
-
if (bias !== lastBias ||
|
|
301
|
+
// Log bias every 5 seconds or when it changes
|
|
302
|
+
if (bias !== lastBias || currentSecond % 5 === 0) {
|
|
296
303
|
const biasLog = smartLogs.getMarketBiasLog(bias, delta, buyPressure);
|
|
297
304
|
const biasType = bias === 'LONG' ? 'bullish' : bias === 'SHORT' ? 'bearish' : 'analysis';
|
|
298
305
|
ui.addLog(biasType, `${biasLog.message} ${biasLog.details || ''}`);
|
|
299
306
|
lastBias = bias;
|
|
307
|
+
// Reset volume after logging
|
|
308
|
+
buyVolume = 0;
|
|
309
|
+
sellVolume = 0;
|
|
300
310
|
}
|
|
301
311
|
|
|
302
312
|
// Strategy state log every 30 seconds (reduced frequency)
|
|
@@ -329,28 +339,8 @@ const executeAlgo = async ({ service, account, contract, config, strategy: strat
|
|
|
329
339
|
}
|
|
330
340
|
}
|
|
331
341
|
|
|
332
|
-
//
|
|
333
|
-
if (currentSecond %
|
|
334
|
-
// Tick flow log every 45 seconds
|
|
335
|
-
if (currentSecond % 45 === 0) { const t = smartLogs.getTickFlowLog(tickCount, ticksPerSecond); ui.addLog('debug', `${t.message} ${t.details}`); }
|
|
336
|
-
// AI Agents status every 60 seconds
|
|
337
|
-
if (currentSecond % 60 === 0 && supervisionEnabled && supervisionEngine) {
|
|
338
|
-
const status = supervisionEngine.getStatus();
|
|
339
|
-
const agentNames = status.agents.map(a => a.name.split(' ')[0]).join(', ');
|
|
340
|
-
ui.addLog('analysis', `AI Supervision active: ${agentNames} (${status.availableAgents} agents monitoring)`);
|
|
341
|
-
}
|
|
342
|
-
|
|
343
|
-
// Strategy health status every 2 minutes (confirms strategy is working)
|
|
344
|
-
if (currentSecond % 120 === 0 && strategy.getHealthStatus) {
|
|
345
|
-
const health = strategy.getHealthStatus(contractId);
|
|
346
|
-
const uptime = Math.floor(health.uptime / 60000);
|
|
347
|
-
const status = health.healthy ? 'OK' : 'WARMING';
|
|
348
|
-
ui.addLog('ready', `HEALTH: ${status} | Bars: ${health.barsTotal} | Zones: ${health.zonesTotal} (R:${health.zonesResistance}/S:${health.zonesSupport}) | Swings: ${health.swingsTotal} | Uptime: ${uptime}m`);
|
|
349
|
-
}
|
|
350
|
-
|
|
351
|
-
// Reset volume counters
|
|
352
|
-
buyVolume = 0;
|
|
353
|
-
sellVolume = 0;
|
|
342
|
+
// AI status every 60s
|
|
343
|
+
if (currentSecond % 60 === 0 && supervisionEnabled && supervisionEngine) ui.addLog('analysis', `AI: ${supervisionEngine.getStatus().agents.map(a => a.name.split(' ')[0]).join(', ')}`);
|
|
354
344
|
}
|
|
355
345
|
|
|
356
346
|
lastPrice = price;
|