hedgequantx 2.9.73 → 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 +28 -13
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,29 +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
|
-
|
|
287
|
-
|
|
287
|
+
|
|
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
|
|
292
|
+
if (state.activeZones === 0) {
|
|
293
|
+
ui.addLog('risk', 'Scanning for swing points to build liquidity zones...');
|
|
294
|
+
} else if (!state.nearestSupport && !state.nearestResistance) {
|
|
295
|
+
ui.addLog('risk', 'Zones detected but too far from current price level');
|
|
296
|
+
} else if (!state.nearestSupport) {
|
|
297
|
+
ui.addLog('analysis', 'Watching resistance for HIGH SWEEP entry (SHORT)');
|
|
298
|
+
} else if (!state.nearestResistance) {
|
|
299
|
+
ui.addLog('analysis', 'Watching support for LOW SWEEP entry (LONG)');
|
|
300
|
+
} else {
|
|
301
|
+
ui.addLog('ready', 'Both zones active - monitoring for liquidity sweep');
|
|
302
|
+
}
|
|
288
303
|
}
|
|
289
304
|
}
|
|
290
305
|
}
|
|
291
306
|
|
|
292
|
-
// Scanning log every
|
|
293
|
-
if (currentSecond %
|
|
307
|
+
// Scanning log every 20 seconds (when no position)
|
|
308
|
+
if (currentSecond % 20 === 0 && currentPosition === 0) {
|
|
294
309
|
const scanLog = smartLogs.getScanningLog(true);
|
|
295
310
|
ui.addLog('system', scanLog.message);
|
|
296
311
|
}
|
|
297
312
|
|
|
298
|
-
// Tick flow log every
|
|
299
|
-
if (currentSecond %
|
|
313
|
+
// Tick flow log every 45 seconds (less frequent)
|
|
314
|
+
if (currentSecond % 45 === 0) {
|
|
300
315
|
const tickLog = smartLogs.getTickFlowLog(tickCount, ticksPerSecond);
|
|
301
316
|
ui.addLog('debug', `${tickLog.message} ${tickLog.details}`);
|
|
302
317
|
}
|
|
303
318
|
|
|
304
|
-
// AI Agents status log every
|
|
305
|
-
if (currentSecond %
|
|
319
|
+
// AI Agents status log every 60 seconds
|
|
320
|
+
if (currentSecond % 60 === 0 && supervisionEnabled && supervisionEngine) {
|
|
306
321
|
const status = supervisionEngine.getStatus();
|
|
307
322
|
const agentNames = status.agents.map(a => a.name.split(' ')[0]).join(', ');
|
|
308
|
-
ui.addLog('analysis', `AI
|
|
323
|
+
ui.addLog('analysis', `AI Supervision active: ${agentNames} (${status.availableAgents} agents monitoring)`);
|
|
309
324
|
}
|
|
310
325
|
|
|
311
326
|
// Reset volume counters
|