hedgequantx 2.9.74 → 2.9.75
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/lib/smart-logs.js +30 -30
- package/src/pages/algo/algo-executor.js +21 -19
package/package.json
CHANGED
package/src/lib/smart-logs.js
CHANGED
|
@@ -41,21 +41,21 @@ function getVariedMessage(category, pool, defaultMsg) {
|
|
|
41
41
|
// =============================================================================
|
|
42
42
|
|
|
43
43
|
const LONG_BIAS_MESSAGES = [
|
|
44
|
-
'Buyers taking control',
|
|
45
|
-
'Bid side absorbing',
|
|
46
|
-
'Bullish order flow detected',
|
|
47
|
-
'Buy programs
|
|
48
|
-
'Strong buyer presence',
|
|
49
|
-
'Accumulation pattern',
|
|
50
|
-
'Demand exceeding supply',
|
|
51
|
-
'Buyers stepping up',
|
|
52
|
-
'Long-side momentum building',
|
|
53
|
-
'Bid accumulation detected',
|
|
54
|
-
'Bullish delta divergence',
|
|
55
|
-
'Buy-side imbalance',
|
|
56
|
-
'Institutional buying detected',
|
|
57
|
-
'Aggressive bid lifting',
|
|
58
|
-
'Bullish tape reading',
|
|
44
|
+
'Buyers taking control of the tape',
|
|
45
|
+
'Bid side absorbing sell pressure',
|
|
46
|
+
'Bullish order flow detected on sweep',
|
|
47
|
+
'Buy programs actively lifting offers',
|
|
48
|
+
'Strong buyer presence at current levels',
|
|
49
|
+
'Accumulation pattern forming on volume',
|
|
50
|
+
'Demand exceeding supply at bid',
|
|
51
|
+
'Buyers stepping up with size',
|
|
52
|
+
'Long-side momentum building steadily',
|
|
53
|
+
'Bid accumulation detected at support',
|
|
54
|
+
'Bullish delta divergence confirmed',
|
|
55
|
+
'Buy-side imbalance driving price higher',
|
|
56
|
+
'Institutional buying detected on tape',
|
|
57
|
+
'Aggressive bid lifting through offers',
|
|
58
|
+
'Bullish tape reading with strong delta',
|
|
59
59
|
];
|
|
60
60
|
|
|
61
61
|
// =============================================================================
|
|
@@ -63,21 +63,21 @@ const LONG_BIAS_MESSAGES = [
|
|
|
63
63
|
// =============================================================================
|
|
64
64
|
|
|
65
65
|
const SHORT_BIAS_MESSAGES = [
|
|
66
|
-
'Sellers taking control',
|
|
67
|
-
'Offer side absorbing',
|
|
68
|
-
'Bearish order flow detected',
|
|
69
|
-
'Sell programs
|
|
70
|
-
'Strong seller presence',
|
|
71
|
-
'Distribution pattern',
|
|
72
|
-
'Supply exceeding demand',
|
|
73
|
-
'Sellers stepping in',
|
|
74
|
-
'Short-side momentum building',
|
|
75
|
-
'Offer distribution detected',
|
|
76
|
-
'Bearish delta divergence',
|
|
77
|
-
'Sell-side imbalance',
|
|
78
|
-
'Institutional selling detected',
|
|
79
|
-
'Aggressive offer hitting',
|
|
80
|
-
'Bearish tape reading',
|
|
66
|
+
'Sellers taking control of the tape',
|
|
67
|
+
'Offer side absorbing buy pressure',
|
|
68
|
+
'Bearish order flow detected on sweep',
|
|
69
|
+
'Sell programs actively hitting bids',
|
|
70
|
+
'Strong seller presence at current levels',
|
|
71
|
+
'Distribution pattern forming on volume',
|
|
72
|
+
'Supply exceeding demand at offer',
|
|
73
|
+
'Sellers stepping in with size',
|
|
74
|
+
'Short-side momentum building steadily',
|
|
75
|
+
'Offer distribution detected at resistance',
|
|
76
|
+
'Bearish delta divergence confirmed',
|
|
77
|
+
'Sell-side imbalance driving price lower',
|
|
78
|
+
'Institutional selling detected on tape',
|
|
79
|
+
'Aggressive offer hitting through bids',
|
|
80
|
+
'Bearish tape reading with weak delta',
|
|
81
81
|
];
|
|
82
82
|
|
|
83
83
|
// =============================================================================
|
|
@@ -266,16 +266,17 @@ const executeAlgo = async ({ service, account, contract, config, strategy: strat
|
|
|
266
266
|
if (buyPressure > 55) bias = 'LONG';
|
|
267
267
|
else if (buyPressure < 45) bias = 'SHORT';
|
|
268
268
|
|
|
269
|
-
// Log bias
|
|
270
|
-
|
|
269
|
+
// Log bias when it changes, or every 5 seconds if strong signal
|
|
270
|
+
const strongSignal = Math.abs(delta) > 20 || buyPressure > 65 || buyPressure < 35;
|
|
271
|
+
if (bias !== lastBias || (strongSignal && currentSecond % 5 === 0) || (!strongSignal && currentSecond % 15 === 0)) {
|
|
271
272
|
const biasLog = smartLogs.getMarketBiasLog(bias, delta, buyPressure);
|
|
272
273
|
const biasType = bias === 'LONG' ? 'bullish' : bias === 'SHORT' ? 'bearish' : 'analysis';
|
|
273
274
|
ui.addLog(biasType, `${biasLog.message} ${biasLog.details || ''}`);
|
|
274
275
|
lastBias = bias;
|
|
275
276
|
}
|
|
276
277
|
|
|
277
|
-
// Strategy state log every
|
|
278
|
-
if (currentSecond %
|
|
278
|
+
// Strategy state log every 30 seconds (reduced frequency)
|
|
279
|
+
if (currentSecond % 30 === 0) {
|
|
279
280
|
const state = strategy.getAnalysisState?.(contractId, price);
|
|
280
281
|
if (state) {
|
|
281
282
|
if (!state.ready) {
|
|
@@ -283,42 +284,43 @@ const executeAlgo = async ({ service, account, contract, config, strategy: strat
|
|
|
283
284
|
} else {
|
|
284
285
|
const resStr = state.nearestResistance ? state.nearestResistance.toFixed(2) : '--';
|
|
285
286
|
const supStr = state.nearestSupport ? state.nearestSupport.toFixed(2) : '--';
|
|
286
|
-
ui.addLog('analysis', `Bars: ${state.barsProcessed} | Zones: ${state.activeZones} | Swings: ${state.swingsDetected}`);
|
|
287
|
-
ui.addLog('analysis', `Resistance: ${resStr} | Support: ${supStr}`);
|
|
288
287
|
|
|
289
|
-
//
|
|
288
|
+
// Combined single line for zones info
|
|
289
|
+
ui.addLog('analysis', `Zones: ${state.activeZones} | R: ${resStr} | S: ${supStr} | Swings: ${state.swingsDetected}`);
|
|
290
|
+
|
|
291
|
+
// Strategy status - what we're waiting for
|
|
290
292
|
if (state.activeZones === 0) {
|
|
291
|
-
ui.addLog('risk', '
|
|
293
|
+
ui.addLog('risk', 'Scanning for swing points to build liquidity zones...');
|
|
292
294
|
} else if (!state.nearestSupport && !state.nearestResistance) {
|
|
293
|
-
ui.addLog('risk', 'Zones too far from price
|
|
295
|
+
ui.addLog('risk', 'Zones detected but too far from current price level');
|
|
294
296
|
} else if (!state.nearestSupport) {
|
|
295
|
-
ui.addLog('
|
|
297
|
+
ui.addLog('analysis', 'Watching resistance for HIGH SWEEP entry (SHORT)');
|
|
296
298
|
} else if (!state.nearestResistance) {
|
|
297
|
-
ui.addLog('
|
|
299
|
+
ui.addLog('analysis', 'Watching support for LOW SWEEP entry (LONG)');
|
|
298
300
|
} else {
|
|
299
|
-
ui.addLog('ready', '
|
|
301
|
+
ui.addLog('ready', 'Both zones active - monitoring for liquidity sweep');
|
|
300
302
|
}
|
|
301
303
|
}
|
|
302
304
|
}
|
|
303
305
|
}
|
|
304
306
|
|
|
305
|
-
// Scanning log every
|
|
306
|
-
if (currentSecond %
|
|
307
|
+
// Scanning log every 20 seconds (when no position)
|
|
308
|
+
if (currentSecond % 20 === 0 && currentPosition === 0) {
|
|
307
309
|
const scanLog = smartLogs.getScanningLog(true);
|
|
308
310
|
ui.addLog('system', scanLog.message);
|
|
309
311
|
}
|
|
310
312
|
|
|
311
|
-
// Tick flow log every
|
|
312
|
-
if (currentSecond %
|
|
313
|
+
// Tick flow log every 45 seconds (less frequent)
|
|
314
|
+
if (currentSecond % 45 === 0) {
|
|
313
315
|
const tickLog = smartLogs.getTickFlowLog(tickCount, ticksPerSecond);
|
|
314
316
|
ui.addLog('debug', `${tickLog.message} ${tickLog.details}`);
|
|
315
317
|
}
|
|
316
318
|
|
|
317
|
-
// AI Agents status log every
|
|
318
|
-
if (currentSecond %
|
|
319
|
+
// AI Agents status log every 60 seconds
|
|
320
|
+
if (currentSecond % 60 === 0 && supervisionEnabled && supervisionEngine) {
|
|
319
321
|
const status = supervisionEngine.getStatus();
|
|
320
322
|
const agentNames = status.agents.map(a => a.name.split(' ')[0]).join(', ');
|
|
321
|
-
ui.addLog('analysis', `AI
|
|
323
|
+
ui.addLog('analysis', `AI Supervision active: ${agentNames} (${status.availableAgents} agents monitoring)`);
|
|
322
324
|
}
|
|
323
325
|
|
|
324
326
|
// Reset volume counters
|