Files
MoFin/data/portfolio.json
T
知微 eb294f05a5 import_holding_xls: 支持截图真实数字覆盖
regenerate_all 会覆盖 portfolio.json,所以导入流程改为:
1. 先更新 SQLite holdings 表
2. 再跑 regenerate_all(读 SQLite,写 decisions+portfolio)
3. 然后用真实数字覆盖 portfolio.json 汇总字段
4. 重建决策树

支持 --cash --total --mv 传入截图真实数字
用法:python3 import_holding_xls.py --cash 20230 --total 1008860 --mv 988512
2026-06-24 11:29:53 +08:00

286 lines
6.4 KiB
JSON

{
"holdings": [
{
"code": "001309",
"name": "德明利",
"shares": 100,
"price": 788.0,
"cost_price": 737.04,
"currency": "CNY",
"market_val": 78800.0,
"cost_amount": 73703.74,
"exchange_rate": 0.8664
},
{
"code": "01478",
"name": "丘钛科技",
"shares": 11000,
"price": 7.57,
"cost_price": 13.81,
"currency": "HKD",
"market_val": 72120.15,
"cost_amount": 131558.75,
"exchange_rate": 0.8661
},
{
"code": "600739",
"name": "辽宁成大",
"shares": 6600,
"price": 10.5,
"cost_price": 12.29,
"currency": "CNY",
"market_val": 69300.0,
"cost_amount": 81089.02,
"exchange_rate": 0.8664
},
{
"code": "601899",
"name": "紫金矿业",
"shares": 2400,
"price": 27.53,
"cost_price": 40.27,
"currency": "CNY",
"market_val": 66072.0,
"cost_amount": 96644.29,
"exchange_rate": 0.8664
},
{
"code": "688639",
"name": "华恒生物",
"shares": 2800,
"price": 21.46,
"cost_price": 21.51,
"currency": "CNY",
"market_val": 60088.0,
"cost_amount": 60223.75,
"exchange_rate": 0.8664
},
{
"code": "09988",
"name": "阿里巴巴-W",
"shares": 700,
"price": 98.8,
"cost_price": 126.15,
"currency": "HKD",
"market_val": 59899.48,
"cost_amount": 76481.96,
"exchange_rate": 0.8661
},
{
"code": "603259",
"name": "药明康德",
"shares": 400,
"price": 116.94,
"cost_price": 96.2,
"currency": "CNY",
"market_val": 46776.0,
"cost_amount": 38480.38,
"exchange_rate": 0.8664
},
{
"code": "688981",
"name": "中芯国际",
"shares": 300,
"price": 149.98,
"cost_price": 126.07,
"currency": "CNY",
"market_val": 44994.0,
"cost_amount": 37820.42,
"exchange_rate": 0.8664
},
{
"code": "01888",
"name": "建滔积层板",
"shares": 500,
"price": 93.95,
"cost_price": 88.39,
"currency": "HKD",
"market_val": 40685.05,
"cost_amount": 38275.35,
"exchange_rate": 0.8661
},
{
"code": "02202",
"name": "万科企业",
"shares": 19700,
"price": 2.37,
"cost_price": 4.68,
"currency": "HKD",
"market_val": 40437.34,
"cost_amount": 79782.13,
"exchange_rate": 0.8661
},
{
"code": "02388",
"name": "中银香港",
"shares": 1000,
"price": 46.16,
"cost_price": 43.79,
"currency": "HKD",
"market_val": 39979.18,
"cost_amount": 37925.79,
"exchange_rate": 0.8661
},
{
"code": "300750",
"name": "宁德时代",
"shares": 100,
"price": 391.15,
"cost_price": 401.78,
"currency": "CNY",
"market_val": 39115.0,
"cost_amount": 40178.03,
"exchange_rate": 0.8664
},
{
"code": "01211",
"name": "比亚迪股份",
"shares": 600,
"price": 75.15,
"cost_price": 105.05,
"currency": "HKD",
"market_val": 39052.45,
"cost_amount": 54592.42,
"exchange_rate": 0.8661
},
{
"code": "00700",
"name": "腾讯控股",
"shares": 100,
"price": 420.4,
"cost_price": 443.9,
"currency": "HKD",
"market_val": 36410.84,
"cost_amount": 38446.39,
"exchange_rate": 0.8661
},
{
"code": "00981",
"name": "中芯国际",
"shares": 500,
"price": 83.35,
"cost_price": 76.07,
"currency": "HKD",
"market_val": 36094.72,
"cost_amount": 32943.17,
"exchange_rate": 0.8661
},
{
"code": "09868",
"name": "小鹏集团-W",
"shares": 700,
"price": 50.25,
"cost_price": 51.36,
"currency": "HKD",
"market_val": 30465.07,
"cost_amount": 31140.69,
"exchange_rate": 0.8661
},
{
"code": "600036",
"name": "招商银行",
"shares": 800,
"price": 37.1,
"cost_price": 38.16,
"currency": "CNY",
"market_val": 29680.0,
"cost_amount": 30526.53,
"exchange_rate": 0.8664
},
{
"code": "300548",
"name": "长芯博创",
"shares": 100,
"price": 279.12,
"cost_price": 231.46,
"currency": "CNY",
"market_val": 27912.0,
"cost_amount": 23146.0,
"exchange_rate": 0.8664
},
{
"code": "02318",
"name": "中国平安",
"shares": 500,
"price": 52.75,
"cost_price": 54.82,
"currency": "HKD",
"market_val": 22843.39,
"cost_amount": 23739.74,
"exchange_rate": 0.8661
},
{
"code": "300035",
"name": "中科电气",
"shares": 1400,
"price": 16.03,
"cost_price": 22.29,
"currency": "CNY",
"market_val": 22442.0,
"cost_amount": 31207.91,
"exchange_rate": 0.8664
},
{
"code": "000700",
"name": "模塑科技",
"shares": 1400,
"price": 14.6,
"cost_price": 14.83,
"currency": "CNY",
"market_val": 20440.0,
"cost_amount": 20767.0,
"exchange_rate": 0.8664
},
{
"code": "518880",
"name": "黄金ETF华安",
"shares": 2400,
"price": 8.449,
"cost_price": 12.19,
"currency": "CNY",
"market_val": 20277.6,
"cost_amount": 29259.64,
"exchange_rate": 0.8664
},
{
"code": "01088",
"name": "中国神华",
"shares": 500,
"price": 41.9,
"cost_price": 45.97,
"currency": "HKD",
"market_val": 18144.8,
"cost_amount": 19909.06,
"exchange_rate": 0.8661
},
{
"code": "600563",
"name": "法拉电子",
"shares": 100,
"price": 174.57,
"cost_price": 146.95,
"currency": "CNY",
"market_val": 17457.0,
"cost_amount": 14695.0,
"exchange_rate": 0.8664
},
{
"code": "300690",
"name": "双一科技",
"shares": 400,
"price": 22.78,
"cost_price": 27.18,
"currency": "CNY",
"market_val": 9112.0,
"cost_amount": 10871.2,
"exchange_rate": 0.8664
}
],
"cash": 20230.1,
"total_market_value": 988512.96,
"total_assets": 1008860.62,
"total_pl": -164895.4,
"position_pct": 97.98,
"updated_at": "2026-06-24 11:29",
"source": "/home/hmo/stocks/holding.xls + 截图校核"
}