Commit Graph

230 Commits

Author SHA1 Message Date
dekun b394e495ca chore: remove instance Windows scripts and screen/systemd helpers
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-04 11:56:32 +08:00
dekun 4569e070fd chore: remove Windows deployment scripts and update hub usage examples
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-04 11:53:42 +08:00
dekun 1282293e91 docs: unify Ubuntu root /opt PM2 deployment and refresh README
Add docs/ubuntu-server.md; remove Windows and alternate process managers from deployment guides; index strategy, key monitor, TP/SL, breakeven, and replay docs in root README.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-04 11:48:54 +08:00
dekun 546bc7bcf1 fix(hub): two-column trend plan card; docs for records and hub layout
Left column shows plan metrics, right column DCA table, footer for breakeven and snapshot info; update strategy and exchange usage docs.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-04 10:59:47 +08:00
dekun f1e95afb89 feat: strategy records dual panels with filters and 100-row cap
Split trend and roll snapshot lists with expandable rows, client filters, and DB prune to latest 100 entries.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-04 10:55:34 +08:00
dekun 7037dc2334 fix(hub): align trend pullback card with instance layout
Match strategy page plan card: 3x3 metrics, DCA table, breakeven row, snapshot footer; PnL percent on plan margin.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-04 10:51:13 +08:00
dekun 3fb2023efb feat: strategy trade snapshots, DCA detail, and hub trend layout
Persist ended trend pullback and roll group snapshots to a unified records page; show replenishment tiers on instance and hub cards with horizontal single-position layout.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-04 10:45:27 +08:00
dekun 1a6b5f55a1 fix: regenerate clean app icons with Pillow (fix corrupted favicon)
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-04 10:22:08 +08:00
dekun e03cce20d6 feat: add brand icons for Chrome shortcuts and PWA manifest
Dark cyan-green candlestick icon for hub and four exchanges; generate/sync scripts and docs/shortcut-icon.md.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-04 10:17:22 +08:00
dekun ed669fab80 fix(hub): show trend plan leverage, base, ratio, mark and floating PnL
Position and trend plan cards read sizing from trend_pullback_plans; merge agent mark/PnL; compute position_ratio_pct in hub enrich.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-04 10:13:44 +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 02bc3c14bc docs: document four-exchange env sync script usage
Add docs/env-sync-scripts.md; cross-link from deploy README, feature docs, README, and script headers.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-04 10:02:08 +08:00
dekun 5e694ff795 docs: reference unified env sync script in position-sizing guide
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-04 09:59:53 +08:00
dekun e6e79215fc chore: add unified four-exchange env sync scripts
sync_four_exchange_env runs position sizing + transfer sync; transfer script preserves existing values and supports --set-amount/--enable-auto-transfer.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-04 09:59:33 +08:00
dekun 29b0634c6d feat: bidirectional daily auto-transfer with position skip
Rebalance swap to AUTO_TRANSFER_AMOUNT at Beijing hour: top up from funding or sweep excess back. Skip and WeChat notify when active positions exist.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-04 09:57:25 +08:00
dekun 0456d5fa2c chore: add script to sync position sizing env across four exchanges
sync_four_exchange_position_sizing_env.py appends missing POSITION_SIZING_MODE and FULL_MARGIN_BUFFER_RATIO, optional --set-mode/--set-buffer; docs updated.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-04 08:30:44 +08:00
dekun f7bac11694 feat: add full-margin position sizing mode across four exchanges
Env POSITION_SIZING_MODE switches risk vs full-margin (available*buffer, BTC/ETH 10x). Blocks trend/roll/key auto opens in full margin, purges breakout/fib monitors with WeChat notice, keeps RR check and initial SL snapshot for records.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-04 08:24:35 +08:00
dekun d75527a9ca docs(env): unify auto-transfer config across four exchanges
Align .env.example blocks and add sync script to merge AUTO_TRANSFER_* into existing instance .env files without touching API secrets.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-04 07:47:18 +08:00
dekun b1952dcd6e fix(binance): read funding balance from wallet/balance API
Prefer sapi asset/wallet/balance Funding USDT (matches App), merge get-funding-asset and ccxt as fallbacks, and add optional BINANCE_FUNDING_INCLUDE_SPOT plus a richer verify script.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-04 07:12:28 +08:00
dekun dd74770c66 fix(binance): show full funding wallet USDT balance
Sum free+locked/freeze from ccxt funding balance and fall back to get-funding-asset SAPI so the header matches Binance APP funding account.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-04 07:07:36 +08:00
dekun 1b3f661bad fix: label trend breakeven handoff as 趋势回调 across four exchanges
Set order monitor and trade record source to trend pullback after handoff; unify hub and instance display; add migration script for legacy rows.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-04 06:30:14 +08:00
dekun 97e0355209 ui(hub): remove monitor and market page description hints
Drop page-desc and collapsible hint-box from monitor and market headers for a cleaner layout.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-03 23:48:24 +08:00
dekun 2c01d11fe1 style(hub): color-code monitor card strategy stat chips
Use shared cyan for breakout/fib keys, purple for watch keys, green for trends, and orange for roll groups.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-03 23:30:33 +08:00
dekun 98038b1945 feat(hub): show key/trend/roll counts on monitor cards
Add per-card strategy stats chips for breakout, fib, and watch key levels plus trend and roll plan counts when non-zero.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-03 23:25:43 +08:00
dekun 7957a62c65 fix(hub): use single position table header on desktop monitor cards
Render all exchange positions in one table row group instead of repeating column headers per symbol.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-03 23:20:34 +08:00
dekun 833c51e34a feat(hub): simplify desktop monitor cards to positions only
Move orders, key levels, entrust, trend plans, and roll groups to fullscreen detail view.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-03 23:15:55 +08:00
dekun ed3ff747f4 feat(hub): mobile 2x2 exchange alert dashboard tiles
Phone monitor list shows per-exchange tiles with offline, >10% float loss, and missing SL alerts; tap opens full desktop-style detail view.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-03 23:07:59 +08:00
dekun d07357b98e fix(hub): merge mark price from Flask snapshot and fix board refresh
Sync hub positions with instance price_snapshot (order_prices and position_marks).
Fix monitor board UI when hub restarts (version rewind) and queue snapshot fetches.
Expose board aggregate status on /api/ping for diagnostics.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-03 22:44:01 +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 c1fda1e7d5 feat(hub): show exchange mark price on monitor positions
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-03 22:25:23 +08:00
dekun 5b6babd699 feat(hub): background board poll every 5s with SSE snapshot updates
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-03 22:17:23 +08:00
dekun 6a76993ca8 fix(hub): prevent monitor board stuck on slow aggregate polling
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-03 21:47:11 +08:00
dekun b5f66a0db2 feat(hub): show cached monitor board when returning from market area
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-03 21:40:29 +08:00
dekun 7900a68d07 fix(hub): preserve key monitors when enrich_monitor returns partial payload
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-03 21:34:39 +08:00
dekun f95118065d feat(hub): exchange price precision, entry price, and trend DCA display
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-03 21:25:24 +08:00
dekun fac28c402b fix(okx): use OCO algo orders for hub TP/SL to avoid instant close
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-03 21:00:22 +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 e2bf58cfd3 feat(trend): 趋势回调保本移交下单监控并统一写交易记录
保本后结束趋势计划,持仓转入下单监控(备注趋势回调),交易所同时挂保本止损与计划止盈;中控或交易所平仓均经下单监控写入交易记录(trend_plan_id、开仓类型),四所共用 strategy_trend_register。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-03 17:01:34 +08:00
dekun d9b1b324f9 修复中控保本状态 2026-06-03 16:41:48 +08:00
dekun cf3e2ee1c9 feat: 持仓快照盈亏比与交易所止损已保本标识
盈亏比固定用开仓 initial_stop_loss 计算,人工改委托后不变化;轮询交易所止损触发价相对成交价判定已保本,四所实例与中控统一显示绿色标识。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-03 16:31:03 +08:00
dekun e265c1b31a feat(okx): auto-open on box/convergence key breakout like Gate/Binance
Replace alert-only check_key_monitors with market open flow, add _market_open_for_key_monitor, and update docs.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-03 16:08:32 +08:00
dekun a5f4ad8e97 fix(okx): show negative unrealized PnL on strategy page
Parse signed upl/unrealizedPnl from CCXT positions and fall back to calc_pnl when exchange metrics are missing.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-02 16:02:24 +08:00
dekun 724b4a3dd8 文档:补充中控行情区 K 线说明与索引
- 新增 manual_trading_hub/行情区说明.md

- 更新使用说明、README、部署文档、常见问题与仓库根 README

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-02 15:42:47 +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 eebc50cffa 修复 6h/8h/12h K 线间隔异常与 Gate 无原生 6h 问题
- 校验 K 线中位间隔,异常时从 1h 聚合

- 分页按实际 K 线步进 since;补充聚合单元测试

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-02 15:29:25 +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