知微
8cc0aa13c5
fix: reassess结果写入strategy_evaluations表(持仓/自选/无策略3种路径)
2026-07-08 11:19:48 +08:00
知微
8a77b43ea1
fix: 管道审计覆盖6条关键数据流+holding_strategies+decisions.json
2026-07-08 11:13:59 +08:00
知微
9f5bc8b004
fix: macro_context_log 12天不更新+自检覆盖+JSON文件问题
2026-07-08 11:09:33 +08:00
知微
0793162bbf
fix: 自检加第4项——gateway实际LLM推理检测(发ok→5tok)
2026-07-08 10:25:54 +08:00
知微
d75694c9e5
fix: 磁盘IO优化——state.db auto_vacuum+cache增大+每周压缩
2026-07-08 10:13:49 +08:00
知微
bdd0611275
fix: 去掉ping骚扰+注入datetime防日期幻觉
...
1. cron_health_monitor/verify_reassess_pipeline: bridge检测从发ping改为TCP端口检测
2. xmpp_agent_core: call_hermes注入当前时间防止LLM日期幻觉
[当前时间: 2026-07-07 15:32 Tuesday]
3. 修复import datetime缺失
2026-07-07 15:33:14 +08:00
知微
ad74ede2b8
fix: 自选股强制重评+潜力股管道解冻+健康监控阈值修正
...
1. mofin_collect.py: 加入自选股(watchlist_stocks)强制重评, 输出持仓+自选两段
2. cron_health_monitor: 只监控7个实时管道, 排除日/周任务
3. 解冻: 知微洞察生成(a1f06826) + 市场精选推荐(759064f5)
2026-07-07 13:37:07 +08:00
知微
8f34681e8d
fix: 宏观风险扫描是日任务改到正确job名 宏观风险信号消费
2026-07-07 12:49:47 +08:00
知微
6237a01f61
fix: cron健康监控只监控实时管道, 排除日/周任务
2026-07-07 12:29:34 +08:00
知微
583db09090
fix: cron健康监控v2——空闲超时检测+自检+去重冷却+price_monitor直查DB
2026-07-07 12:28:31 +08:00
知微
9f44715b61
feat: add watchlist auto-reassessment to per_stock_reassess
...
- Add scan_watchlist_stocks() function that scans watchlist_stocks table
- Deviation formula: max(|price-entry_low|,|price-entry_high|)/entry_low*100 > 20%
- Calls technical_analysis.full_analysis() to get latest support/resistance
- Updates entry_low/entry_high/stop_loss/price/analysis_json in DB
- Records changelog in analysis_json with old/new values
- Limits to 3 stocks per run, logs remaining=N for overflow
- Scans watchlist AFTER decisions scan in main() (no changes to decisions logic)
2026-07-07 11:48:45 +08:00
知微
43bd84a7c0
feat: 全局cron job健康监控, failed时主动推XMPP
2026-07-07 11:29:56 +08:00
知微
5ffc487659
fix: 审计度量修正——reassess写strategy_evaluations非holding_strategies
2026-07-07 11:27:56 +08:00
知微
ae35631208
自选股自动重评机制+000850华茂股份9维分析
...
fix: per_stock_reassess 现在支持自选股(不在decisions.json)触发的重评
- 不在decisions_map的code→查watchlist_stocks表构建entry
- 重评完成后同步回watchlist_stocks表
- is_watchlist=True传给reassess_strategy确保正确分类
fix: stale_detector的[AUTO_REASSESS]路径现在能真正触发自选股重评
- 价格偏离买入区中心>15%→触发per_stock_reassess
- 结果写回DB watchlist_stocks表+decisions.json
feat: 000850华茂股份完整9维分析
- 横: 大盘偏弱但个股独立/纺织板块/金融资产折价
- 纵: PE72.79虚高(被金融收益摊薄)/PB0.80破净(安全垫)
- 消息面: 7/16临时股东会催化
- 技术面: MA5>MA10>MA20多头初成/缩量回踩健康
- 资金流: 量比1.21放量上攻后缩量回踩(正常)
- 买入区3.70~3.90现价3.81在区内→策略有效维持
- 止损3.50/止盈4.30/RR=1.6
2026-07-07 11:27:46 +08:00
知微
4689849c9d
fix: 管道审计+全局cron失败监控, 异常时主动推XMPP
2026-07-07 11:27:09 +08:00
知微
5320509893
fix: stale_detector per_stock_reassess参数修正(--code→位置参数)
2026-07-07 11:20:28 +08:00
知微
7b4826777a
自选股自动重评机制+000850华茂股份全面重评
...
1. stale_detector新增自选股买入区偏离自动重评:
- 每轮扫描watchlist_stocks, price偏离买入区中心>15%自动触发per_stock_reassess
- 之前只标记[STRATEGY_STALE]不输出,改为标记+触发重评两步完成
- 策略完毕直接输出结果,不再等下次cron通知
2. 000850华茂股份全面重评:
- 核心价值:纺织是壳,金融股权投资才是核心(国泰海通/广发/徽商银行)
- PB=0.78破净, 7月3日分红3675万占年净利17.85%
- 7/16临时股东会催化剂
- 结论:3.70~3.90区间可建仓1~2%,止损3.50,止盈4.30
- 修复:之前说'观望不建仓'是错的,低估了破净安全垫
3. watchlist_stocks DB加000850记录
2026-07-07 11:20:04 +08:00
知微
096fbbf5f6
fix: sqlite3.Row没有.get()方法, r.get('cost',0)静默失败→改为r['cost'] if r['cost'] else 0
2026-07-07 11:05:21 +08:00
知微
7c255d5234
fix: 统一DB路径+管道审计脚本
...
mo_data.py DB_PATH: /home/hmo/web-dashboard/data/mofin.db → /home/hmo/MoFin/data/mofin.db
新增 verify_reassess_pipeline.py:管道审计,静默时无声、异常时报警
2026-07-07 10:37:05 +08:00
知微
26e2794cca
fix: 代码级约束 —— 推荐前必须同步重评, 不输出无操作信号的信息
...
1. price_monitor: 区间突破后同步调reassess_with_context(), 明确信号推XMPP
2. stale_detector: 只输出有[PUSH]/[STRATEGY_STALE]标记的行, 静默无操作信号的买入区
3. mofin_collect: stale/无策略持仓同步重评, 不靠TODO异步
2026-07-07 10:31:50 +08:00
知微
2138ae2bfd
fix: 代码级强制约束——LLM看到数据前必须同步重评(stale/无策略), 不等TODO异步
...
mofin_collect.py步骤0改造:
stale(>4h未更新) → 立即调reassess_with_context()强制重评, 不靠TODO异步
无策略(holding_strategies无记录) → 立即调reassess_with_context()创建策略
只有重评成功后才允许LLM给出建议
2026-07-07 10:14:21 +08:00
知微
bbd90a005e
feat: 代码级策略新鲜度强制检查 — mofin_collect.py步骤0, 推荐前先检策略是否最新, 过期自动创TODO
2026-07-07 10:10:01 +08:00
知微
fbbb96020f
fix: system_health_check不再误报market.json/decisions.json缺失(DB-only已迁移)
2026-07-07 09:20:49 +08:00
知微
66962ae190
fix: 全面系统修复 — delivery目标修正 + 脚本同步 + refresh_mtf_cache import修复 + clean_watchlist硬编码修复
...
修复清单:
- cron delivery修正:10个job从deliver=origin/all改为local,消除推送错误
- refresh_mtf_cache.py:替换strategy_lifecycle.PORTFOLIO_PATH导入为mofin_db直接读DB
- clean_watchlist.py:修复mo_data导入名错误和JSON硬编码路径
- MoFin/scripts/与profile scripts互相补全,双向sync到一致
- price_monitor.py:现金源从portfolio_summary表改为cash_log(Dad确认的现金权威)
- 更新watchlist.json加入000850华茂股份
2026-07-06 14:01:54 +08:00
知微
e185b4e4dc
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.
2026-07-06 12:02:11 +08:00
知微
687155487d
feat: strategy-staleness-check auto-creates TODOs for STRATEGY_STALE stocks
2026-07-05 01:41:10 +08:00
知微
5b9f22a643
test: 33/33 pass + fix last 4 json.load in strategy_lifecycle + analytics dead code
2026-07-04 09:45:27 +08:00
知微
8b114d6e9e
refactor: remove duplicate scripts + JSON constants + update docs
2026-07-04 09:30:50 +08:00
知微
9337130ca2
fix: HK stocks store HKD, calc_total_assets converts to CNY at aggregation
2026-07-03 23:29:37 +08:00
知微
8e487f400f
fix: system_audit/stale_push_wlin/refresh_mtf → DB, remove final JSON refs
2026-07-03 23:19:32 +08:00
知微
9bc0cca174
fix: HK currency→CNY + portfolio_summary + LLM prompt evaluation.json→DB
2026-07-03 23:15:18 +08:00
知微
b15960ba38
全数据路径审计修复完成:所有脚本从DB读数据
...
最终修复:
1. price_monitor: HK股存HKD原值, currency=HKD (移除x0.87转换)
2. strategy_lifecycle: 质量门禁currency=CNY→HKD/CNY均可
3. strategy_lifecycle: 新建策略currency动态判断
4. stale_push_wlin: 所有read_decisions()+read_portfolio()替代json.load
5. stale_detector: read_portfolio()替代json.load(PORTFOLIO_PATH)
6. per_stock_reassess: json.dump(decisions.json)→mo_data写入
7. DB holdings/holding_strategies: 8只HK股currency=HKD,价格修正
8. 建滔84.45 HKD浮亏-4.3%(之前报-24%)
9. 现金132,121.93总资产953,295
10. LLM cron prompts已改为全部从mo_data读
2026-07-03 17:14:56 +08:00
知微
908dc6a897
全数据路径审计修复:price_monitor HK股价不再转CNY
...
审计发现(2026-07-03 15:00 systematic audit):
1. price_monitor 港股仍转 CNY (line 255, 306) → 改为存 HKD 原值, currency=HKD
2. strategy_lifecycle 质量门禁检查 currency=CNY (line 88-91) → 改为接受 HKD/CNY
3. strategy_lifecycle 新建策略写 currency='CNY' (line 2299) → 改为按代码判断 HKD/CNY
4. stale_push_wlin 两处直接 json.load(open(decisions.json)) → 改为 read_decisions()
5. stale_push_wlin 直接 json.load(open(portfolio.json)) → 改为 read_portfolio()
6. DB holdings/holding_strategies: 8只HK股currency从CNY改为HKD
7. calc_total_mv 增加港股HKD→CNY汇兑计算
验证:
- 建滔 84.45 HKD 浮亏-4.3%(不是-24%)
- 现金 132,121.93 总资产 953,295
- 所有8只HK股DB正确标记HKD
- price_monitor已重启,下个tick用新逻辑写HKD原值
- stale_push_wlin已换用mo_data读DB
2026-07-03 17:13:19 +08:00
知微
5bd8af20ac
migrate: live_prices+mtf+capital_flow DB read/write, cleanup remaining JSON refs
2026-07-03 13:46:12 +08:00
知微
bb9b3922c9
migrate: last 4 JSON files — live_prices, market, mtf_cache, capital_flow → DB
2026-07-03 13:44:10 +08:00
知微
c1c4ba4a81
fix: price_monitor HKD→CNY + Eastmoney 2s timeout + None-safe + summary fix
2026-07-03 13:24:10 +08:00
知微
9124a7ad56
migrate: remove final JSON cold backup lines, prune/branch→DB
2026-07-03 12:41:20 +08:00
知微
b3bedc8024
migrate: remove JSON, DB-only — mo_data, server, scripts, prompts (27 files)
2026-07-03 12:12:05 +08:00
知微
6eecc4d4eb
fix: currency+PnL+is_hk_stock+gate+zone+total_pnl
2026-07-03 10:27:17 +08:00
知微
1bb83c715d
data_snapshot统一数据入口+DB银行locked修复+建滔/现金修正
...
data_snapshot.py: 所有报告脚本的唯一数据入口(通过mo_data读DB)
price_monitor.py: DB写入加了3次重试+PRAGMA busy_timeout=5000
quality gate: 新增GATE_PROFIT_EXISTS(止盈=0拦截)+GATE_9D_ANALYSIS
建滔(01888) DB已修正: price=84.9 HKD, cost=88.23 HKD, 浮亏-3.8%
现金已修正: 132,121.93 (frozen=0)
2026-07-03 10:12:21 +08:00
知微
400e4ee34d
review_needed 跟进机制 + 质量门禁文档
...
新增 review_needed_watchdog.py:
- 每30分钟扫描 review_needed 策略
- 自动调 per_stock_reassess 重评
- 重试3次仍失败 → 推Dad XMPP人工介入
- cron: 交易日 9:30~15:30
news-flow-analysis skill 文档同步更新:
- 完整 review_needed 流程链
- 自动修复→重检→跟进→上报 闭环
2026-07-02 14:04:15 +08:00
知微
7c0e85af28
硬性策略质量门禁 validate_strategy()
...
新增 STRATEGY_QUALITY_GATES 检查清单(9条红线):
CRITICAL: 止损/止盈存在+>0, 买入区下沿<上沿
HIGH: 止损≤买入区, 买入推荐含RR≥1.5, 港股标currency=HKD
MEDIUM: signal短词, tech_snapshot含技术位
enforce_strategy_quality() 插在写入链的两处:
1. reassess_with_context() return前 → 单只重评必过
2. regenerate_all() for d in decisions: 写DB前 → 批量重评必过
不过的:status=review_needed, signal降级→信号不充分
不会写进DB/JSON,除非修复了CRITICAL问题
2026-07-02 13:46:53 +08:00
知微
04b8a6d4bc
mo_data: +write_cash_log 函数
...
cash_log表已存在,新增写入函数便于截图/交易变更时记录现金流水。
用于process_trade.py、手动改cash时调用,保证现金变更可追溯。
知识萃取-盘后 cron 已暂停(莫荷接手知识库报告)
2026-07-02 01:43:33 +08:00
知微
69c6c5633a
feat: 筹码S/R集成到reassess_strategy
...
- calc_chip_sr(): 从筹码分布计算支撑/阻力
- reassess_strategy新增筹码S/R输出+共振检测
- 止损用枢轴(短期),目标参考筹码(中线)
- 两者差距<3%时标记共振⚡
2026-07-02 00:57:54 +08:00
知微
7f8b27df3b
feat: 筹码因子模块 + 分钟K线 + 历史数据回填
...
scripts/chip_factors.py:
- _build_chip_distribution(): 从60日日线OHLCV估算筹码分布
- calc_all(): 计算三大筹码因子(穿透率/当日穿透率/乖离率)
- batch_calc(): 批量计算全部持仓+自选
- chip_cache/: 缓存每日筹码状态(支持因子滚动计算)
mo_provider.py:
- get_minute_kline(): 1分钟K线获取(1s限流, 单次最多240条)
首次运行结果: 33只股票完成筹码分布计算
最高亏损筹码占比: 万科99.5% 神华98.6% 比亚迪股份98.7%
最低亏损筹码占比: 建滔4.0% 药明康德2.1%
2026-07-02 00:36:35 +08:00
知微
6305204c7a
feat: mo_data.py unified read layer (DB-first, JSON fallback) + cash_log table + batch JSON→DB migration (16 files)
2026-07-01 23:45:30 +08:00
知微
671fe4ecc2
feat: price_monitor cron entry + health check script (DB freshness monitoring)
2026-07-01 23:07:24 +08:00
知微
ec285669c4
fix: deploy scripts/ files properly (correct directory)
2026-07-01 23:00:28 +08:00
知微
8ed755bff9
feat: strategy_lifecycle + stale_detector + server — DB-first price reads, Tencent API as fallback only
2026-07-01 22:48:48 +08:00
知微
849495c4ba
fix: remove stale_push_wlin hardcoded 0.87 fallback — imports mo_models directly, no shadow functions
2026-07-01 22:39:20 +08:00