Commit Graph

142 Commits

Author SHA1 Message Date
dekun d9b8069906 Add shared records review pagination for all three exchanges.
Paginate trade records, journals, and AI history at 5 per page with soft in-card flips; hide the journal form until 填入复盘.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-17 11:52:02 +08:00
dekun 19a4a5194d Use per-exchange PWA names and logos for instance app installs.
Show Binance/OKX/Gate 交易系统 with distinct exchange icons in manifests, apple titles, and login branding.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-16 08:44:07 +08:00
dekun 1e765f4b2b Silence Flask access logs and retain PM2 logs for 3 days.
Stop werkzeug request spam into PM2 error files, truncate oversized logs, and install daily logrotate with 3-day retention.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-15 07:53:19 +08:00
dekun 02472f19cb Fix breakeven badge still showing after roll lowers stop loss.
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-10 16:52:29 +08:00
dekun 23ba725c89 Fix intraday profit amount and hide TP/SL cancel for day trades.
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-09 09:55:09 +08:00
dekun d3a44b23db Split journal order type from entry reason and fix review edit toggle in embed shell.
Adds order_type to journal uploads, removes legacy swing/trend labels from entry reason options, and ensures review-edit buttons sync when the records tab loads dynamically.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-09 09:27:03 +08:00
dekun b733e551a0 Normalize fullwidth punctuation to ASCII across codebase.
Add scripts/normalize_ambiguous_unicode.py; fix corrupted patch_instance_theme_templates.py. Preserves curly quotes in string literals; removes Git homoglyph warnings on .env.example.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-08 23:42:26 +08:00
dekun 1ee9eb02c3 Add settings page tabs and show env API keys with last four digits.
System settings now use the same CSS tab layout as env config; sensitive env fields display masked values from .env while keeping save-on-empty behavior.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-08 21:31:14 +08:00
dekun aa966114b1 Fix settings and env config stuck on loading via SSR form render
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-08 20:24:15 +08:00
dekun ef4b2f17ca Add instance nav prefs, env config UI, and PM2 restart.
P1-P4: configurable nav/section visibility in system settings, full .env editor with restart badges, password change, runtime hot overrides, and single-instance pm2 restart. Works in hub embed iframe.
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-08 20:07:06 +08:00
dekun d84a265b67 Split risk policy into its own navigation tab.
Move read-only risk control docs to /risk_policy before settings; keep transfers and exports on the settings page.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-08 19:42:29 +08:00
dekun e3e53ff7f5 Fix roll position display: live contracts, TP profit, and 2-decimal qty precision.
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-08 17:06:33 +08:00
dekun f5f302b97e Add month/quarter/half-year/all list window presets with this month as default.
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-08 11:22:29 +08:00
dekun 6571fc9029 fix: enable threaded Flask on binance/gate for SSE embed live push
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-07 11:24:17 +08:00
dekun 814fe67a21 feat: expand header stats with total funds and profit-loss ratio
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-07 02:14:18 +08:00
dekun 659c0969fe fix: show header realtime PnL from exchange positions and order metrics
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-07 02:04:40 +08:00
dekun 6547029a89 feat: compact instance toolbar, stats strip and settings two-column layout
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-07 01:37:19 +08:00
dekun d87081205d feat: instance system settings page with risk docs, export and transfer
顶栏新增系统设置;风控说明读取 .env;数据导出与资金划转迁入三张卡片;顶栏移除导出条与手动划转。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-07 01:26:38 +08:00
dekun 2a3d264c8f fix: allow force-close in trade review and hide strategy nav for intraday
统计核对结果允许强制清仓;日内户顶栏隐藏策略交易与策略交易记录。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-07 01:01:57 +08:00
dekun 5a0d18cf99 feat: add force-close exit trigger and round journal real RR to 2dp
复盘离场触发增加强制清仓;填入复盘与自动计算实际盈亏比保留两位小数。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-07 00:40:55 +08:00
dekun 1092816359 feat: review entry reason picker uses dropdown instead of prompt
Add modal select for trade record review, expand options to two-level labels (反转/启动A), and accept legacy short labels on save.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-07 00:38:16 +08:00
dekun f580e4542d feat: show entry type as category/subtype (反转/启动A)
Format持仓与交易记录开仓类型为两级展示;新平仓写入与旧短标签自动展开。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-07 00:27:53 +08:00
dekun 99eb16dbd8 fix: Gate force-close badge and classify midnight closes correctly
Narrow executing window to 15 minutes after the hour, show countdown when flat, run force_close before reconcile, and map 00:00 synced closes to 强制清仓 instead of 手动平仓.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-07 00:23:40 +08:00
dekun d520ba6904 fix: OKX manual orders save entry_model for trade record 开仓类型
OKX add_order omitted entry_model on insert; align with Binance/Gate and add trade_style fallback when resolving entry_reason for close and display.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-07 00:15:22 +08:00
dekun d3753f1aee Fix Gate price_snapshot 500: define FUNDS_DECIMALS
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-06 22:27:58 +08:00
dekun 8e1492e4f0 Fix mark/PnL display fallback and intraday entry labels
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-06 22:19:42 +08:00
dekun d4a76f05d2 Fix Gate mark/PnL/TP-SL snapshot and intraday order UI
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-06 22:04:19 +08:00
dekun 4904a86e03 fix: hide hub close/entrust controls for intraday discipline profile
Expose intraday_discipline via hub meta and block manual close/tpsl APIs; Gate instance card no longer shows 全平/平仓/委托.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-06 02:26:22 +08:00
dekun a268a93027 feat: show force-close badge and countdown when FORCE_CLOSE is enabled
Add shared lib/UI for midnight force-close indicator on instance and hub pages, and document Gate intraday 0-point exit alignment.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-06 02:17:47 +08:00
dekun fa9e6be36d feat: show entry type in trade records, remove journal custom entry reason
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-06 00:49:21 +08:00
dekun ea429b2694 feat: 趋势户开仓类型大分歧A/B/小分歧,自动联动趋势波段与复盘
下单监控增加 entry_model 下拉;平仓写入短标签并预填复盘。Binance/OKX 用趋势 profile,Gate 日内仍用手选 trade_style。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-06 00:18:38 +08:00
dekun 21894334f8 feat: KEY_AUTO_ORDER_ENABLED 三所统一开关,联动关键位自动单与开仓类型
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-05 23:39:06 +08:00
dekun f688a504e1 ui: 复盘表单紧凑布局、即时上传截图并移除占用时新开仓
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-05 22:46:05 +08:00
dekun 7bb6ee1154 remove: 全面移除「错过机会」功能与文案
删除手动记录表单与 /add_miss;停止自动生成错过类交易记录;列表/统计/顶栏不再展示;复盘卡片改为整行。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-05 22:21:30 +08:00
dekun 88fe4bbe56 feat: 复盘四周期手动上传,移除 AI 识别预填
固定 5m/15m/1h/4h 四槽截图上传与详情四宫格展示;自动 K 线默认关闭且与手动上传互斥。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-05 21:57:41 +08:00
dekun c0ad50a7b5 feat: 账户方向与币种白名单 env 开关(三所)
Per-instance TRADE_DIRECTION / TRADE_SYMBOL_WHITELIST restricts UI and API for manual orders, key monitors, and strategies; includes sync script for deployment profiles.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-05 00:30:49 +08:00
dekun eb975b0133 fix: 交易安全审计修复 — 补偿平仓、中控同步、滚仓/趋势防护
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-04 22:44:16 +08:00
dekun df28e6dfb8 fix: ccxt Gate 类名 gateio 改为兼容 gate
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-04 22:21:33 +08:00
dekun 687a34474d feat: 修改委托后展示最新风险,四所持仓卡增加张数
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-02 22:08:27 +08:00
dekun 5797d49d8a refactor: 将共用代码迁入 lib/ 模块化目录
统一 strategy、key_monitor、trade、hub 等共用库到 lib/ 子包,并补充 lib-structure 文档,便于四所与中控维护。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-02 16:23:09 +08:00
dekun 4742a0bb9d refactor: 移除四所统计分析页交易日历
删除日历 UI、bootstrap 与 /api/stats/calendar 注册;保留日/周/月统计表。内照明心档案日历不受影响。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-30 09:51:10 +08:00
dekun 32079bb4c2 fix: 修复统计日历 bootstrap 导致整站 500
日历数据改为安全 JSON 内嵌,仅统计页构建;构建失败时降级为空,避免拖垮其他页面。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-30 09:24:54 +08:00
dekun 3b687d17eb fix: 统计日历服务端内嵌 bootstrap,首屏显示盈亏与笔数
与月统计同源 initial_calendar 写入页面,API 失败时仍渲染;四所日历路由独立注册并传入 get_db_fn。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-30 09:13:58 +08:00
dekun 14dbf25798 feat: 档案统计独立卡片、共用交易日历与四所统计页日历
内照明心统计表移至顶部卡片,右侧为日历/图表/交易记录;日历样式适配浅深主题,四所统计分析页同步展示按月盈亏日历。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-30 08:17:53 +08:00
dekun 6b872b1f43 feat: 内照明心交易日历与交易所口径成交额/手续费统计
新增按 08:00 切日的月历(盈亏、笔数、犯病日高亮与点击筛选);平仓时从交易所 fill 写入双边成交额与手续费,统计表与明细同步展示。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-30 08:05:46 +08:00
dekun 865567fbd3 fix: add_key 允许突破触价开仓类型通过白名单校验
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-29 20:55:51 +08:00
dekun a0d57fc65e fix: 箱体/收敛突破标记价反向越界时自动撤销监控
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-29 10:54:36 +08:00
dekun 5b3448b52b feat: 关键位回调/突破触价开仓拆分与穿越触发
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-29 10:49:43 +08:00
dekun d467760d5c 顺势加仓 v2:程序监控滚仓、文档页与平仓同步
重写滚仓计仓与四种加仓方式(市价/斐波/突破),程序盯 mark 触价成交;风险读监控单;pending 可删不可改;手动平仓同步结束滚仓。新增 /strategy/roll/docs 说明页与顺势加仓滚仓说明.md。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-26 22:03:23 +08:00
dekun 448e88ec55 Count instance win rate by positive PnL and show external closes as manual close.
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-25 22:27:52 +08:00