Add key-level auto trade, AI analysis, and trading UX improvements.

Key monitors use 5m close triggers with WeChat alerts and box/convergence auto orders; add pending-order worker, structured WeChat notify, AI settings/messages, session clock, CTP margin sizing, and dual-layer position limits.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dekun
2026-06-28 10:36:56 +08:00
parent 0109b59f27
commit 840e88daad
33 changed files with 2514 additions and 143 deletions
+41 -3
View File
@@ -4,6 +4,32 @@
*/
(function () {
var keyTimer = null;
var typeEl = document.getElementById('key-type');
var tradeModeWrap = document.getElementById('key-trade-mode-wrap');
var rrWrap = document.getElementById('key-rr-wrap');
var rrEl = document.getElementById('key-rr');
var trailingWrap = document.getElementById('key-trailing-wrap');
var trailingEl = document.getElementById('key-trailing');
var rowActions = document.getElementById('key-row-actions');
var rowPrices = document.getElementById('key-row-prices');
function isAutoType(typ) {
return typ === '箱体突破' || typ === '收敛突破';
}
function syncKeyForm() {
var typ = typeEl ? typeEl.value : '';
var auto = isAutoType(typ);
if (tradeModeWrap) tradeModeWrap.classList.toggle('is-hidden', !auto);
if (rrWrap) rrWrap.classList.toggle('is-hidden', !auto);
if (trailingWrap) trailingWrap.classList.toggle('is-hidden', !auto);
if (rowActions) rowActions.classList.toggle('key-actions-zone', !auto);
if (rowPrices) rowPrices.classList.toggle('key-zone-mode', !auto);
if (!auto && trailingEl) trailingEl.checked = false;
if (auto && trailingEl && trailingEl.checked && rrEl) {
if (parseFloat(rrEl.value) < 3) rrEl.value = '3';
}
}
function fmtDist(v) {
if (v === null || v === undefined) return '--';
@@ -44,8 +70,20 @@
keyTimer = setInterval(pollKeyPrices, 1000);
}
if (window.qihuoPageBoot) window.qihuoPageBoot(startPolling, '#key-monitor-list');
else if (window.qihuoOnPageLoad) window.qihuoOnPageLoad(startPolling);
else document.addEventListener('DOMContentLoaded', startPolling);
function bindForm() {
if (typeEl) typeEl.addEventListener('change', syncKeyForm);
if (trailingEl) {
trailingEl.addEventListener('change', function () {
if (trailingEl.checked && rrEl && parseFloat(rrEl.value) < 3) {
rrEl.value = '3';
}
});
}
syncKeyForm();
}
if (window.qihuoPageBoot) window.qihuoPageBoot(function () { bindForm(); startPolling(); }, '#key-monitor-list');
else if (window.qihuoOnPageLoad) window.qihuoOnPageLoad(function () { bindForm(); startPolling(); });
else document.addEventListener('DOMContentLoaded', function () { bindForm(); startPolling(); });
if (window.qihuoOnPageLeave) window.qihuoOnPageLeave(stopPolling);
})();