hedgequantx 2.6.61 → 2.6.63
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/one-account.js +14 -9
- package/src/pages/algo/ui.js +31 -21
package/package.json
CHANGED
|
@@ -321,7 +321,8 @@ const launchAlgo = async (service, account, contract, config) => {
|
|
|
321
321
|
stats.entryLatencies.push(fillLatencyMs);
|
|
322
322
|
stats.avgFillLatency = stats.entryLatencies.reduce((a, b) => a + b, 0) / stats.entryLatencies.length;
|
|
323
323
|
const side = position.side === 0 ? 'LONG' : 'SHORT';
|
|
324
|
-
|
|
324
|
+
// Use 'filled' type for colored FILL icon
|
|
325
|
+
ui.addLog('filled', `${side} ${position.size}x ${symbolName} @ ${position.entryPrice} | ${fillLatencyMs}ms`);
|
|
325
326
|
});
|
|
326
327
|
|
|
327
328
|
positionManager.on('exitFilled', ({ orderTag, exitPrice, pnlTicks, holdDurationMs }) => {
|
|
@@ -332,19 +333,21 @@ const launchAlgo = async (service, account, contract, config) => {
|
|
|
332
333
|
stats.sessionPnl += pnlDollars; // Track session P&L
|
|
333
334
|
if (pnlDollars >= 0) {
|
|
334
335
|
stats.wins++;
|
|
335
|
-
|
|
336
|
+
// Use 'win' type for green WIN icon
|
|
337
|
+
ui.addLog('win', `+$${pnlDollars.toFixed(2)} @ ${exitPrice} | ${holdSec}s`);
|
|
336
338
|
} else {
|
|
337
339
|
stats.losses++;
|
|
338
|
-
|
|
340
|
+
// Use 'loss' type for red LOSS icon
|
|
341
|
+
ui.addLog('loss', `-$${Math.abs(pnlDollars).toFixed(2)} @ ${exitPrice} | ${holdSec}s`);
|
|
339
342
|
}
|
|
340
343
|
} else {
|
|
341
344
|
// Log with ticks only if tickValue unavailable
|
|
342
345
|
if (pnlTicks !== null && pnlTicks >= 0) {
|
|
343
346
|
stats.wins++;
|
|
344
|
-
|
|
347
|
+
ui.addLog('win', `+${pnlTicks} ticks | ${holdSec}s`);
|
|
345
348
|
} else if (pnlTicks !== null) {
|
|
346
349
|
stats.losses++;
|
|
347
|
-
|
|
350
|
+
ui.addLog('loss', `${pnlTicks} ticks | ${holdSec}s`);
|
|
348
351
|
}
|
|
349
352
|
}
|
|
350
353
|
stats.trades++;
|
|
@@ -354,11 +357,13 @@ const launchAlgo = async (service, account, contract, config) => {
|
|
|
354
357
|
});
|
|
355
358
|
|
|
356
359
|
positionManager.on('holdComplete', ({ orderTag, position }) => {
|
|
357
|
-
|
|
360
|
+
// Use 'ready' type for green READY icon
|
|
361
|
+
ui.addLog('ready', `Hold complete - monitoring exit`);
|
|
358
362
|
});
|
|
359
363
|
|
|
360
364
|
positionManager.on('breakevenActivated', ({ orderTag, position, breakevenPrice, pnlTicks }) => {
|
|
361
|
-
|
|
365
|
+
// Use 'be' type for yellow BE icon
|
|
366
|
+
ui.addLog('be', `Breakeven @ ${breakevenPrice} | +${pnlTicks} ticks`)
|
|
362
367
|
});
|
|
363
368
|
|
|
364
369
|
positionManager.on('exitOrderFired', ({ orderTag, exitReason, latencyMs }) => {
|
|
@@ -554,8 +559,8 @@ const launchAlgo = async (service, account, contract, config) => {
|
|
|
554
559
|
orderData.accountId = account.rithmicAccountId;
|
|
555
560
|
}
|
|
556
561
|
|
|
557
|
-
// Log entry attempt (single line)
|
|
558
|
-
|
|
562
|
+
// Log entry attempt (single line) - use 'entry' type for cyan ENTRY icon
|
|
563
|
+
ui.addLog('entry', `${sideStr} ${contracts}x ${symbolName} | risk: $${riskAmount} (${riskPct}%)`);
|
|
559
564
|
|
|
560
565
|
// Fire-and-forget entry (no await on fill)
|
|
561
566
|
const entryResult = service.fastEntry(orderData);
|
package/src/pages/algo/ui.js
CHANGED
|
@@ -19,38 +19,48 @@ const SPINNER = ['\u280B', '\u2819', '\u2839', '\u2838', '\u283C', '\u2834', '\u
|
|
|
19
19
|
const LOG_COLORS = {
|
|
20
20
|
fill_buy: chalk.green,
|
|
21
21
|
fill_sell: chalk.red,
|
|
22
|
-
fill_win: chalk.green
|
|
23
|
-
fill_loss: chalk.red
|
|
22
|
+
fill_win: chalk.green,
|
|
23
|
+
fill_loss: chalk.red,
|
|
24
|
+
win: chalk.green,
|
|
25
|
+
loss: chalk.red,
|
|
26
|
+
be: chalk.yellow,
|
|
27
|
+
entry: chalk.cyan,
|
|
28
|
+
filled: chalk.green,
|
|
24
29
|
connected: chalk.cyan,
|
|
25
30
|
ready: chalk.green,
|
|
26
31
|
error: chalk.red,
|
|
27
32
|
reject: chalk.red,
|
|
28
|
-
info: chalk.
|
|
33
|
+
info: chalk.white,
|
|
29
34
|
system: chalk.magenta,
|
|
30
|
-
signal: chalk.yellow
|
|
31
|
-
trade: chalk.green
|
|
35
|
+
signal: chalk.yellow,
|
|
36
|
+
trade: chalk.green,
|
|
32
37
|
warning: chalk.yellow,
|
|
33
38
|
success: chalk.green,
|
|
34
39
|
analysis: chalk.magenta
|
|
35
40
|
};
|
|
36
41
|
|
|
37
|
-
// Log type icons -
|
|
42
|
+
// Log type icons - Unicode icons with colors
|
|
38
43
|
const LOG_ICONS = {
|
|
39
|
-
fill_buy: 'BUY
|
|
40
|
-
fill_sell: 'SELL
|
|
41
|
-
fill_win: 'WIN
|
|
42
|
-
fill_loss: 'LOSS
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
44
|
+
fill_buy: '⬆ BUY ',
|
|
45
|
+
fill_sell: '⬇ SELL ',
|
|
46
|
+
fill_win: '✔ WIN ',
|
|
47
|
+
fill_loss: '✘ LOSS ',
|
|
48
|
+
win: '✔ WIN ',
|
|
49
|
+
loss: '✘ LOSS ',
|
|
50
|
+
be: '★ BE ',
|
|
51
|
+
entry: '➡ ENTRY',
|
|
52
|
+
filled: '✔ FILL ',
|
|
53
|
+
connected: '✔ CONN ',
|
|
54
|
+
ready: '✔ READY',
|
|
55
|
+
error: '✘ ERR ',
|
|
56
|
+
reject: '✘ REJ ',
|
|
57
|
+
info: '➡ INFO ',
|
|
58
|
+
system: '★ SYS ',
|
|
59
|
+
signal: '★ SIG ',
|
|
60
|
+
trade: '✔ TRADE',
|
|
61
|
+
success: '✔ OK ',
|
|
62
|
+
warning: '⬅ WARN ',
|
|
63
|
+
analysis: '★ ANLYS'
|
|
54
64
|
};
|
|
55
65
|
|
|
56
66
|
/**
|