root
d7788d3766
feat: L7事件流 — live_events表+API+前端+三模块事件写入
...
DB:
- live_events表(id/ts/level/category/symbol/message/detail)
后端:
- GET /api/live/events?limit=30&level=all|critical|warn|info&category=all|trade|risk
- log_live_event() 异步辅助函数
事件源:
- live_executor: 开仓成功写event(trade/info, 含滑点/score)
- position_sync: 平仓写event(trade, 含PnL拆解)
- risk_guard: 熔断/禁仓/恢复写event(risk/critical|warn|info)
前端L7:
- 5秒轮询, 最近30条事件
- 按级别筛选(全部/严重/警告/信息)
- 彩色分类标签(trade绿/risk红/system灰/reconciliation紫)
- 时间线布局, 最大高度56带滚动
2026-03-02 10:22:40 +00:00
root
fb0c3806b5
feat: PnL五项拆解 (gross/fee/funding/slippage/net)
...
后端:
- /api/live/trades 返回 gross_pnl_r, fee_r, funding_r, slippage_r, net_pnl_r
- gross = 方向盈亏(含TP1半仓锁定)
- fee_r = 实际手续费/risk_usd
- funding_r = 不利资金费/risk_usd
- slippage_r = 滑点损失估算
- net = pnl_r(已是净值)
前端L10:
- 表头改为: Gross | Fee | FR | Slip | Net
- 颜色: gross绿/红, fee橙, FR紫, slip灰, net加粗绿/红
- 每笔交易一目了然:赚了多少、扣了多少、净剩多少
2026-03-02 10:13:51 +00:00
root
cb869926e2
feat: 完整11层实盘页面 + 补充API
...
前端(/live page.tsx 594行):
- L0: 顶部固定风险条(sticky) - 交易状态/R预算/对账/清算/连亏
- L1: 一键止血区 - 全平/禁新仓/恢复(双重确认)
- L2: 账户概览8卡片 - 权益/保证金/杠杆/今日PnL/总PnL/成本/胜率PF
- L3: 当前持仓(WS实时) - 含清算距离/滑点/裸奔/延迟/OrderID
- L4: 执行质量面板 - 滑点/延迟P50/P95按币种分组
- L5: 对账面板 - 本地vs币安持仓+挂单+差异列表
- L6: 风控状态 - 规则检查+熔断原因+恢复条件
- L8: 实盘vs模拟盘对照 - signal_id匹配+入场差/R差
- L9: 权益曲线+回撤 - 双Area叠加
- L10: 历史交易 - 含成交价/滑点/费用+筛选
- L11: 系统健康 - PM2进程状态+数据新鲜度
后端新增API:
- /api/live/account: 币安账户数据
- /api/live/health: PM2进程+数据新鲜度
- /api/live/reconciliation: 对账(本地vs币安)
- /api/live/execution-quality: 执行质量统计
- /api/live/paper-comparison: 实盘vs模拟盘
2026-03-02 09:38:14 +00:00
root
832f78a1d7
feat: live API endpoints (/api/live/*)
...
- /api/live/summary: 实盘总览(含风控状态+手续费+资金费)
- /api/live/positions: 当前持仓(含binance_order_id/滑点/裸奔时间/持仓时长)
- /api/live/trades: 历史交易(含成交价/滑点/手续费/资金费)
- /api/live/equity-curve: 权益曲线
- /api/live/stats: 详细统计(含滑点P50/P95/按币种)
- /api/live/risk-status: 风控状态读取
- POST /api/live/emergency-close: 紧急全平
- POST /api/live/block-new: 禁止新开仓
- POST /api/live/resume: 恢复交易
2026-03-02 09:14:05 +00:00
root
88290882f9
fix: add risk_distance to positions API query
...
SQL SELECT was missing risk_distance column, causing fallback to
abs(entry-sl) which is wrong after TP1 moves SL to breakeven
2026-03-02 07:08:49 +00:00
root
72ea0ffd0e
fix: remove 0.7 ATR multiplier, store risk_distance in DB
...
- Removed 0.7*ATR multiplier from signal_engine and paper_monitor
- risk_distance now stored per-trade in paper_trades table
- paper_monitor/signal_engine read risk_distance from DB (no hardcoded values)
- V5.1 TP/SL: 2.0/1.5/3.0 -> 1.4/1.05/2.1 (same actual distance)
- V5.2 TP/SL: 3.0/2.0/4.5 -> 2.1/1.4/3.15 (same actual distance)
- Fixed V5.2 pnl_r: all historical values corrected by *2/3
- API unrealized_pnl_r also reads from DB risk_distance
2026-03-02 07:00:05 +00:00
root
984019d9ab
fix: paper latest signals use signal-history with strategy filter + layer scores
...
- V5.1 paper: signal-history?strategy=v51_baseline
- V5.2 paper: signal-history?strategy=v52_8signals
- API now returns factors in signal-history
- Each signal shows layer score badges below
2026-03-02 03:08:19 +00:00
root
7ebdb98643
feat: store and serve indicators per strategy
...
- signal_indicators table: added strategy column
- Each strategy gets its own row per cycle
- API /api/signals/latest?strategy=v51_baseline|v52_8signals
- API /api/signals/signal-history?strategy=...
- V5.1 page reads v51_baseline data, V5.2 reads v52_8signals
- Now V5.1 and V5.2 show truly independent scores
2026-03-02 02:52:17 +00:00
root
e405a9c21e
fix: parse factors JSON string in /api/signals/latest
...
psycopg2 writes factors as JSON string, asyncpg reads it back as string
instead of dict. Parse it before returning to frontend.
2026-03-02 00:44:36 +00:00
root
01b1992643
feat: save factors to signal_indicators + show FR/Liq on signals page
...
- DB: added factors JSONB column to signal_indicators
- Backend: save_indicator now includes factors JSON
- API: /api/signals/latest returns factors field
- Frontend: signals page shows FR and 清算 score bars
2026-03-01 23:57:55 +00:00
root
a9c3523a24
feat: independent strategy paper trading controls
...
- Each strategy has its own position count (max 4 each)
- paper_config.enabled_strategies: per-strategy toggle
- is_strategy_enabled() checks both master switch and strategy list
- API: /api/paper/config now supports enabled_strategies array
- Config auto-loads on API startup
Usage: POST /api/paper/config {enabled_strategies: ['v52_8signals']}
2026-03-01 12:43:46 +00:00
root
778cf8cce1
feat: V5.2 frontend differentiation - strategy tabs, side-by-side scores, visual badges
...
- Paper page: prominent strategy tabs (全部/V5.1/V5.2) at top
- Paper trades: strategy column with color-coded badges (blue=V5.1, green=V5.2)
- Paper positions: FR/Liq scores displayed prominently for V5.2
- Signals page: side-by-side V5.1 vs V5.2 score comparison cards
- Signals page title updated to 'V5.1 vs V5.2'
- New API endpoint for strategy comparison data
- Layout: local font fallback for build stability
2026-03-01 12:21:19 +00:00
root
f6156a2cfe
Add strategy-aware paper trade schema and API endpoints
2026-03-01 11:55:00 +00:00
root
77d38c7269
fix: add total_pnl to stats API top-level response
2026-03-01 01:42:39 +00:00
root
bda42e669a
feat: stats panel with per-symbol tabs (ALL/BTC/ETH/XRP/SOL) - full stats for each coin
2026-03-01 01:37:02 +00:00
root
d0e626a437
feat: paper summary add balance + pnl_usdt
2026-02-28 12:00:19 +00:00
root
d177d28498
fix: paper positions use Binance realtime price instead of signal_indicators
2026-02-28 11:49:49 +00:00
root
f90df6f3b5
feat: paper positions show real-time price + unrealized PnL (R + USDT)
2026-02-28 11:40:11 +00:00
root
b232270948
fix: add Request import
2026-02-28 11:20:05 +00:00
root
cd17c76000
fix: remove duplicate return causing IndentationError in main.py
2026-02-28 11:19:01 +00:00
root
282aed138a
feat: paper trading switch + config API + max positions limit
2026-02-28 11:13:39 +00:00
root
e054db112d
feat: paper trading - backend (table+signal_engine integration+5 APIs) + frontend page
2026-02-28 11:10:28 +00:00
root
0ac2225979
feat: add XRP and SOL symbols (4 coins total)
2026-02-28 10:11:05 +00:00
root
ec6a8fc64d
fix: rename signal-history API to avoid route conflict + restart backfill
2026-02-28 06:22:32 +00:00
root
424cb993f8
feat: signal history list + always compute scoring even without signal
2026-02-28 06:09:32 +00:00
root
2e969f68b4
fix: parse JSONB string from asyncpg + frontend parseVal fallback
2026-02-28 05:49:42 +00:00
root
7ca843ca70
fix: revert signals/latest API to explicit column query (to_jsonb broke field names)
2026-02-28 05:45:21 +00:00
root
340d8eb3a1
feat: V5.1 frontend - 5-layer scoring display + market indicators panel
2026-02-28 05:33:40 +00:00
root
748f6f57a5
perf: server/status接口优化(cpu非阻塞+pm2直接调用+COUNT估算+5秒缓存)
2026-02-27 18:46:56 +00:00
root
930c8d3a9c
feat: 服务器监控面板(/server) - CPU/内存/硬盘/PM2进程/PG数据库/回补状态
2026-02-27 17:30:41 +00:00
root
61287657df
perf: trades/summary聚合下推PG(SQL GROUP BY替代Python循环) + trades/latest加2秒缓存
2026-02-27 16:52:35 +00:00
root
4168c1dd88
refactor: SQLite→PostgreSQL migration - db.py连接层 + main/collector/signal-engine/backfill全部改PG
...
Phase 1: 核心数据表(agg_trades/rate_snapshots/signal*)迁PG
auth.py暂保留SQLite(低频,不影响性能)
- db.py: psycopg2同步池 + asyncpg异步池 + PG schema + 分区管理
- main.py: 全部改asyncpg查询
- collector: psycopg2 + execute_values批量写入
- signal-engine: psycopg2同步读写
- backfill: psycopg2 + ON CONFLICT DO NOTHING
2026-02-27 16:15:16 +00:00
root
547f093352
feat: V5 signal-engine + API endpoints for indicators/latest/trades
2026-02-27 15:31:12 +00:00
root
bb187167bb
feat: add LiveTradesCard - real-time agg trades display + /api/trades/latest endpoint
2026-02-27 11:35:55 +00:00
root
7e38b24fa8
feat: V3.0 aggTrades collector - WS+REST补洞+巡检+按月分表+查询API
2026-02-27 11:29:16 +00:00
root
1ab228286c
feat: V2.0 auth system - JWT access/refresh, invite codes, route protection, admin CLI, auth gate blur overlay
2026-02-27 11:08:57 +00:00
root
11667d4faa
feat: add YTD annualized rate to RateCard
2026-02-27 10:08:22 +00:00
root
362c1f1e16
fix: add /api/signals/history endpoint
2026-02-27 08:54:13 +00:00
root
32e9dd3531
feat: rate kline unit x10000 (bps), default interval 1h
2026-02-27 07:56:07 +00:00
root
80c4ea67e7
fix: add background snapshot loop - collect every 2s regardless of frontend
2026-02-27 07:04:41 +00:00
root
072592145f
feat: kline page with lightweight-charts + /api/kline OHLC aggregation endpoint
2026-02-27 06:36:19 +00:00
root
8efa6ede32
feat: rate_snapshots 2s persistent storage + /live realtime chart page
2026-02-27 05:47:26 +00:00
root
03218dce04
fix: split rate/stats refresh intervals, rates 2s stats 2min
2026-02-26 13:57:39 +00:00
root
42e329cc55
fix: add cache to prevent Binance rate limit (rates 3s, history/stats 60s)
2026-02-26 13:54:59 +00:00
root
44e07eabb2
feat: arbitrage engine Phase 0 scaffold - FastAPI + Next.js
2026-02-26 12:06:10 +00:00