feat(hub): add open/close arrows on archive chart with continuous klines

Span chart window across hold period, fill 5m gaps for smooth aggregation, and mark entry/exit with lightweight-charts arrows.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dekun
2026-06-07 23:14:40 +08:00
parent 92ff945d72
commit 54c0b169c7
5 changed files with 282 additions and 15 deletions
+6
View File
@@ -1732,6 +1732,8 @@ def api_archive_ohlcv(
timeframe: str = ARCHIVE_DEFAULT_TIMEFRAME,
mode: str = "hold",
anchor_ms: str = "",
opened_ms: str = "",
closed_ms: str = "",
at: str = "",
bars: str = "",
):
@@ -1741,6 +1743,8 @@ def api_archive_ohlcv(
raise HTTPException(status_code=400, detail="缺少 exchange_key 或 symbol")
init_archive_db()
anchor = _parse_anchor_ms(at, anchor_ms)
open_ms = _parse_anchor_ms("", opened_ms)
close_ms = _parse_anchor_ms("", closed_ms)
try:
bar_n = int(bars) if (bars or "").strip().isdigit() else ARCHIVE_VISIBLE_BARS_DEFAULT
except ValueError:
@@ -1750,6 +1754,8 @@ def api_archive_ohlcv(
sym,
timeframe,
anchor_ms=anchor,
opened_ms=open_ms,
closed_ms=close_ms,
mode=mode,
bars=bar_n,
)