Commit Graph

60 Commits

Author SHA1 Message Date
dekun 61d79c4de1 Fix hub market chart live K-line updates without manual reload.
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-24 14:48:01 +08:00
dekun ab862efc4e feat(hub): add yesterday close and high-low price line toggles on market chart
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-12 20:45:09 +08:00
dekun 6eb17b7ddc feat: add trading day split lines on hub market chart
Add toggle before technical indicators to show blue dashed vertical lines at Beijing 8:00 day boundaries.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-10 08:35:35 +08:00
dekun 38f4280bb8 fix: UTC+8 market chart times and archive full history K-line load
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-08 16:55:48 +08:00
dekun 947b58084d ui: add Top20 button to market chart fullscreen toolbar
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-08 16:37:05 +08:00
dekun 5fb4a10638 ui: show Top20 rank sheet below toolbar instead of over chart
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-08 16:11:11 +08:00
dekun 4c55932906 fix: Top20 dropdown floats above chart with fixed positioning
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-08 16:08:05 +08:00
dekun 93b84da72e fix: invalidate stale 12-item volume rank cache and force full top20 refresh
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-08 16:01:27 +08:00
dekun 89a58c7323 fix: exchange-specific volume rank APIs for OKX and full top20
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-08 15:53:41 +08:00
dekun 4bf0c2363f feat: daily volume top20 rank per exchange in market page
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-08 15:46:36 +08:00
dekun ef57872d14 fix: market drawing tools overlay alignment and pointer handling
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-08 12:45:47 +08:00
dekun 26a4c04b88 feat: add vertical drawing toolbar on market chart
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-08 12:41:52 +08:00
dekun e68e29629e feat: push chart tail candles over SSE for faster market refresh
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-08 12:24:25 +08:00
dekun ca6ef59a14 Add clear-and-refetch for hub K-line cache.
Force refresh wipes the series in hub_kline.db before pulling from the exchange; add a Linux clear script and rename the UI button to 清库重拉.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-08 11:31:16 +08:00
dekun b34aefbcc4 Patch tail candles without resetting chart viewport.
When auto-follow is off, refresh only updates the latest bars via series.update instead of setData so zoom and pan stay fixed during background polls.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-08 08:39:56 +08:00
dekun 5af0cbf286 Fix chart auto toggle to clearly split follow vs manual zoom.
On tail refresh, auto-on always snaps to latest candles while auto-off preserves the saved viewport with clamped range restore.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-08 08:35:56 +08:00
dekun bae78d8368 Respect manual chart zoom when auto-follow is off.
Tie the market auto toggle to both price scale and viewport: tail refresh updates data silently while preserving zoom/pan when auto is disabled.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-08 08:30:44 +08:00
dekun c8ffc764e1 Increase default chart initial bar counts per timeframe.
Load 2000 bars for 1m/5m/15m, 1000 for 1h/2h/4h, and 500 for 1d/1w on first screen instead of 300-bar chunked defaults.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-08 08:23:43 +08:00
dekun 35088be097 Fix chart viewport regressions from tail refresh and period switch.
Remove pendingViewportEpoch, fetch only 30 tail bars on poll, restore wasViewingTail logic, and fix left-scroll range shift from actual merge delta.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-08 08:18:06 +08:00
dekun 7ea51818f1 Fix chart viewport hiding after timeframe switch.
Use pendingViewportEpoch so tail refresh applies default range on new timeframe instead of reusing the previous period's saved range.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-08 08:12:33 +08:00
dekun c2203abfa8 Preserve chart zoom and pan across tail refresh updates.
Keep the user viewport when SSE updates candles so zooming out to see the full series is not reset to the recent 200-bar view.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-08 08:06:57 +08:00
dekun 3ac854d74c Remove 12h timeframe and stabilize chart wheel zoom.
Drop 12h from market chart options and storage, and avoid left-pan reload and tail refresh from resetting the viewport while zooming.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-08 07:54:37 +08:00
dekun 4afea6bb97 Fix chart tail viewport after 5m/15m timeframe switches.
Snap to latest candles on period change and only preserve scroll position when viewing history.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-08 07:46:14 +08:00
dekun 06897c59f1 Fix market chart viewport jump when switching timeframes.
Reset visible range and block stale left-pan/tail refresh from applying the previous period logical range to new candles.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-08 07:40:45 +08:00
dekun 11cc482599 Refactor market K-line storage with tiered retention and chunked loading.
Store 1m/5m/1h/12h/1d/1w with per-timeframe policies, aggregate 15m and 2h/4h on read, and support left-pan history fetches via before_ms.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-08 07:27:16 +08:00
dekun 806350231e fix(hub): show contract-based unrealized PnL in monitor and chart
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-04 20:20:36 +08:00
dekun c9ca106b81 fix(hub): recalc market floating PnL from live chart mark
Use plan margin x leverage x price change with latest K-line close instead of stale board snapshot floating_pnl.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-04 20:09:35 +08:00
dekun e6361a7fcc fix(hub): live market PnL and Gate drag SL place
Parse Gate unrealised_pnl in agent; refresh hub market floating PnL from board and trends; clamp Gate TP/SL triggers before place.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-04 20:02:23 +08:00
dekun e39fac2c16 feat(hub): show floating PnL on market page and drag stop-loss to place TP/SL
Pass unrealized PnL from monitor jump context, refresh from board snapshot, and let users drag the SL price line to call the same place-tpsl API as the monitor entrust dialog.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-04 19:31:45 +08:00
dekun 6f8f0968c8 feat(hub): background chart poll with SSE for positions and market watch
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-04 12:39:26 +08:00
dekun e99c6cef08 style(hub): refine light theme contrast and theme-aware fullscreen UI
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-04 12:08:35 +08:00
dekun d1914df46f feat(hub): add dark/light theme toggle with moon and sun icons
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-04 12:03:48 +08:00
dekun 98c904c2d1 feat(hub): align trend pullback display with instance in fullscreen
Position cards show trend plan source, risk%, program TP price and RR; trend section uses plan grid; hub API enriches floating PnL and planned_rr.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-04 10:09:04 +08:00
dekun 2a9602610e fix(hub): align Binance chart ticks and improve monitor mark price
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-03 22:33:59 +08:00
dekun 2d8f65bf1d fix(hub): 修复币安行情区 unexpected base 价格精度
normalize_price_tick 对齐 tick 为 10^-n;chart.js 使用整数 base 并在 applyOptions 失败时回退安全 priceFormat。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-03 17:36:51 +08:00
dekun c56326734e fix(hub): 修复行情区 K 线 Gate 分页与图表 unexpected base
Gate OHLCV 分页在接近当前时间时停止并容错 from>to;分页失败时用 limit 兜底。chart.js 为 priceFormat 增加整数 base,setData 失败时回退默认精度。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-03 17:28:42 +08:00
dekun d455fc408e 移除行情区 30m 周期
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-02 15:35:48 +08:00
dekun fdca82ea26 移除行情区 3m/10m/20m/6h/8h 周期
保留 30m、2h、12h;12h 仍支持从 1h 聚合

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-02 15:33:33 +08:00
dekun abcda762d8 行情区增加 3m/10m/20m/30m 与 2h/6h/8h/12h 周期
- hub_ohlcv_lib 扩展 CHART_TIMEFRAMES 与分钟快捷键映射

