Speed up CTP account display: refresh equity on fast snapshot without waiting for full position sync.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -264,7 +264,7 @@
|
||||
posFastPollTimer = setInterval(function () {
|
||||
pollPositions();
|
||||
posFastPollCount += 1;
|
||||
if (posFastPollCount >= 90) stopPosFastPoll();
|
||||
if (posFastPollCount >= 120) stopPosFastPoll();
|
||||
}, 1000);
|
||||
}
|
||||
|
||||
@@ -272,6 +272,10 @@
|
||||
if (!data) return;
|
||||
var cap = document.getElementById('cap-display');
|
||||
if (cap && data.capital != null) cap.textContent = Number(data.capital).toFixed(2);
|
||||
var avail = document.getElementById('avail-display');
|
||||
if (avail && data.account_available != null) {
|
||||
avail.textContent = Number(data.account_available).toFixed(2);
|
||||
}
|
||||
var connected = data.ctp_status && data.ctp_status.connected;
|
||||
var connecting = data.ctp_status && data.ctp_status.connecting;
|
||||
var cooldownSec = (data.ctp_status && data.ctp_status.login_cooldown_sec) || 0;
|
||||
|
||||
Reference in New Issue
Block a user