DB港股价格+成本修复回HKD原值

笑笑重构把HK股的价格和成本都转CNY写入DB。
price_monitor同时改了新逻辑要写HKD,但DB已经是CNY,
两个方向打架导致建滔(-2.5%实际浮亏)被算成-15.5%。

修复:
  DB holdings表8只HK股的price和cost从CNY转回HKD
  currency改回HKD
  现金修正为132,121.93(Dad 7/3截图确认)
  总资产=957,656.13 仓位=86.2%
This commit is contained in:
知微
2026-07-03 14:42:30 +08:00
parent 5bd8af20ac
commit 0bfb819110
6 changed files with 271 additions and 114 deletions
+150 -14
View File
@@ -1,6 +1,6 @@
{ {
"last_updated": "2026-07-03 13:42", "last_updated": "2026-07-03 14:18",
"total_candidates": 11, "total_candidates": 15,
"sectors_analyzed_today": [ "sectors_analyzed_today": [
"半导体", "半导体",
"金属新材料", "金属新材料",
@@ -605,21 +605,25 @@
"name": "拓普集团", "name": "拓普集团",
"sector": "汽车零部件", "sector": "汽车零部件",
"xiaoguo_score": 8.5, "xiaoguo_score": 8.5,
"xiaoguo_reason": "特斯拉/华为核心供应商,智能底盘+轻量化双轮驱动,Q2业绩预期强劲,资金持续加仓,技术面突破年线后回踩确认支撑。", "xiaoguo_reason": "新能源底盘轻量化与空气悬架核心供应商,绑定特斯拉/理想/蔚来等头部车企,订单可见度高;业绩增速匹配估值,机构持仓稳定。",
"xiaoguo_strategy": { "xiaoguo_strategy": {
"entry_range": "58.5-60.2", "entry_range": "63.5-66.0元",
"stop_loss": "56.0", "stop_loss": "60.0",
"target": "68.0-72.0" "target": "78.0-82.0"
}, },
"verified_price": 62.43, "verified_price": 62.43,
"verified_change": 10.01, "verified_change": 10.01,
"added_at": "2026-07-03 13:40", "added_at": "2026-07-03 13:40",
"last_updated": "2026-07-03 13:40", "last_updated": "2026-07-03 14:14",
"num_observations": 1, "num_observations": 2,
"score_history": [ "score_history": [
{ {
"date": "2026-07-03 13:40", "date": "2026-07-03 13:40",
"score": 8.5 "score": 8.5
},
{
"date": "2026-07-03 14:14",
"score": 8.5
} }
], ],
"zhiwei_star": null, "zhiwei_star": null,
@@ -669,21 +673,153 @@
"name": "伯特利", "name": "伯特利",
"sector": "汽车零部件", "sector": "汽车零部件",
"xiaoguo_score": 8.2, "xiaoguo_score": 8.2,
"xiaoguo_reason": "线控制动市占率领先,智能驾驶渗透率提升直接受益,研发壁垒高,技术面放量突破平台,资金介入明显。", "xiaoguo_reason": "线控制动与ESP国产替代先锋,技术壁垒高;ADAS渗透率提升直接拉动需求,客户覆盖主流自主品牌及合资车企,估值处于历史中低位。",
"xiaoguo_strategy": { "xiaoguo_strategy": {
"entry_range": "42.0-43.5", "entry_range": "46.5-49.0元",
"stop_loss": "40.0", "stop_loss": "43.5元",
"target": "48.0-52.0" "target": "58.0-62.0"
}, },
"verified_price": 27.65, "verified_price": 27.65,
"verified_change": 9.98, "verified_change": 9.98,
"added_at": "2026-07-03 13:40", "added_at": "2026-07-03 13:40",
"last_updated": "2026-07-03 13:40", "last_updated": "2026-07-03 14:14",
"num_observations": 1, "num_observations": 2,
"score_history": [ "score_history": [
{ {
"date": "2026-07-03 13:40", "date": "2026-07-03 13:40",
"score": 8.2 "score": 8.2
},
{
"date": "2026-07-03 14:14",
"score": 8.2
}
],
"zhiwei_star": null,
"zhiwei_reviewed": false,
"zhiwei_reviewed_at": null,
"promoted": false,
"promoted_at": null,
"dropped": false,
"drop_reason": null,
"trend_warning": false,
"trend_note": ""
},
{
"code": "002050",
"name": "三花智控",
"sector": "汽车零部件",
"xiaoguo_score": 8.0,
"xiaoguo_reason": "全球热管理龙头,深度受益电动车渗透率提升;积极布局机器人机电执行器,第二增长曲线明确;需关注行业价格战对毛利率的短期扰动。",
"xiaoguo_strategy": {
"entry_range": "27.0-28.5元",
"stop_loss": "25.5元",
"target": "34.0-36.0元"
},
"verified_price": 48.6,
"verified_change": 8.19,
"added_at": "2026-07-03 14:14",
"last_updated": "2026-07-03 14:14",
"num_observations": 1,
"score_history": [
{
"date": "2026-07-03 14:14",
"score": 8.0
}
],
"zhiwei_star": null,
"zhiwei_reviewed": false,
"zhiwei_reviewed_at": null,
"promoted": false,
"promoted_at": null,
"dropped": false,
"drop_reason": null,
"trend_warning": false,
"trend_note": ""
},
{
"code": "002475",
"name": "立讯精密",
"sector": "消费电子",
"xiaoguo_score": 8.5,
"xiaoguo_reason": "苹果AI手机核心代工龙头,MR/汽车电子第二曲线加速落地,业绩确定性强,机构资金持续加仓,技术面呈多头排列。",
"xiaoguo_strategy": {
"entry_range": "38.5-39.8元",
"stop_loss": "36.5元",
"target": "45.0元"
},
"verified_price": 65.2,
"verified_change": 7.06,
"added_at": "2026-07-03 14:18",
"last_updated": "2026-07-03 14:18",
"num_observations": 1,
"score_history": [
{
"date": "2026-07-03 14:18",
"score": 8.5
}
],
"zhiwei_star": null,
"zhiwei_reviewed": false,
"zhiwei_reviewed_at": null,
"promoted": false,
"promoted_at": null,
"dropped": false,
"drop_reason": null,
"trend_warning": false,
"trend_note": ""
},
{
"code": "002241",
"name": "歌尔股份",
"sector": "消费电子",
"xiaoguo_score": 8.0,
"xiaoguo_reason": "VR/AR声学及光学组件全球龙头,Meta/苹果订单预期回暖,估值处于历史中低位,弹性大且资金介入明显。",
"xiaoguo_strategy": {
"entry_range": "22.0-23.2元",
"stop_loss": "20.5元",
"target": "28.0元"
},
"verified_price": 22.2,
"verified_change": 2.21,
"added_at": "2026-07-03 14:18",
"last_updated": "2026-07-03 14:18",
"num_observations": 1,
"score_history": [
{
"date": "2026-07-03 14:18",
"score": 8.0
}
],
"zhiwei_star": null,
"zhiwei_reviewed": false,
"zhiwei_reviewed_at": null,
"promoted": false,
"promoted_at": null,
"dropped": false,
"drop_reason": null,
"trend_warning": false,
"trend_note": ""
},
{
"code": "300433",
"name": "蓝思科技",
"sector": "消费电子",
"xiaoguo_score": 7.5,
"xiaoguo_reason": "玻璃盖板与精密结构件双轮驱动,AI终端外观创新(陶瓷/微晶玻璃)直接受益,业绩拐点明确,技术面突破年线。",
"xiaoguo_strategy": {
"entry_range": "15.8-16.5元",
"stop_loss": "14.8元",
"target": "20.0元"
},
"verified_price": 52.41,
"verified_change": 3.39,
"added_at": "2026-07-03 14:18",
"last_updated": "2026-07-03 14:18",
"num_observations": 1,
"score_history": [
{
"date": "2026-07-03 14:18",
"score": 7.5
} }
], ],
"zhiwei_star": null, "zhiwei_star": null,
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
+88 -87
View File
@@ -5,9 +5,9 @@
"name": "中际旭创", "name": "中际旭创",
"shares": 100, "shares": 100,
"cost": 1316.53, "cost": 1316.53,
"price": 1143.84, "price": 1124.57,
"market_value": 114101.0, "market_value": 112300.0,
"change_pct": 0.07, "change_pct": -1.61,
"currency": "CNY", "currency": "CNY",
"position_pct": 15.27, "position_pct": 15.27,
"_currency": "CNY" "_currency": "CNY"
@@ -16,34 +16,34 @@
"code": "06869", "code": "06869",
"name": "长飞光纤光缆", "name": "长飞光纤光缆",
"shares": 500, "shares": 500,
"cost": 228.65, "cost": 263.73,
"price": 177.39, "price": 204.2,
"market_value": 89910.0, "market_value": 88175.0,
"change_pct": 3.35, "change_pct": 3.152,
"currency": "CNY", "currency": "HKD",
"position_pct": 13.47, "position_pct": 13.47,
"_currency": "CNY" "_currency": "HKD"
}, },
{ {
"code": "01478", "code": "01478",
"name": "丘钛科技", "name": "丘钛科技",
"shares": 11000, "shares": 11000,
"cost": 11.68, "cost": 13.47,
"price": 6.09, "price": 7.07,
"market_value": 67210.0, "market_value": 67320.0,
"change_pct": 4.464, "change_pct": 5.208,
"currency": "CNY", "currency": "HKD",
"position_pct": 7.97, "position_pct": 7.97,
"_currency": "CNY" "_currency": "HKD"
}, },
{ {
"code": "601899", "code": "601899",
"name": "紫金矿业", "name": "紫金矿业",
"shares": 2400, "shares": 2400,
"cost": 39.89, "cost": 39.89,
"price": 27.86, "price": 27.88,
"market_value": 66864.0, "market_value": 66888.0,
"change_pct": 5.93, "change_pct": 6.01,
"currency": "CNY", "currency": "CNY",
"position_pct": 7.34, "position_pct": 7.34,
"_currency": "CNY" "_currency": "CNY"
@@ -53,9 +53,9 @@
"name": "海博思创", "name": "海博思创",
"shares": 200, "shares": 200,
"cost": 266.95, "cost": 266.95,
"price": 254.42, "price": 252.41,
"market_value": 50842.0, "market_value": 50496.0,
"change_pct": -0.5, "change_pct": -1.29,
"currency": "CNY", "currency": "CNY",
"position_pct": 6.31, "position_pct": 6.31,
"_currency": "CNY" "_currency": "CNY"
@@ -65,9 +65,9 @@
"name": "中芯国际", "name": "中芯国际",
"shares": 300, "shares": 300,
"cost": 126.07, "cost": 126.07,
"price": 143.01, "price": 141.28,
"market_value": 42600.0, "market_value": 42324.0,
"change_pct": -0.76, "change_pct": -1.96,
"currency": "CNY", "currency": "CNY",
"position_pct": 5.44, "position_pct": 5.44,
"_currency": "CNY" "_currency": "CNY"
@@ -76,22 +76,22 @@
"code": "01888", "code": "01888",
"name": "建滔积层板", "name": "建滔积层板",
"shares": 500, "shares": 500,
"cost": 76.5, "cost": 88.24,
"price": 73.96, "price": 86.0,
"market_value": 37325.0, "market_value": 37520.0,
"change_pct": 1.79, "change_pct": 2.625,
"currency": "CNY", "currency": "HKD",
"position_pct": 5.28, "position_pct": 5.28,
"_currency": "CNY" "_currency": "HKD"
}, },
{ {
"code": "688639", "code": "688639",
"name": "华恒生物", "name": "华恒生物",
"shares": 2800, "shares": 2800,
"cost": 21.51, "cost": 21.51,
"price": 16.71, "price": 16.63,
"market_value": 46900.0, "market_value": 46564.0,
"change_pct": -1.42, "change_pct": -1.89,
"currency": "CNY", "currency": "CNY",
"position_pct": 5.25, "position_pct": 5.25,
"_currency": "CNY" "_currency": "CNY"
@@ -101,9 +101,9 @@
"name": "宁德时代", "name": "宁德时代",
"shares": 100, "shares": 100,
"cost": 401.78, "cost": 401.78,
"price": 380.88, "price": 380.78,
"market_value": 38032.0, "market_value": 38105.0,
"change_pct": -0.38, "change_pct": -0.41,
"currency": "CNY", "currency": "CNY",
"position_pct": 4.64, "position_pct": 4.64,
"_currency": "CNY" "_currency": "CNY"
@@ -112,58 +112,58 @@
"code": "01211", "code": "01211",
"name": "比亚迪股份", "name": "比亚迪股份",
"shares": 600, "shares": 600,
"cost": 90.92, "cost": 104.87,
"price": 71.4, "price": 83.4,
"market_value": 43044.0, "market_value": 43542.0,
"change_pct": 5.172, "change_pct": 6.513,
"currency": "CNY", "currency": "HKD",
"position_pct": 4.62, "position_pct": 4.62,
"_currency": "CNY" "_currency": "HKD"
}, },
{ {
"code": "02202", "code": "02202",
"name": "万科企业", "name": "万科企业",
"shares": 19700, "shares": 19700,
"cost": 4.05, "cost": 4.67,
"price": 1.99, "price": 2.32,
"market_value": 39203.0, "market_value": 39794.0,
"change_pct": 2.69, "change_pct": 4.036,
"currency": "CNY", "currency": "HKD",
"position_pct": 4.6, "position_pct": 4.6,
"_currency": "CNY" "_currency": "HKD"
}, },
{ {
"code": "00700", "code": "00700",
"name": "腾讯", "name": "腾讯",
"shares": 100, "shares": 100,
"cost": null, "cost": 0.0,
"price": 374.72, "price": 435.2,
"market_value": 37541.0, "market_value": 37801.0,
"change_pct": 0.465, "change_pct": 1.162,
"currency": "CNY", "currency": "HKD",
"position_pct": null, "position_pct": null,
"_currency": "CNY" "_currency": "HKD"
}, },
{ {
"code": "00981", "code": "00981",
"name": "中芯国际", "name": "中芯国际",
"shares": 500, "shares": 500,
"cost": 65.84, "cost": 75.94,
"price": 67.63, "price": 78.15,
"market_value": 34440.0, "market_value": 33900.0,
"change_pct": -2.985, "change_pct": -2.799,
"currency": "CNY", "currency": "HKD",
"position_pct": 4.2, "position_pct": 4.2,
"_currency": "CNY" "_currency": "HKD"
}, },
{ {
"code": "300548", "code": "300548",
"name": "长芯博创", "name": "长芯博创",
"shares": 100, "shares": 100,
"cost": 231.46, "cost": 231.46,
"price": 226.24, "price": 222.45,
"market_value": 22599.0, "market_value": 22236.0,
"change_pct": 1.91, "change_pct": 0.2,
"currency": "CNY", "currency": "CNY",
"position_pct": 3.2, "position_pct": 3.2,
"_currency": "CNY" "_currency": "CNY"
@@ -173,9 +173,9 @@
"name": "黄金ETF华安", "name": "黄金ETF华安",
"shares": 2400, "shares": 2400,
"cost": 12.19, "cost": 12.19,
"price": 8.67, "price": 8.66,
"market_value": 20832.0, "market_value": 20784.0,
"change_pct": 2.32, "change_pct": 2.22,
"currency": "CNY", "currency": "CNY",
"position_pct": 2.45, "position_pct": 2.45,
"_currency": "CNY" "_currency": "CNY"
@@ -185,9 +185,9 @@
"name": "中科电气", "name": "中科电气",
"shares": 1400, "shares": 1400,
"cost": 22.29, "cost": 22.29,
"price": 14.37, "price": 14.3,
"market_value": 20062.0, "market_value": 20006.0,
"change_pct": 1.41, "change_pct": 0.92,
"currency": "CNY", "currency": "CNY",
"position_pct": 2.42, "position_pct": 2.42,
"_currency": "CNY" "_currency": "CNY"
@@ -197,9 +197,9 @@
"name": "模塑科技", "name": "模塑科技",
"shares": 1400, "shares": 1400,
"cost": 14.83, "cost": 14.83,
"price": 17.66, "price": 17.6,
"market_value": 25088.0, "market_value": 24654.0,
"change_pct": 4.68, "change_pct": 4.33,
"currency": "CNY", "currency": "CNY",
"position_pct": 2.41, "position_pct": 2.41,
"_currency": "CNY" "_currency": "CNY"
@@ -209,9 +209,9 @@
"name": "法拉电子", "name": "法拉电子",
"shares": 100, "shares": 100,
"cost": 147.18, "cost": 147.18,
"price": 160.15, "price": 157.93,
"market_value": 15900.0, "market_value": 15800.0,
"change_pct": -2.53, "change_pct": -3.88,
"currency": "CNY", "currency": "CNY",
"position_pct": 2.3, "position_pct": 2.3,
"_currency": "CNY" "_currency": "CNY"
@@ -220,21 +220,22 @@
"code": "01088", "code": "01088",
"name": "中国神华", "name": "中国神华",
"shares": 500, "shares": 500,
"cost": 39.79, "cost": 45.89,
"price": 34.56, "price": 39.97,
"market_value": 17305.0, "market_value": 17340.0,
"change_pct": 0.657, "change_pct": 0.909,
"currency": "CNY", "currency": "HKD",
"position_pct": 2.14, "position_pct": 2.14,
"_currency": "CNY" "_currency": "HKD"
} }
], ],
"total_assets": 859635.43, "total_assets": 957656.13,
"total_mv": 779159.43, "total_mv": 825534.2,
"stock_value": null, "stock_value": null,
"cash": 80476.0, "cash": 132121.93,
"frozen_cash": 0.0, "frozen_cash": 0,
"position_pct": 90.64, "position_pct": 86.2,
"currency": "CNY", "currency": "CNY",
"updated_at": "2026-07-03 13:44" "updated_at": "2026-07-03 14:45",
"_source": "db_sync"
} }
+20
View File
@@ -9129,6 +9129,26 @@
"event_label": "买入区间", "event_label": "买入区间",
"timestamp": "2026-07-03T13:30:30.458142", "timestamp": "2026-07-03T13:30:30.458142",
"date": "2026-07-03" "date": "2026-07-03"
},
{
"code": "688981",
"name": "中芯国际",
"event_type": "stop_loss",
"price": 140.94,
"trigger_value": "140.94",
"event_label": "",
"timestamp": "2026-07-03T14:32:04.634438",
"date": "2026-07-03"
},
{
"code": "688981",
"name": "中芯国际",
"event_type": "stop_loss",
"price": 140.9,
"trigger_value": "140.94",
"event_label": "",
"timestamp": "2026-07-03T14:36:05.312970",
"date": "2026-07-03"
} }
] ]
} }
+13 -13
View File
@@ -25,8 +25,8 @@
{ {
"date": "2026-07-03", "date": "2026-07-03",
"high": 1215.52, "high": 1215.52,
"low": 1188.0, "low": 1185.0,
"close": 1188.7 "close": 1195.45
} }
], ],
"02202": [ "02202": [
@@ -61,8 +61,8 @@
{ {
"date": "2026-07-03", "date": "2026-07-03",
"high": 50.2, "high": 50.2,
"low": 48.4, "low": 48.31,
"close": 48.44 "close": 49.06
} }
], ],
"02359": [ "02359": [
@@ -118,7 +118,7 @@
"date": "2026-07-03", "date": "2026-07-03",
"high": 502.0, "high": 502.0,
"low": 444.55, "low": 444.55,
"close": 494.57 "close": 482.68
} }
], ],
"06160": [ "06160": [
@@ -154,7 +154,7 @@
"date": "2026-07-03", "date": "2026-07-03",
"high": 687.04, "high": 687.04,
"low": 633.01, "low": 633.01,
"close": 646.83 "close": 644.5
} }
], ],
"09868": [ "09868": [
@@ -196,7 +196,7 @@
"date": "2026-07-03", "date": "2026-07-03",
"high": 757.88, "high": 757.88,
"low": 713.0, "low": 713.0,
"close": 733.9 "close": 738.2
} }
], ],
"300124": [ "300124": [
@@ -210,7 +210,7 @@
"date": "2026-07-03", "date": "2026-07-03",
"high": 74.63, "high": 74.63,
"low": 67.31, "low": 67.31,
"close": 73.13 "close": 72.22
} }
], ],
"000657": [ "000657": [
@@ -224,7 +224,7 @@
"date": "2026-07-03", "date": "2026-07-03",
"high": 101.5, "high": 101.5,
"low": 87.88, "low": 87.88,
"close": 91.78 "close": 90.33
} }
], ],
"000711": [ "000711": [
@@ -252,7 +252,7 @@
"date": "2026-07-03", "date": "2026-07-03",
"high": 892.1, "high": 892.1,
"low": 795.0, "low": 795.0,
"close": 887.87 "close": 882.5
} }
], ],
"002594": [ "002594": [
@@ -264,9 +264,9 @@
}, },
{ {
"date": "2026-07-03", "date": "2026-07-03",
"high": 87.28, "high": 88.78,
"low": 81.9, "low": 81.9,
"close": 86.45 "close": 88.72
} }
], ],
"00700": [ "00700": [
@@ -334,7 +334,7 @@
"date": "2026-07-03", "date": "2026-07-03",
"high": 646.85, "high": 646.85,
"low": 574.1, "low": 574.1,
"close": 635.0 "close": 620.31
} }
] ]
} }