hedgequantx 2.6.80 → 2.6.82
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
|
@@ -981,8 +981,8 @@ const launchAlgo = async (service, account, contract, config) => {
|
|
|
981
981
|
};
|
|
982
982
|
|
|
983
983
|
// Start polling and UI refresh
|
|
984
|
-
// UI refreshes every
|
|
985
|
-
const refreshInterval = setInterval(() => { if (running) ui.render(stats); },
|
|
984
|
+
// UI refreshes every 100ms (fast refresh, no flicker with line-by-line rendering), P&L polling every 10s
|
|
985
|
+
const refreshInterval = setInterval(() => { if (running) ui.render(stats); }, 100);
|
|
986
986
|
const pnlInterval = setInterval(() => { if (running) pollPnL(); }, 10000);
|
|
987
987
|
pollPnL(); // Initial poll
|
|
988
988
|
|
package/src/pages/algo/ui.js
CHANGED
|
@@ -386,7 +386,7 @@ class AlgoUI {
|
|
|
386
386
|
if (this.isDrawing) return;
|
|
387
387
|
this.isDrawing = true;
|
|
388
388
|
|
|
389
|
-
// Quick hash to detect meaningful changes
|
|
389
|
+
// Quick hash to detect meaningful changes
|
|
390
390
|
const statsHash = JSON.stringify({
|
|
391
391
|
pnl: stats.pnl,
|
|
392
392
|
openPnl: stats.openPnl,
|
|
@@ -410,8 +410,9 @@ class AlgoUI {
|
|
|
410
410
|
this.lines = [];
|
|
411
411
|
|
|
412
412
|
if (this.firstDraw) {
|
|
413
|
-
//
|
|
414
|
-
|
|
413
|
+
// Clear screen once, hide cursor
|
|
414
|
+
console.clear();
|
|
415
|
+
process.stdout.write('\x1B[?25l');
|
|
415
416
|
this.firstDraw = false;
|
|
416
417
|
}
|
|
417
418
|
|
|
@@ -420,13 +421,17 @@ class AlgoUI {
|
|
|
420
421
|
this._drawStats(stats);
|
|
421
422
|
this._drawLogs();
|
|
422
423
|
|
|
423
|
-
// Build output
|
|
424
|
+
// Build output
|
|
424
425
|
const output = this.lines.join('\n');
|
|
425
426
|
|
|
426
|
-
// Only write if content changed
|
|
427
|
+
// Only write if content changed
|
|
427
428
|
if (output !== this.lastOutput) {
|
|
428
|
-
//
|
|
429
|
-
|
|
429
|
+
// Write each line at fixed position (no full screen redraw)
|
|
430
|
+
const lines = this.lines;
|
|
431
|
+
for (let i = 0; i < lines.length; i++) {
|
|
432
|
+
// Move to line i+1, column 1, then write line and clear to end
|
|
433
|
+
process.stdout.write(`\x1B[${i + 1};1H${lines[i]}\x1B[K`);
|
|
434
|
+
}
|
|
430
435
|
this.lastOutput = output;
|
|
431
436
|
}
|
|
432
437
|
}
|
|
@@ -435,7 +440,8 @@ class AlgoUI {
|
|
|
435
440
|
}
|
|
436
441
|
|
|
437
442
|
cleanup() {
|
|
438
|
-
process.stdout.write('\x1B[?
|
|
443
|
+
process.stdout.write('\x1B[?25h');
|
|
444
|
+
console.clear();
|
|
439
445
|
}
|
|
440
446
|
}
|
|
441
447
|
|