- 下拉框与 /api/chart/meta 同步新周期列表

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-02 15:21:55 +08:00
dekun bb762ceeaa 行情区全屏改为仅 F 键,并强化键盘监听
- 移除 Ctrl+空格,使用 KeyF 与多节点捕获监听

- 点击图表区域聚焦,进入行情页自动聚焦

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-02 15:11:23 +08:00
dekun 96affeb0a6 修复行情区 15m 周期快捷键与全屏 F 键
- 数字 1 不再立即切 1m,支持连按 15/1440/10080

- 新增 F 键全屏,捕获阶段监听 Ctrl+空格

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-02 15:08:35 +08:00
dekun bfffc7d984 修复 OKX K 线无 since 时只拉 300 根的问题,并加入行情快捷键
- fetch_ohlcv_for_hub:无 since 时按目标根数分页拉取(OKX/Gate 单次约 300)

- hub_kline_store 全量补拉传 fetch_start_ms

- 行情区:数字键切换周期、Ctrl+空格全屏、Esc 退出全屏

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-02 14:51:37 +08:00
dekun 16927444d7 修复行情区 MACD/RSI 副图分区与 scaleMargins 布局错误
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-02 14:41:00 +08:00
dekun 5661ccf4ab 行情区:MACD/RSI置于成交量下方、背离标注与全屏切换品种周期
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-02 14:33:33 +08:00
dekun 84ac9134db 行情区:K线全屏、可选技术指标与交易所价格精度对齐
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-02 14:24:36 +08:00
dekun 01d26e9833 修复趋势回调止盈误显与行情区成交量被裁切的问题
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-02 13:45:19 +08:00
dekun 21ef97cbdb 监控跳转行情区:展示入场价、止盈止损与委托单并在K线标注
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-02 13:38:44 +08:00
dekun 1f13638732 监控区持仓合约点击跳转行情区
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-02 12:29:08 +08:00
dekun 054cf01b7a 修复行情区 K 线右侧 10 根留白被可见范围覆盖的问题
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-02 12:26:04 +08:00
dekun e40975d563 行情区:现价标签固定于价格轴,K线右侧保留10根留白
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-02 12:22:54 +08:00