feat: DB-first architecture with lock-safe writes
- price_monitor: writes live prices to both JSON and mofin.db (holdings + live_prices + portfolio_summary) - mofin_db: added execute_with_retry/commit_with_retry with exponential backoff on 'database is locked' - mofin_db: increased timeout 5s->15s, added PRAGMA busy_timeout=15000 - price_monitor retry loop: fixed break-before-if-ok bug (was not retrying on write failure) - DB connection: WAL mode + retry decorator for all write operations - cash sync: preserves DB authoritative cash (JSON cash not pushed to DB) This is the DB-first version. JSON writes remain for dashboard compatibility. Next step: remove JSON writes entirely for full DB-only architecture.
This commit is contained in:
@@ -165,6 +165,11 @@
|
||||
"time": "2026-07-01T08:55:24.130605",
|
||||
"content": "**港股(恒指-0.63%):** 中芯国际H(00981) 89.40+5.42%浮盈+17%持有 | 腾讯控股(00700) 429.80+2.28%浮亏-3%距止损3.4% | 丘钛科技(014",
|
||||
"report_id": "cron_d42f2ce3b479_2026-06-30_20-25-27"
|
||||
},
|
||||
{
|
||||
"time": "2026-07-06T08:55:01.761812",
|
||||
"content": "| **中芯国际双持(688981+00981)** | A+H 双持合计约 9.64% 仓位,两市场同步净多头,若港股中芯继续走弱(注意 00981 止损 ¥77.55 高于成本 ¥75.94 的异",
|
||||
"report_id": "cron_e02b8bde74f8_2026-07-05_22-05-42"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -616,6 +616,21 @@
|
||||
"content": "- **比亚迪(01211)** — 现价72.65,止损63.99(距12%)。港股汽车板块整体承压,持续下跌趋势未改。建议:重新审视持股逻辑——如果中线看多理由充分,可考虑将止损下移至60附近;如",
|
||||
"report_id": "cron_e02b8bde74f8_2026-06-28_22-11-21"
|
||||
},
|
||||
{
|
||||
"time": "2026-07-06T08:55:01.761812",
|
||||
"content": "3. **0714止盈策略严重过期** — 当前 19 个持仓中有约 13 个(68%)的成本价高于止盈价,说明策略数据已随股价下跌严重偏离,大量止损/止盈位明显陈旧(如万科 02202 成本 ¥4.",
|
||||
"report_id": "cron_e02b8bde74f8_2026-07-05_22-05-42"
|
||||
},
|
||||
{
|
||||
"time": "2026-07-06T08:55:01.761812",
|
||||
"content": "3. **策略数据翻新** — 针对成本远高于止盈的 13 个持仓(如 万科02202、比亚迪01211、华恒生物688639、中科电气300035、黄金ETF518880 等),建议逐个审核是否需要",
|
||||
"report_id": "cron_e02b8bde74f8_2026-07-05_22-05-42"
|
||||
},
|
||||
{
|
||||
"time": "2026-07-06T08:55:01.761812",
|
||||
"content": "| **比亚迪(01211)止损临近** | 此前 advice 反复提示止损 ¥81.72、现价距仅 3%。港股比亚迪已是 4.62% 仓位且浮亏 -20.1%,若下周港股继续弱势,止损单需提前挂好",
|
||||
"report_id": "cron_e02b8bde74f8_2026-07-05_22-05-42"
|
||||
},
|
||||
{
|
||||
"time": "2026-06-01T10:25:54.503460",
|
||||
"content": "比亚迪股份(01211) 仓位4.56% +2.27%→ 持有,连涨",
|
||||
|
||||
@@ -456,6 +456,16 @@
|
||||
"content": "③ 丘钛科技(01478) 距止损6.48仅+7.3%!仓位7.97%",
|
||||
"report_id": "cron_d42f2ce3b479_2026-07-03_20-03-44"
|
||||
},
|
||||
{
|
||||
"time": "2026-07-06T08:55:01.761812",
|
||||
"content": "2. **收紧输出质量** — 使用\"关注/观望/留意\"时须紧随具体价格、止损位和触发条件。满 3 次模糊表述自动标记为低质量输出。对 01478 和 688795 做一次明确的持仓策略复核:继续持有",
|
||||
"report_id": "cron_e02b8bde74f8_2026-07-05_22-05-42"
|
||||
},
|
||||
{
|
||||
"time": "2026-07-06T08:55:01.761812",
|
||||
"content": "| **丘钛科技(01478)** | 7.97% 第三大仓位,成本 ¥13.47 远超止盈 ¥7.59(浮亏约 -43%),150 次提及却无追踪结论。无论继续持有还是止损,需 Dad 明确决策 |",
|
||||
"report_id": "cron_e02b8bde74f8_2026-07-05_22-05-42"
|
||||
},
|
||||
{
|
||||
"time": "2026-06-01T10:25:54.503460",
|
||||
"content": "丘钛科技(01478) 仓位8.58% +4.10%→ 持有,走势健康",
|
||||
|
||||
@@ -621,6 +621,16 @@
|
||||
"content": "- **万科(02202)** — 现价2.20,止损2.00(距9%)。周五港股继续弱,若跌破2.00港币将触发止损。建议:提前制定应对方案,而不是等到触发了再慌。",
|
||||
"report_id": "cron_e02b8bde74f8_2026-06-28_22-11-21"
|
||||
},
|
||||
{
|
||||
"time": "2026-07-06T08:55:01.761812",
|
||||
"content": "3. **0714止盈策略严重过期** — 当前 19 个持仓中有约 13 个(68%)的成本价高于止盈价,说明策略数据已随股价下跌严重偏离,大量止损/止盈位明显陈旧(如万科 02202 成本 ¥4.",
|
||||
"report_id": "cron_e02b8bde74f8_2026-07-05_22-05-42"
|
||||
},
|
||||
{
|
||||
"time": "2026-07-06T08:55:01.761812",
|
||||
"content": "3. **策略数据翻新** — 针对成本远高于止盈的 13 个持仓(如 万科02202、比亚迪01211、华恒生物688639、中科电气300035、黄金ETF518880 等),建议逐个审核是否需要",
|
||||
"report_id": "cron_e02b8bde74f8_2026-07-05_22-05-42"
|
||||
},
|
||||
{
|
||||
"time": "2026-06-04T09:55:40.300986",
|
||||
"content": "- 万科(02202): 补仓区间2.5~2.6,昨收2.70,距+3.8%,未进入。",
|
||||
|
||||
@@ -20,6 +20,11 @@
|
||||
"time": "2026-06-28T08:55:52.587605",
|
||||
"content": "6. 🟢 **中国人寿** (02628) — 距买入区-2%,保险板块虽弱但估值低",
|
||||
"report_id": "cron_watchlist_health_weekly_2026-06-27_20-04-22"
|
||||
},
|
||||
{
|
||||
"time": "2026-07-05T08:55:15.087154",
|
||||
"content": "6. 中国人寿(02628) — 接近止损位28.26,保险板块承压",
|
||||
"report_id": "cron_watchlist_health_weekly_2026-07-04_20-13-24"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -725,6 +725,11 @@
|
||||
"time": "2026-06-14T08:55:34.460610",
|
||||
"content": "- 中国人寿(02628) & 小鹏汽车(09868) — 盈亏比过低,不建议买入",
|
||||
"report_id": "cron_watchlist_health_weekly_2026-06-13_20-07-41"
|
||||
},
|
||||
{
|
||||
"time": "2026-07-05T08:55:15.087154",
|
||||
"content": "4. 小鹏汽车(09868) — 跌破止损位,汽车行业竞争格局",
|
||||
"report_id": "cron_watchlist_health_weekly_2026-07-04_20-13-24"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -861,6 +861,11 @@
|
||||
"content": "{\"type\":\"周复盘\",\"time\":\"周日\",\"summary\":\"A股先跌后弹分化格局,全市场普跌后暴力反弹\",\"key_holdings\":[{\"code\":\"600110\",\"name\":",
|
||||
"report_id": "cron_e02b8bde74f8_2026-06-14_22-04-57"
|
||||
},
|
||||
{
|
||||
"time": "2026-07-06T08:55:01.761812",
|
||||
"content": "2. **海博思创(688411)追踪较好** — 该股在持仓中占比 6.31%,成本 ¥266.95 处于买入区内(¥231.32~¥269.87),参与价合理,后续追踪记录清晰,止盈 ¥277.5",
|
||||
"report_id": "cron_e02b8bde74f8_2026-07-05_22-05-42"
|
||||
},
|
||||
{
|
||||
"time": "2026-06-03T09:56:06.723399",
|
||||
"content": "| 688411 | 海博思创 | 295.00 | 299.17 | -1.39% | 追踪止盈290 | 正常 |",
|
||||
|
||||
@@ -91,6 +91,11 @@
|
||||
"content": "- 华恒生物(688639) ¥21.2,买入区20.78~21.4 ✅ 在区间内,RR:2.28",
|
||||
"report_id": "cron_e02b8bde74f8_2026-06-14_22-04-57"
|
||||
},
|
||||
{
|
||||
"time": "2026-07-06T08:55:01.761812",
|
||||
"content": "3. **策略数据翻新** — 针对成本远高于止盈的 13 个持仓(如 万科02202、比亚迪01211、华恒生物688639、中科电气300035、黄金ETF518880 等),建议逐个审核是否需要",
|
||||
"report_id": "cron_e02b8bde74f8_2026-07-05_22-05-42"
|
||||
},
|
||||
{
|
||||
"time": "2026-06-01T10:25:54.503460",
|
||||
"content": "华恒生物(688639) 仓位0.47% -1.71%→ 持有,低位整理",
|
||||
|
||||
@@ -26,6 +26,11 @@
|
||||
"content": "• **摩尔线程(688795) 616.38** +2.73% | 买入区580-600,偏高→等回调至600以下",
|
||||
"report_id": "cron_d3797d924ddc_2026-06-02_16-33-11"
|
||||
},
|
||||
{
|
||||
"time": "2026-07-06T08:55:01.761812",
|
||||
"content": "2. **收紧输出质量** — 使用\"关注/观望/留意\"时须紧随具体价格、止损位和触发条件。满 3 次模糊表述自动标记为低质量输出。对 01478 和 688795 做一次明确的持仓策略复核:继续持有",
|
||||
"report_id": "cron_e02b8bde74f8_2026-07-05_22-05-42"
|
||||
},
|
||||
{
|
||||
"time": "2026-06-14T08:55:34.460610",
|
||||
"content": "**🟢 摩尔线程-U(688795) ¥610.55 | 买入区598.34~622.76 ✅ | RR:3.44**",
|
||||
|
||||
@@ -151,6 +151,11 @@
|
||||
"content": "② 中芯国际A(688981) 已跌破止损位!仓位5.44%",
|
||||
"report_id": "cron_d42f2ce3b479_2026-07-03_20-03-44"
|
||||
},
|
||||
{
|
||||
"time": "2026-07-06T08:55:01.761812",
|
||||
"content": "| **中芯国际双持(688981+00981)** | A+H 双持合计约 9.64% 仓位,两市场同步净多头,若港股中芯继续走弱(注意 00981 止损 ¥77.55 高于成本 ¥75.94 的异",
|
||||
"report_id": "cron_e02b8bde74f8_2026-07-05_22-05-42"
|
||||
},
|
||||
{
|
||||
"time": "2026-06-11T08:55:23.441938",
|
||||
"content": "• 中芯国际(688981) 竞价125.00(-1.81%),策略买入区116~136内",
|
||||
|
||||
Reference in New Issue
Block a user