Commit Graph
9 Commits
Author SHA1 Message Date
知微 9fef32413b refactor: 统一价格入口 mo_data.get_price() - 22个脚本移除自拉腾讯API
所有价格获取统一走 mo_data.get_price() / get_prices_batch():
  - 优先读 live_prices(DB) → 无/过期才调 stock_quote(API) → 自动写回DB
  - 22个脚本全部替换:branch_scanner chip_factors divergence_detector
    market_screener mo_provider mofin_collect monitor_300308 300308_monitor
    multi_timeframe refresh_macro_context stale_detector stale_push_wlin
    stock_profile strategy_evaluator strategy_lifecycle strategy_review
    strategy-staleness-check technical_analysis xiaoguo_signal_consumer
    collect_evaluation_data
2026-07-08 23:54:01 +08:00
知微 2762ddf3ae fix: DB路径大面积修复——mofin_db/server/technical_analysis/strategy_tree等脚本的Path(__file__).parent/data错误指向scripts/data而非data/ 导致读写分离
- 量价分析: full_analysis输出volume_deep+成交量存储在price_history.json
- FK约束移除: holding_strategies外键->holdings阻止自选股写入
- #000850 重评已写入(止损3.74/止盈4.06/RR1.67)含量价信号
2026-07-08 12:34:39 +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
知微 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
知微 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
知微 b3bedc8024 migrate: remove JSON, DB-only — mo_data, server, scripts, prompts (27 files) 2026-07-03 12:12:05 +08:00
知微 f50b93d427 feat: eliminate duplicate price fetches — stale_push_wlin + per_stock_reassess now read from DB instead of self-pulling Tencent API 2026-07-01 22:32:30 +08:00
知微 28c001684e 币种标记标准化 + data-pipeline诊断文档
stale_detector: HK股价格输出加(HKD)标记,防止LLM混读CNY/HKD
per_stock_reassess: 写回decisions.json的HK股加上currency: HKD
docs/data-pipeline-diagnosis.md: 完整数据管道重构需求文档

避免建滔积层板CNY/HKD错配类问题复发
2026-06-30 11:13:45 +08:00
知微 fb74c8bbb5 fix: capital_flow_collector+per_stock_reassess归位 2026-06-30 03:12:59 +08:00