Add hub-only OKX amp stats for ETH/BTC session windows.

Read-only 1H index candles, point amplitude metrics, history save and CSV export; no order-path changes.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dekun
2026-07-23 02:06:21 +08:00
parent 40be3a5ab7
commit 61e8da1e8b
15 changed files with 1367 additions and 4 deletions
+16
View File
@@ -45,6 +45,10 @@
return displayPref("show_nav_strategy", true);
}
function showNavAmpStatsPref() {
return displayPref("show_nav_amp_stats", true);
}
function showNavHelpPref() {
return displayPref("show_nav_help", true);
}
@@ -64,6 +68,7 @@
["nav-ai", "m-tab-ai", d.show_nav_ai === false],
["nav-calculator", "m-tab-calculator", d.show_nav_calculator === false],
["nav-strategy", "m-nav-strategy", d.show_nav_strategy === false],
["nav-amp-stats", "m-nav-amp-stats", d.show_nav_amp_stats === false],
["nav-help", "m-nav-help", d.show_nav_help === false],
["nav-logs", "m-nav-logs", d.show_nav_logs === false],
];
@@ -136,6 +141,7 @@
if (page === "ai") return showNavAiPref();
if (page === "calculator") return showNavCalculatorPref();
if (page === "strategy") return showNavStrategyPref();
if (page === "amp-stats") return showNavAmpStatsPref();
if (page === "help") return showNavHelpPref();
if (page === "logs") return showNavLogsPref();
return true;
@@ -152,6 +158,7 @@
const aiCb = document.getElementById("pref-show-nav-ai");
const calcCb = document.getElementById("pref-show-nav-calculator");
const strategyCb = document.getElementById("pref-show-nav-strategy");
const ampCb = document.getElementById("pref-show-nav-amp-stats");
const helpCb = document.getElementById("pref-show-nav-help");
const logsCb = document.getElementById("pref-show-nav-logs");
if (pnlCb) pnlCb.checked = d.show_account_pnl !== false;
@@ -163,6 +170,7 @@
if (aiCb) aiCb.checked = d.show_nav_ai !== false;
if (calcCb) calcCb.checked = d.show_nav_calculator !== false;
if (strategyCb) strategyCb.checked = d.show_nav_strategy !== false;
if (ampCb) ampCb.checked = d.show_nav_amp_stats !== false;
if (helpCb) helpCb.checked = d.show_nav_help !== false;
if (logsCb) logsCb.checked = d.show_nav_logs !== false;
syncNavVisibility(data);
@@ -1278,6 +1286,7 @@
if (p.includes("plan")) return "plan";
if (p.includes("calculator")) return "calculator";
if (p.includes("help")) return "help";
if (p.includes("amp-stats")) return "amp-stats";
if (p.includes("strategy")) return "strategy";
if (p.includes("logs")) return "logs";
if (p.includes("market")) return "market";
@@ -1295,6 +1304,7 @@
if (page === "calculator") return "page-calculator";
if (page === "help") return "page-help";
if (page === "strategy") return "page-strategy";
if (page === "amp-stats") return "page-amp-stats";
if (page === "logs") return "page-logs";
if (page === "market") return "page-market";
if (page === "ai") return "page-ai";
@@ -1329,6 +1339,7 @@
document.body.classList.toggle("hub-page-quotes", page === "quotes");
document.body.classList.toggle("hub-page-plan", page === "plan");
document.body.classList.toggle("hub-page-strategy", page === "strategy");
document.body.classList.toggle("hub-page-amp-stats", page === "amp-stats");
document.body.classList.toggle("hub-page-logs", page === "logs");
document.body.classList.toggle("hub-page-help", page === "help");
syncHubPhoneShellClass();
@@ -1373,6 +1384,9 @@
} else if (window.hubStrategyPage && window.hubStrategyPage.destroy) {
window.hubStrategyPage.destroy();
}
if (page === "amp-stats" && window.hubAmpStatsPage) {
window.hubAmpStatsPage.init();
}
if (page === "help" && window.hubHelpPage) {
window.hubHelpPage.init();
} else if (window.hubHelpPage && window.hubHelpPage.destroy) {
@@ -5052,6 +5066,7 @@
const aiCb = document.getElementById("pref-show-nav-ai");
const calcCb = document.getElementById("pref-show-nav-calculator");
const strategyCb = document.getElementById("pref-show-nav-strategy");
const ampCb = document.getElementById("pref-show-nav-amp-stats");
const helpCb = document.getElementById("pref-show-nav-help");
const logsCb = document.getElementById("pref-show-nav-logs");
const supEnabled = document.getElementById("supervisor-enabled");
@@ -5075,6 +5090,7 @@
show_nav_ai: aiCb ? !!aiCb.checked : true,
show_nav_calculator: calcCb ? !!calcCb.checked : true,
show_nav_strategy: strategyCb ? !!strategyCb.checked : true,
show_nav_amp_stats: ampCb ? !!ampCb.checked : true,
show_nav_help: helpCb ? !!helpCb.checked : true,
show_nav_logs: logsCb ? !!logsCb.checked : true,
},