Files
MoFin/data/portfolio.json
T
知微 3e2f0315eb 完全DB版: 移除JSON写入/回退,所有操作直走SQLite
- price_monitor: 完全DB版,不再读写 portfolio.json/watchlist.json
  - holdings代码从DB读取(SELECT code FROM holdings WHERE is_active=1)
  - 价格写入DB holdings表 + portfolio_summary + live_prices
  - 3次重试+指数退避防锁
- server.py: 移除API的JSON回退,DB失败直接返回500
- mofin_db.py: execute_with_retry/commit_with_retry + 15s timeout + busy_timeout
- mo_data.py: 已是纯DB模式(无JSON fallback)

这是推进的完全DB化。下一步可删除 data/portfolio.json data/decisions.json data/watchlist.json 等遗留JSON。
2026-07-06 12:08:08 +08:00

166 lines
3.5 KiB
JSON

{
"holdings": [
{
"code": "00700",
"name": "腾讯",
"shares": 100,
"cost": 443.13,
"price": 446.4,
"market_value": 39063.0,
"change_pct": 3.53,
"currency": "HKD",
"position_pct": null
},
{
"code": "01088",
"name": "中国神华",
"shares": 500,
"cost": 45.89,
"price": 40.72,
"market_value": 17575.0,
"change_pct": 1.8,
"currency": "HKD",
"position_pct": 2.14
},
{
"code": "01211",
"name": "比亚迪股份",
"shares": 600,
"cost": 104.87,
"price": 84.25,
"market_value": 44376.0,
"change_pct": 0.18,
"currency": "HKD",
"position_pct": 4.62
},
{
"code": "01478",
"name": "丘钛科技",
"shares": 11000,
"cost": 13.47,
"price": 6.75,
"market_value": 64460.0,
"change_pct": -3.43,
"currency": "HKD",
"position_pct": 7.97
},
{
"code": "02202",
"name": "万科企业",
"shares": 19700,
"cost": 4.67,
"price": 2.33,
"market_value": 40385.0,
"change_pct": -0.43,
"currency": "HKD",
"position_pct": 4.6
},
{
"code": "300035",
"name": "中科电气",
"shares": 1400,
"cost": 22.29,
"price": 14.02,
"market_value": 19712.0,
"change_pct": -1.89,
"currency": "CNY",
"position_pct": 2.42
},
{
"code": "300308",
"name": "中际旭创",
"shares": 100,
"cost": 1316.53,
"price": 1116.03,
"market_value": 106181.0,
"change_pct": 0.0,
"currency": "CNY",
"position_pct": 15.27
},
{
"code": "300750",
"name": "宁德时代",
"shares": 100,
"cost": 401.78,
"price": 377.6,
"market_value": 37726.0,
"change_pct": -0.63,
"currency": "CNY",
"position_pct": 4.64
},
{
"code": "518880",
"name": "黄金ETF华安",
"shares": 2400,
"cost": 12.19,
"price": 8.66,
"market_value": 20832.0,
"change_pct": -0.08,
"currency": "CNY",
"position_pct": 2.45
},
{
"code": "600563",
"name": "法拉电子",
"shares": 100,
"cost": 147.18,
"price": 153.42,
"market_value": 15021.0,
"change_pct": -2.32,
"currency": "CNY",
"position_pct": 2.3
},
{
"code": "601899",
"name": "紫金矿业",
"shares": 2400,
"cost": 39.89,
"price": 28.41,
"market_value": 68784.0,
"change_pct": 2.12,
"currency": "CNY",
"position_pct": 7.34
},
{
"code": "688411",
"name": "海博思创",
"shares": 200,
"cost": 266.95,
"price": 262.98,
"market_value": 52064.0,
"change_pct": 4.71,
"currency": "CNY",
"position_pct": 6.31
},
{
"code": "688639",
"name": "华恒生物",
"shares": 2800,
"cost": 21.51,
"price": 16.61,
"market_value": 46480.0,
"change_pct": -0.3,
"currency": "CNY",
"position_pct": 5.25
},
{
"code": "688981",
"name": "中芯国际",
"shares": 300,
"cost": 126.07,
"price": 147.18,
"market_value": 40599.0,
"change_pct": 4.9,
"currency": "CNY",
"position_pct": 5.44
}
],
"cash": 289196.0,
"frozen_cash": 0.0,
"total_mv": 619713.76,
"total_assets": 908909.76,
"position_pct": 68.18,
"currency": "CNY",
"updated_at": "2026-07-06 11:35:19",
"stock_value": 619713.76
}