- 移除重复的系统健康检查-每日(no_agent版,与LLM版重叠) - 归档42个一次性脚本(移出MoFin/scripts→archive/scripts): - fix_*: 历史数据修复(11个) - migrate_*/rollback_*: 数据迁移(2个) - 一次性数据修复: bulk/close/data_freshness等(16个) - check_*/verify_*/diagnose_*: 历史诊断工具(12个) - test_*: 测试脚本(3个) - 84个活跃脚本, 0架构违规, 31张healthy数据表
32 lines
1.0 KiB
Python
32 lines
1.0 KiB
Python
#!/usr/bin/env python3
|
|
"""Verify 01888 data after fix"""
|
|
import sys
|
|
sys.path.insert(0, '/home/hmo/MoFin')
|
|
from mo_data import read_portfolio, read_decisions
|
|
import sqlite3
|
|
|
|
# Check DB
|
|
db = sqlite3.connect('/home/hmo/web-dashboard/data/mofin.db')
|
|
r = db.execute("SELECT code, name, cost, shares, currency FROM holdings WHERE code='01888'").fetchone()
|
|
if r:
|
|
print(f"[DB] {r[0]} {r[1]}: cost={r[2]} shares={r[3]} curr={r[4]}")
|
|
|
|
# Check decisions
|
|
dec = read_decisions()
|
|
for d in dec.get('decisions', []):
|
|
if d.get('code') == '01888':
|
|
print(f"[DEC] price={d.get('price')} cost={d.get('cost')} shares={d.get('shares')}")
|
|
print(f" curr={d.get('currency')} status={d.get('status')}")
|
|
c = d.get('cost', 0)
|
|
p = d.get('price', 0)
|
|
if c > 0 and p > 0:
|
|
print(f" PnL={(p-c)/c*100:.1f}%")
|
|
|
|
# Check portfolio
|
|
pf = read_portfolio()
|
|
for h in pf.get('holdings', []):
|
|
if h.get('code') == '01888':
|
|
print(f"[PF] {h.get('code')} cost={h.get('cost')} price={h.get('price')} shares={h.get('shares')}")
|
|
|
|
db.close()
|