Commit Graph

9 Commits

Author SHA1 Message Date
hmo 6abc2e45b0 refactor: phase 0-2 MoFin architecture reform — single source of truth
Phase 0 (止血):
- mo_models.py: unified calc_total_assets(), is_hk_stock(), get_hk_rate() — single source of truth
- Fixed 3 files missing frozen_cash: holdings_reconciliation, server, import_holding_xls
- Fixed stale_push_wlin: unified is_hk_stock detection, removed hardcoded 0.866
- Fixed price_monitor: consolidated 2 duplicate total_assets blocks into mo_models calls
- Fixed stock_scorer: replaced broken len()<=5 is_hk_stock heuristic
- Fixed strategy_lifecycle: replaced non-existent currency_utils import with mo_models

Phase 1 (DSA adapter):
- mo_provider.py: wraps DSA DataFetcherManager (16 fetchers, auto-fallback)
  - TDX relay as primary, DSA as backup for realtime/kline/news/fundamentals

Phase 2 (Integration):
- mo_bridge.py: injects DSA market review + news context into MoFin analysis prompts
- Graceful degradation if DSA not installed

Infrastructure:
- mo_config.py: centralized Config singleton replacing scattered hardcoded paths
- All 11 changed files pass python compile check

Impact: total_assets now computed in ONE place (mo_models).
        is_hk_stock now ONE implementation (no more false negatives).
        HK rate now ONE source (hk_rate API → cache → 0.87 fallback).
        No more hardcoded 0.866/0.8664/0.8700 divergence.
2026-06-29 23:25:54 +08:00
知微 0ecdfbc861 上传OCR切换:小果GLM-OCR-8bit优先,Tesseract降级
MoFin/server.py 的 _ocr_image 改为:
1. 优先调小果 gateway (192.168.1.122:18003) 的 GLM-OCR-8bit
2. 失败/无响应则自动降级到本地 Tesseract(预处理+chi_sim+eng)
3. fallback逻辑保留原预处理管道(放大/锐化/二值化)

ocr_client.py 模块独立可调用,兼作CLI工具
2026-06-24 13:48:40 +08:00
知微 ce687a4216 fix: xiaoguo_scanner 榜单更新+看空榜持仓预警
- 修bug:stock_rank_cxd_ths 实为'创新低',改为 stock_rank_lxsz_ths '连续上涨'
- 新增6个看多榜(险资举牌)+ 5个看空榜(创新低/持续缩量/量价齐跌/连续下跌/向下突破)
- 看空榜自动比对持仓,命中写入 xiaoguo_risk 信号
- 东财热榜静默降级(502不可修)
- 看空榜不跳过已扫描,每轮全检
2026-06-22 19:13:55 +08:00
知微 a8c3ec5db9 三修:建议去重+闭环跟踪+模糊用词禁令
server.py:
- /api/advice/record 加去重(同天+同方向+同摘要前40字=跳过)
- /api/advice/confirm 支持 executed 动作+自动打 evaluated 标记

cron prompts:
- MoFin盘前中监控 + 午后监控 加入 advice/record 调用指令
- 模糊用词禁令嵌入 cron prompt
2026-06-21 23:00:53 +08:00
知微 70514bf542 Dashboard: 信号tab + API(signals + xiaoguo-scan),前端展示 2026-06-21 02:44:05 +08:00
hmo 25f8c6ec67 refactor: 消费者切 SQLite 优先读取
切换策略: SQLite 优先 → 失败回退 JSON

price_events (100%覆盖):
- strategy_feedback.py: run() 优先 query_price_events()
- system_health_check.py: 优先 query_price_events() + query_price_events_by_date()

stock_sector_map (100%覆盖):
- strategy_lifecycle.py: load_stock_sector_map() 优先 stock_sectors 表

market.json (85%覆盖):
- strategy_lifecycle.py: load_market_context() 优先 query_latest_market()
- market_insight.py: generate() 优先 query_latest_market()

portfolio.json + watchlist.json (70%覆盖):
- strategy_lifecycle.py: regenerate_all() 优先 query_holdings() + query_watchlist()
- server.py: /api/portfolio, /api/watchlist, /api/overview, /api/market 优先 SQLite

所有改动保留 JSON 回退路径,SQLite 不可用时自动降级
2026-06-20 17:50:15 +08:00
知微 66a8f24e17 加回 .gitignore 2026-06-20 12:43:24 +08:00
知微 (MoFin) 33df400c01 目录重组:web/ scripts/ config/ tests/ 标准化 2026-06-20 12:11:33 +08:00
知微 (MoFin) aa0f740381 MoFin 初始提交
完整数据采集+分析管道:
- market_watch.py:90行业板块采集(同花顺/东方财富)
- 市场精选推荐 cron:全市场分析+候选池+星级推荐
- price_monitor.py:持仓/自选高频价格监控
- refresh_mtf_cache.py:多周期K线缓存
- 策略评估/知识萃取管道

文档:docs/ 含完整需求+架构设计
注意:尚未配置 git remote,笑笑接手后自行配置
2026-06-20 12:04:21 +08:00