Commit Graph

179 Commits

Author SHA1 Message Date
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 4f784d09ac fix: 四所统计日历显示每日盈亏与交易笔数
日历格子重置实例全局 button 样式,日期格展示 +X.XU 与 N 笔,标题栏汇总当月盈亏与总笔数。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-30 08:56:20 +08:00
dekun 052dcf63bd fix: 四所统计日历 embed 切换后初始化与加载失败仍渲染网格
统一 initInstanceStatsCalendar,统计 tab 动态注入时重新挂载日历,API 异常时保留月历骨架。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-30 08:42:39 +08:00
dekun ac4cdceb39 feat: 四所独立统计页日历,修复档案盈亏重复与日历交互
四所 index.html 统计分析页接入交易日历;内照明心剔除犯病盈亏列不再重复计入,犯病日点击显示全部交易,选中日历蓝色高亮。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-30 08:27:38 +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 e51d7824a7 fix: 全仓模式预估风险/盈利按杠杆与可用保证金计算
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-29 00:38:27 +08:00
dekun 02255a3b02 fix: 修复斐波/突破滚仓重复脚本导致无法提交
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-26 23:25:27 +08:00
dekun 6352fa6be3 fix: 滚仓拒绝原因页内展示,斐波/突破隐藏预览按钮
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-26 23:16:59 +08:00
dekun 5a887de6f4 fix: 滚仓斐波/突破价输入框可在切换模式后编辑
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-26 23:07:08 +08:00
dekun 7d03e8e93e fix: 滚仓字段显隐与浅色模式样式
市价加仓默认隐藏上沿/下沿/突破价(CSS+JS);说明页与预估风险条适配浅色主题。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-26 22:11:58 +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
dekun 0a20ee7eec Show estimated risk, profit, and RR below manual order form.
Add a preview bar under the live order form with risk in red and profit in green; extend preview logic for all SL/TP modes across embed and standalone instances.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-25 19:19:32 +08:00
dekun 2dadd93d91 Fix embed date filter reload and classify profitable stops as trailing TP.
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-25 11:27:42 +08:00
dekun 6ffae02d30 Allow roll add-ons while position-limit freeze is active.
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-24 02:08:44 +08:00
dekun 9d1986d771 Exclude trend and roll monitors from position-limit freeze count.
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-24 02:04:09 +08:00
dekun 322060de31 Show position-limit freeze on hub and instance risk badges.
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-24 01:58:24 +08:00
dekun 384d404bb3 Slim embed tab rendering to cut memory use and restore calculator.
Load only per-tab data for embed fragments, skip exchange capital fetches on tab switches, and harden calculator market imports/timeouts.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-24 01:33:42 +08:00
dekun 4ad335ca84 Add hub iframe embed shell with tab fragment API.
Replace full-page soft nav with a persistent shell and /api/embed/page loads so tab switches in the hub iframe avoid document.write flicker.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-24 01:13:34 +08:00
dekun 813ebf0e4e Skip exchange PnL sync on hub iframe soft nav to fix slow records tab.
Remove hover prefetch and mark soft-nav fetches so Gate/OKX render pages from local DB without blocking on exchange history sync.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-24 00:39:54 +08:00
dekun b18b2143b5 Restore hub iframe soft nav to cut blank tab switch gap.
Use fetch in-frame navigation with overlay and hover prefetch; show delayed hub loading spinner instead of hiding the iframe.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-24 00:32:03 +08:00
dekun 7f8ae97a98 Fix hub iframe nav flicker with normal navigation and loading overlay
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-24 00:06:17 +08:00
dekun e3559531d9 Revert instance soft nav cache to fix navigation flicker
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-23 23:59:27 +08:00
dekun 016c93faf2 Add 7-day local page cache for instant instance nav switching
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-23 23:52:28 +08:00
dekun e03863d780 Add roll leg avg/TP profit display and reduce instance nav flicker
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-23 23:42:02 +08:00
dekun 5e507d0b66 Use hub exchange instances for calculator contract precision.
Load enabled instances from settings, fetch market info via /api/hub/market, and apply exchange-specific amount and price precision in trend and roll calculators.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-23 18:13:02 +08:00
dekun 89909c64a3 Align trade record detail fields with label-value grid layout.
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-23 17:04:50 +08:00
dekun 21f86906da Fix mobile trade records hidden by CSS cascade overriding compact list.
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-23 16:58:56 +08:00
dekun c302c3e4ea Add mobile compact trade and journal lists with tap-to-expand detail.
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-23 16:53:56 +08:00
dekun 8e810154ca Add open-instance to trade page and mobile/tablet responsive layouts.
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-23 16:38:30 +08:00
dekun bd759c42d6 Use lightweight ticker APIs for liquidity rank to cut memory.
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-21 09:24:27 +08:00
dekun 073a382d41 Unify key support/resistance monitor type and fix form parity.
Merge 关键阻力位/关键支撑位 into 关键支撑阻力, share key_monitor_form.js across hub and new-tab views, and add hub shortcut to /key_monitor.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-19 08:31:14 +08:00
dekun 9330e356fc Fix freeze countdown exceeding configured cooloff hours.
Clamp future last_close anchors, cap remaining time server-side, prefer freeze_remaining_sec in the badge JS, and auto-repair stale DB rows on read.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-18 22:11:09 +08:00
dekun f8e760961e fix(risk): reset badge to normal when freeze countdown expires
Also expand account-risk-cooldown docs with countdown format, API fields, and frontend assets.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-18 17:47:47 +08:00
dekun 97370926d6 feat(risk): show live countdown on freeze status badges
Expose freeze_until_ms from risk API and tick hub/instance badges with remaining 1h/4h/daily time.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-18 17:41:04 +08:00
dekun 0280b4f065 fix(risk): shorten cooloff on review save and when count was reset
Allow 1h reduction for any active 4h-tier cooloff, hook trade record review updates, and fix freeze label thresholds.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-18 16:35:51 +08:00
dekun 3d29b4f9d9 fix(instance): restore review edit button after hub iframe nav
Sync review-mode checkbox with disabled state after form restore; repair initHubEmbedInFrameNav regression in instance_theme.js.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-18 11:21:31 +08:00
dekun d8dccb8606 fix(hub): stop instance iframe nav flash after account status badge
Load account_risk_badge.css before body paint, skip redundant hub theme re-apply, remove iframe hide overlay, and disable badge transitions in hub embed.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-17 19:36:48 +08:00
dekun 6520234bd8 fix(hub): eliminate iframe flash when switching instance nav tabs
Use soft in-frame navigation and loading overlay in hub instance shell; pass embed=1 for iframe SSO opens.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-17 19:27:52 +08:00
dekun be7f5d5072 fix(auth): stop pre-filling login username on new devices
Remove username_hint from hub auth status API and disable autocomplete on hub and instance login forms.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-17 19:21:46 +08:00
dekun b6acbf4b2c fix(risk): trigger cooldown only on user-initiated closes
Remove external-close risk hooks; register user_instance, user_hub, and user_trend_stop via hub API and trend stop; update docs and tests.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-17 19:14:05 +08:00
dekun 850ffcd7d2 style(risk): polish account status badge for light and dark themes
Extract shared account_risk_badge.css with theme-aware contrast, dot indicator, and hub/instance layout fixes.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-17 17:37:32 +08:00
dekun e307eef690 feat(risk): add account cooldown and daily freeze after manual/external close
Implements shared account_risk_lib with 4h/1h cooloff and daily freeze rules, wires hooks into all four exchange apps and hub monitor UI, with tests and docs.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-17 17:05:19 +08:00
dekun b77741ee21 fix(order): hide RR preview in fixed-RR mode and serve shared JS
manual_order_rr_preview.js was not routed from repo static/, so hide logic never ran. Add Flask routes on four exchanges, default hidden in HTML, and toggleSltpMode visibility.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-17 10:59:45 +08:00
dekun ca1e25888d fix(sync-close): reject pre-open fills when backfilling trade records
False external-close sync could match historical closing trades before opened_at, producing stop-loss results with closed_at earlier than opened_at. Only use fills at or after open time.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-16 17:03:51 +08:00
dekun 6287ca9129 fix(binance): show orphan recover banner on trade page load
Trade tab uses refreshPriceSnapshotConditional, not refreshPriceSnapshot; render recover banner there and on server when live exchange position lacks active monitor.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-16 16:59:20 +08:00