持仓来源修复:holding.xls导入+持仓数据修正

老问题:scripts读的是 strategy_staleness_report.json 里的旧现金值,
portfolio.json 被 strategy_lifecycle.regenerate_all 反复覆盖。

修复:
1. import_holding_xls.py — 从 ~/stocks/holding.xls 导入TSV持仓
   (含25只真实持仓,14A/11H,总市值93万,现金8万,仓位92%)
2. stale_push_wlin 现金来源改读 portfolio.json(取代旧stale_report缓存)
3. 港股市值×汇率修正(之前按1:1当人民币算,总资产多估了)
4. 每条策略的决策树同步重建

脚本执行:python3 MoFin/scripts/import_holding_xls.py (含全量重评)
Dad你以后更新holding.xls后跑这条命令就行
This commit is contained in:
知微
2026-06-24 11:19:29 +08:00
parent 046e81a202
commit df4f898bc4
6 changed files with 1445 additions and 1294 deletions
+874 -618
View File
File diff suppressed because it is too large Load Diff
+42 -42
View File
@@ -1281,7 +1281,7 @@
"amplitude": 8.42,
"turnover_rate": 8.56
},
"updated_at": 1782270392.4357123
"updated_at": 1782271033.1053789
},
"01478": {
"daily": [
@@ -2562,7 +2562,7 @@
"high_52w": 16.44,
"low_52w": 6.4
},
"updated_at": 1782270373.8541079
"updated_at": 1782271016.7002888
},
"601899": {
"daily": [
@@ -3846,7 +3846,7 @@
"amplitude": 2.74,
"turnover_rate": 1.08
},
"updated_at": 1782270408.5494819
"updated_at": 1782271045.8500736
},
"600739": {
"daily": [
@@ -5130,7 +5130,7 @@
"amplitude": 1.93,
"turnover_rate": 0.67
},
"updated_at": 1782270405.2851994
"updated_at": 1782271043.1626832
},
"09988": {
"daily": [
@@ -6411,7 +6411,7 @@
"high_52w": 185.173,
"low_52w": 100.773
},
"updated_at": 1782270385.2876003
"updated_at": 1782271027.4969852
},
"688411": {
"daily": [
@@ -7695,7 +7695,7 @@
"amplitude": 6.7,
"turnover_rate": 4.53
},
"updated_at": 1782270411.4472852
"updated_at": 1782271047.3969336
},
"02202": {
"daily": [
@@ -8976,7 +8976,7 @@
"high_52w": 5.99,
"low_52w": 2.48
},
"updated_at": 1782270378.3142705
"updated_at": 1782271019.2727396
},
"01211": {
"daily": [
@@ -10257,7 +10257,7 @@
"high_52w": 135.889,
"low_52w": 81.35
},
"updated_at": 1782270372.8878348
"updated_at": 1782271015.8325095
},
"02388": {
"daily": [
@@ -11538,7 +11538,7 @@
"high_52w": 49.36,
"low_52w": 32.261
},
"updated_at": 1782270381.2359488
"updated_at": 1782271019.9959772
},
"300750": {
"daily": [
@@ -12822,7 +12822,7 @@
"amplitude": 1.91,
"turnover_rate": 0.59
},
"updated_at": 1782270396.0885975
"updated_at": 1782271035.31113
},
"603259": {
"daily": [
@@ -14106,7 +14106,7 @@
"amplitude": 2.33,
"turnover_rate": 1.11
},
"updated_at": 1782270410.1927426
"updated_at": 1782271046.5932066
},
"00700": {
"daily": [
@@ -15387,7 +15387,7 @@
"high_52w": 677.7,
"low_52w": 420.4
},
"updated_at": 1782270365.811218
"updated_at": 1782271009.5219116
},
"688981": {
"daily": [
@@ -16671,7 +16671,7 @@
"amplitude": 6.3,
"turnover_rate": 4.82
},
"updated_at": 1782270419.269491
"updated_at": 1782271052.2059975
},
"600110": {
"daily": [
@@ -19228,7 +19228,7 @@
"high_52w": 93.5,
"low_52w": 38.65
},
"updated_at": 1782270368.5939882
"updated_at": 1782271012.4736252
},
"600563": {
"daily": [
@@ -20512,7 +20512,7 @@
"amplitude": 3.97,
"turnover_rate": 4.21
},
"updated_at": 1782270403.279586
"updated_at": 1782271040.7884188
},
"600036": {
"daily": [
@@ -21796,7 +21796,7 @@
"amplitude": 1.84,
"turnover_rate": 0.32
},
"updated_at": 1782270399.5431237
"updated_at": 1782271037.721593
},
"300035": {
"daily": [
@@ -23080,7 +23080,7 @@
"amplitude": 2.1,
"turnover_rate": 3.34
},
"updated_at": 1782270386.2639337
"updated_at": 1782271028.7482398
},
"518880": {
"daily": [
@@ -24364,7 +24364,7 @@
"amplitude": 0.59,
"turnover_rate": 2.43
},
"updated_at": 1782270398.221961
"updated_at": 1782271036.5620172
},
"01888": {
"daily": [
@@ -25645,7 +25645,7 @@
"high_52w": 91.8,
"low_52w": 8.08
},
"updated_at": 1782270375.5251265
"updated_at": 1782271018.367241
},
"01088": {
"daily": [
@@ -26926,7 +26926,7 @@
"high_52w": 49.62,
"low_52w": 29.076
},
"updated_at": 1782270371.5566077
"updated_at": 1782271014.5332053
},
"002594": {
"daily": [
@@ -28210,7 +28210,7 @@
"amplitude": 2.57,
"turnover_rate": 1.42
},
"updated_at": 1782270364.7268536
"updated_at": 1782271008.387415
},
"09868": {
"daily": [
@@ -29491,7 +29491,7 @@
"high_52w": 110.8,
"low_52w": 52.65
},
"updated_at": 1782270384.0316818
"updated_at": 1782271026.4322388
},
"688795": {
"daily": [
@@ -30735,7 +30735,7 @@
"amplitude": 3.09,
"turnover_rate": 7.33
},
"updated_at": 1782270416.1041162
"updated_at": 1782271050.1670244
},
"688802": {
"daily": [
@@ -31979,7 +31979,7 @@
"amplitude": 4.81,
"turnover_rate": 12.26
},
"updated_at": 1782270417.2686496
"updated_at": 1782271051.0787034
},
"02359": {
"daily": [
@@ -33260,7 +33260,7 @@
"high_52w": 146.197,
"low_52w": 69.713
},
"updated_at": 1782270380.6385865
"updated_at": 1782271019.7459424
},
"02628": {
"daily": [
@@ -34541,7 +34541,7 @@
"high_52w": 36.16,
"low_52w": 16.827
},
"updated_at": 1782270381.5628703
"updated_at": 1782271020.6191452
},
"00968": {
"daily": [
@@ -35822,7 +35822,7 @@
"high_52w": 4.092,
"low_52w": 2.21
},
"updated_at": 1782270367.269548
"updated_at": 1782271010.600791
},
"06869": {
"daily": [
@@ -37103,7 +37103,7 @@
"high_52w": 283.0,
"low_52w": 16.146
},
"updated_at": 1782270382.7542024
"updated_at": 1782271023.011485
},
"02318": {
"daily": [
@@ -38384,7 +38384,7 @@
"high_52w": 72.689,
"low_52w": 42.648
},
"updated_at": 1782270379.1782396
"updated_at": 1782271019.5122526
},
"688639": {
"daily": [
@@ -39668,7 +39668,7 @@
"amplitude": 2.69,
"turnover_rate": 1.5
},
"updated_at": 1782270414.3082798
"updated_at": 1782271049.468328
},
"300124": {
"daily": [
@@ -40952,7 +40952,7 @@
"amplitude": 2.32,
"turnover_rate": 1.28
},
"updated_at": 1782270387.762072
"updated_at": 1782271030.279041
},
"01070": {
"daily": [
@@ -42233,7 +42233,7 @@
"high_52w": 16.19,
"low_52w": 8.802
},
"updated_at": 1782270369.7409928
"updated_at": 1782271013.3618884
},
"001309": {
"daily": [
@@ -43517,7 +43517,7 @@
"amplitude": 13.19,
"turnover_rate": 10.41
},
"updated_at": 1782270363.0476596
"updated_at": 1782271007.1646104
},
"06160": {
"daily": [
@@ -44798,7 +44798,7 @@
"high_52w": 229.4,
"low_52w": 144.1
},
"updated_at": 1782270382.420168
"updated_at": 1782271020.8689427
},
"000700": {
"daily": [
@@ -46082,7 +46082,7 @@
"amplitude": 4.41,
"turnover_rate": 7.65
},
"updated_at": 1782270360.214426
"updated_at": 1782271004.300124
},
"000711": {
"daily": [
@@ -47366,7 +47366,7 @@
"amplitude": 2.65,
"turnover_rate": 3.98
},
"updated_at": 1782270361.731888
"updated_at": 1782271005.4516623
},
"__index__sh000001": {
"name": "上证指数",
@@ -48664,7 +48664,7 @@
"volume": 108482337.0
}
],
"updated_at": 1782270412.914385
"updated_at": 1782271048.2724428
},
"300690": {
"daily": [
@@ -49937,7 +49937,7 @@
"volume": 457244.0
}
],
"updated_at": 1782270393.8197894
"updated_at": 1782271034.5268583
},
"000657": {
"daily": [
@@ -51210,7 +51210,7 @@
"volume": 15817777.0
}
],
"updated_at": 1782270359.2562582
"updated_at": 1782271003.133426
},
"300308": {
"daily": [
@@ -52483,7 +52483,7 @@
"volume": 4488584.0
}
],
"updated_at": 1782270390.4120219
"updated_at": 1782271031.766303
},
"600519": {
"daily": [
@@ -53756,7 +53756,7 @@
"volume": 583696.0
}
],
"updated_at": 1782270401.1043665
"updated_at": 1782271039.692529
},
"601318": {
"daily": [
@@ -55029,7 +55029,7 @@
"volume": 13423033.0
}
],
"updated_at": 1782270406.8869998
"updated_at": 1782271044.5394971
},
"sh000001": {
"daily": [
+342 -581
View File
@@ -1,613 +1,374 @@
{
"holdings": [
{
"code": "00700",
"name": "腾讯控股",
"code": "001309",
"name": "德明利",
"shares": 100,
"cost": 445.7552,
"position_pct": 3.72,
"is_active": 1,
"stop_loss": 387.49,
"take_profit": 496.33,
"entry_low": 435.13,
"entry_high": 440.67,
"action": "持有观察 | ⚠️盈亏比偏低(1:1.0),不建议加仓 | 止损387.49 | 目标496.33 | 买入区435.13~440.67 | 信号:持有",
"strategy_updated": "2026-06-19 16:01",
"analysis": {
"stop_loss": 314.9,
"take_profit": 433.14,
"entry_low": 413.33,
"entry_high": 417.07,
"action": "持有观察 | ⚠️盈亏比偏低(1:1.0),不建议加仓 | 止损314.9 | 目标433.14 | 买入区413.33~417.07 | 信号:持有",
"tech_snapshot": "形态:带上影阳线/neutral 量价:数据不足 强撑:352.87 弱撑:413.33 弱压:421.53 强压:481.27",
"reassessed_at": "2026-06-24 11:06",
"status": "updated",
"rr_ratio": 0.97,
"action_note": "⚠️盈亏比偏低(1:1.0),不建议加仓",
"timing_signal": "持有"
},
"price": 417.8,
"change_pct": 0.72
},
{
"code": "00981",
"name": "中芯国际",
"shares": 500,
"cost": 76.3899,
"position_pct": 3.23,
"is_active": 1,
"stop_loss": 67.69,
"take_profit": 87.26,
"entry_low": 73.68,
"entry_high": 76.57,
"action": "盈利持有 | ⚠️盈亏比偏低(1:1.0),不建议加仓 | 止损67.69 | 目标87.26 | 买入区73.68~76.57 | 信号:持有",
"strategy_updated": "2026-06-19 16:01",
"analysis": {
"stop_loss": 76.25,
"take_profit": 95.4,
"entry_low": 77.85,
"entry_high": 81.74,
"action": "盈利良好 | 止损76.25 | 目标95.4 | 买入区77.85~81.74 | 信号:持有",
"tech_snapshot": "形态:光头光脚阳线/bullish 量价:数据不足 强撑:68.2 弱撑:77.85 弱压:86.0 强压:95.4",
"reassessed_at": "2026-06-24 11:06",
"status": "updated",
"rr_ratio": 3.06,
"action_note": "",
"timing_signal": "持有"
},
"price": 82.6,
"change_pct": 6.1
},
{
"code": "01088",
"name": "中国神华",
"shares": 500,
"cost": 46.1659,
"position_pct": 1.79,
"is_active": 1,
"stop_loss": 35.09,
"take_profit": 42.9,
"entry_low": 41.66,
"entry_high": 42.8,
"action": "持有观察 | ⚠️盈亏比偏低(1:1.3),不建议加仓 | 止损35.09 | 目标42.9 | 买入区41.66~42.8 | 信号:持有",
"strategy_updated": "2026-06-19 16:01",
"analysis": {
"stop_loss": 33.29,
"take_profit": 41.38,
"entry_low": 41.1,
"entry_high": 41.64,
"action": "持有观察 | ⚠️盈亏比偏低(1:1.1),不建议加仓 | 止损33.29 | 目标41.38 | 买入区41.1~41.64 | 信号:持有",
"tech_snapshot": "形态:光头光脚阴线/bearish 量价:数据不足 强撑:37.3 弱撑:41.1 弱压:42.06 强压:45.98",
"reassessed_at": "2026-06-24 11:06",
"status": "updated",
"rr_ratio": 1.07,
"action_note": "⚠️盈亏比偏低(1:1.1),不建议加仓",
"timing_signal": "持有"
},
"price": 41.54,
"change_pct": -1.24
},
{
"code": "01211",
"name": "比亚迪股份",
"shares": 600,
"cost": 105.4926,
"position_pct": 4.1,
"is_active": 1,
"stop_loss": 63.99,
"take_profit": 87.07,
"entry_low": 72.77,
"entry_high": 84.89,
"action": "深套持有 | 深套持有 | 止损63.99 | 目标87.07 | 买入区72.77~84.89 | 信号:持有",
"strategy_updated": "2026-06-19 16:01",
"analysis": {
"stop_loss": 59.73,
"take_profit": 88.98,
"entry_low": 67.19,
"entry_high": 78.38,
"action": "深套持有 | 深套持有 | 止损59.73 | 目标88.98 | 买入区67.19~78.38 | 信号:持有",
"tech_snapshot": "形态:光头光脚阴线/bearish 量价:数据不足 强撑:61.58 弱撑:73.72 弱压:76.27 强压:88.98",
"reassessed_at": "2026-06-24 11:06",
"status": "updated",
"rr_ratio": 1.1,
"action_note": "深套持有",
"timing_signal": "持有"
},
"price": 75.0,
"change_pct": -1.05
"avail_shares": 100,
"price": 790.0,
"cost_price": 737.0374,
"pl": 5096.26,
"pl_pct": 6.91,
"currency": "CNY",
"market_val": 78800.0,
"cost_amount": 73703.74,
"exchange_rate": 0.866
},
{
"code": "01478",
"name": "丘钛科技",
"shares": 11000,
"cost": 13.8666,
"position_pct": 8.13,
"is_active": 1,
"stop_loss": 7.33,
"take_profit": 10.39,
"entry_low": 7.88,
"entry_high": 9.19,
"action": "深套持有 | 深套持有 | 止损7.33 | 目标10.39 | 买入区7.88~9.19 | 信号:持有",
"strategy_updated": "2026-06-19 16:01",
"analysis": {
"stop_loss": 5.59,
"take_profit": 9.56,
"entry_low": 6.8,
"entry_high": 7.94,
"action": "深套持有 | 深套持有 | 止损5.59 | 目标9.56 | 买入区6.8~7.94 | 信号:持有",
"tech_snapshot": "形态:光头光脚阴线/bearish 量价:数据不足 强撑:5.76 弱撑:7.43 弱压:7.88 强压:9.56",
"reassessed_at": "2026-06-24 11:06",
"status": "updated",
"rr_ratio": 1.11,
"action_note": "深套持有",
"timing_signal": "持有"
},
"price": 7.55,
"change_pct": -4.19
},
{
"code": "01888",
"name": "建滔积层板",
"shares": 500,
"cost": 88.7544,
"position_pct": 3.88,
"is_active": 1,
"stop_loss": 86.34,
"take_profit": 141.9,
"entry_low": 85.82,
"entry_high": 90.11,
"action": "盈利持有 | 短炒强趋势持 | 止损86.34 | 目标141.9 | 买入区85.82~90.11 | 信号:强趋势持",
"strategy_updated": "2026-06-19 16:01",
"analysis": {
"stop_loss": 90.39,
"take_profit": 132.74,
"entry_low": 87.25,
"entry_high": 91.61,
"action": "盈利良好 | 短炒强趋势持 | 止损90.39 | 目标132.74 | 买入区87.25~91.61 | 信号:持有",
"tech_snapshot": "形态:带上影阳线/neutral 量价:数据不足 强撑:56.57 弱撑:87.25 弱压:97.83 强压:128.87",
"reassessed_at": "2026-06-24 11:06",
"status": "updated",
"rr_ratio": 7.82,
"action_note": "短炒强趋势持",
"timing_signal": "持有"
},
"price": 93.2,
"change_pct": 6.76
},
{
"code": "02202",
"name": "万科企业",
"shares": 19700,
"cost": 4.6955,
"position_pct": 4.03,
"is_active": 1,
"stop_loss": 2.0,
"take_profit": 2.85,
"entry_low": 2.18,
"entry_high": 2.54,
"action": "深套持有 | 深套持有 | 止损2.0 | 目标2.85 | 买入区2.18~2.54 | 信号:持有",
"strategy_updated": "2026-06-19 16:01",
"analysis": {
"stop_loss": 1.77,
"take_profit": 2.48,
"entry_low": 2.12,
"entry_high": 2.47,
"action": "深套持有 | 深套持有 | 止损1.77 | 目标2.48 | 买入区2.12~2.47 | 信号:持有",
"tech_snapshot": "形态:光头光脚阴线/bearish 量价:数据不足 强撑:1.98 弱撑:2.3 弱压:2.43 强压:2.76",
"reassessed_at": "2026-06-24 11:06",
"status": "updated",
"rr_ratio": 1.11,
"action_note": "深套持有",
"timing_signal": "持有"
},
"price": 2.36,
"change_pct": -1.67
},
{
"code": "02388",
"name": "中银香港",
"shares": 1000,
"cost": 43.9719,
"position_pct": 4.07,
"is_active": 1,
"stop_loss": 43.49,
"take_profit": 50.1,
"entry_low": 47.51,
"entry_high": 48.95,
"action": "盈利良好 | 止损43.49 | 目标50.1 | 买入区47.51~48.95 | 信号:持有",
"strategy_updated": "2026-06-19 16:01",
"analysis": {
"stop_loss": 38.2,
"take_profit": 45.15,
"entry_low": 45.41,
"entry_high": 46.49,
"action": "盈利持有 | ⚠️盈亏比偏低(1:1.3),不建议加仓 | 止损38.2 | 目标45.15 | 买入区45.41~46.49 | 信号:加仓",
"tech_snapshot": "形态:光头光脚阴线/bearish 量价:数据不足 强撑:42.81 弱撑:45.41 弱压:47.09 强压:50.17",
"reassessed_at": "2026-06-24 11:06",
"status": "updated",
"rr_ratio": 1.31,
"action_note": "⚠️盈亏比偏低(1:1.3),不建议加仓",
"timing_signal": "加仓"
},
"price": 45.96,
"change_pct": -2.21
},
{
"code": "09988",
"name": "阿里巴巴-W",
"shares": 700,
"cost": 126.6781,
"position_pct": 6.2,
"is_active": 1,
"stop_loss": 90.82,
"take_profit": 118.69,
"entry_low": 102.87,
"entry_high": 104.43,
"action": "持有观察 | ⚠️盈亏比偏低(1:0.9),不建议加仓 | 止损90.82 | 目标118.69 | 买入区102.87~104.43 | 信号:持有",
"strategy_updated": "2026-06-19 16:01",
"analysis": {
"stop_loss": 74.1,
"take_profit": 102.72,
"entry_low": 88.16,
"entry_high": 102.85,
"action": "深套持有 | 深套持有 | 止损74.1 | 目标102.72 | 买入区88.16~102.85 | 信号:持有",
"tech_snapshot": "形态:带上影阴线/bearish 量价:数据不足 强撑:83.03 弱撑:97.22 弱压:99.52 强压:114.13",
"reassessed_at": "2026-06-24 11:06",
"status": "updated",
"rr_ratio": 1.08,
"action_note": "深套持有",
"timing_signal": "持有"
},
"price": 98.05,
"change_pct": -0.91
},
{
"code": "300035",
"name": "中科电气",
"shares": 1400,
"cost": 22.2914,
"position_pct": 2.38,
"is_active": 1,
"stop_loss": 13.74,
"take_profit": 19.0,
"entry_low": 15.63,
"entry_high": 18.24,
"action": "深套持有 | 深套持有 | 止损13.74 | 目标19.0 | 买入区15.63~18.24 | 信号:持有",
"strategy_updated": "2026-06-19 16:01",
"analysis": {
"stop_loss": 13.86,
"take_profit": 18.95,
"entry_low": 14.41,
"entry_high": 16.81,
"action": "深套持有 | 深套持有 | 止损13.86 | 目标18.95 | 买入区14.41~16.81 | 信号:持有",
"tech_snapshot": "形态:光头光脚阴线/bearish 量价:主动卖盘占优 强撑:13.86 弱撑:15.86 弱压:16.36 强压:18.4",
"reassessed_at": "2026-06-24 11:06",
"status": "updated",
"rr_ratio": 1.0,
"action_note": "深套持有",
"timing_signal": "持有"
},
"price": 16.04,
"change_pct": -1.96
},
{
"code": "300548",
"name": "长芯博创",
"shares": 100,
"cost": 231.46,
"position_pct": 2.76,
"is_active": 1,
"stop_loss": 251.24,
"take_profit": 413.9,
"entry_low": 269.8,
"entry_high": 283.29,
"action": "盈利良好 | 短炒强趋势持 | 止损251.24 | 目标413.9 | 买入区269.8~283.29 | 信号:强趋势持",
"strategy_updated": "2026-06-19 16:01",
"analysis": {
"stop_loss": 239.57,
"take_profit": 263.31,
"entry_low": 268.46,
"entry_high": 280.51,
"action": "盈利良好 | 短炒强趋势持 | 止损239.57 | 目标263.31 | 买入区268.46~280.51 | 信号:持有",
"tech_snapshot": "形态:带上影阴线/bearish 量价:主动买盘占优 强撑:228.82 弱撑:268.46 弱压:292.57 强压:343.22",
"reassessed_at": "2026-06-24 11:06",
"status": "updated",
"rr_ratio": 2.0,
"action_note": "短炒强趋势持",
"timing_signal": "持有"
},
"price": 278.09,
"change_pct": -2.77
},
{
"code": "300690",
"name": "双一科技",
"shares": 400,
"cost": 27.178,
"position_pct": 0.94,
"is_active": 1,
"stop_loss": 22.1,
"take_profit": 25.93,
"entry_low": 23.57,
"entry_high": 23.98,
"action": "持有观察 | ⚠️盈亏比偏低(1:1.2),不建议加仓 | 止损22.1 | 目标25.93 | 买入区23.57~23.98 | 信号:持有",
"strategy_updated": "2026-06-19 16:01",
"analysis": {
"stop_loss": 18.94,
"take_profit": 22.37,
"entry_low": 22.42,
"entry_high": 23.04,
"action": "持有观察 | ⚠️盈亏比偏低(1:1.4),不建议加仓 | 止损18.94 | 目标22.37 | 买入区22.42~23.04 | 信号:持有",
"tech_snapshot": "形态:光头光脚阴线/bearish 量价:主动卖盘占优 强撑:21.22 弱撑:22.42 弱压:23.63 强压:24.86",
"reassessed_at": "2026-06-24 11:06",
"status": "updated",
"rr_ratio": 1.38,
"action_note": "⚠️盈亏比偏低(1:1.4),不建议加仓",
"timing_signal": "持有"
},
"price": 22.7,
"change_pct": -3.94
},
{
"code": "300750",
"name": "宁德时代",
"shares": 100,
"cost": 401.7803,
"position_pct": 3.84,
"is_active": 1,
"stop_loss": 345.04,
"take_profit": 414.6,
"entry_low": 384.35,
"entry_high": 397.12,
"action": "持有观察 | 止损345.04 | 目标414.6 | 买入区384.35~397.12 | 信号:弱势持有",
"strategy_updated": "2026-06-19 16:01",
"analysis": {
"stop_loss": 348.92,
"take_profit": 421.19,
"entry_low": 386.21,
"entry_high": 390.45,
"action": "持有观察 | ⚠️盈亏比偏低(1:1.0),不建议加仓 | 止损348.92 | 目标421.19 | 买入区386.21~390.45 | 信号:弱势持有",
"tech_snapshot": "形态:锤子线/T字线/bullish 量价:买卖均衡 强撑:359.71 弱撑:386.21 弱压:394.23 强压:421.19",
"reassessed_at": "2026-06-24 11:06",
"status": "updated",
"rr_ratio": 1.05,
"action_note": "⚠️盈亏比偏低(1:1.0),不建议加仓",
"timing_signal": "弱势持有"
},
"price": 390.38,
"change_pct": -0.54
},
{
"code": "518880",
"name": "黄金ETF华安",
"shares": 2400,
"cost": 12.1915,
"position_pct": 2.09,
"is_active": 1,
"stop_loss": 7.05,
"take_profit": 9.17,
"entry_low": 8.02,
"entry_high": 9.35,
"action": "深套持有 | 深套持有 | 止损7.05 | 目标9.17 | 买入区8.02~9.35 | 信号:持有",
"strategy_updated": "2026-06-19 16:01",
"analysis": {
"stop_loss": 6.4,
"take_profit": 8.23,
"entry_low": 7.6,
"entry_high": 8.86,
"action": "深套持有 | 深套持有 | 止损6.4 | 目标8.23 | 买入区7.6~8.86 | 信号:持有",
"tech_snapshot": "形态:带上影阴线/bearish 量价:数据不足 强撑:7.79 弱撑:8.4 弱压:8.54 强压:9.14",
"reassessed_at": "2026-06-24 11:06",
"status": "updated",
"rr_ratio": 0.55,
"action_note": "深套持有",
"timing_signal": "持有"
},
"price": 8.44,
"change_pct": -1.09
},
{
"code": "600036",
"name": "招商银行",
"shares": 800,
"cost": 38.1582,
"position_pct": 2.92,
"is_active": 1,
"stop_loss": 32.21,
"take_profit": 39.68,
"entry_low": 36.95,
"entry_high": 37.57,
"action": "持有观察 | ⚠️盈亏比偏低(1:1.2),不建议加仓 | 止损32.21 | 目标39.68 | 买入区36.95~37.57 | 信号:弱势持有",
"strategy_updated": "2026-06-19 16:01",
"analysis": {
"stop_loss": 30.56,
"take_profit": 36.15,
"entry_low": 36.83,
"entry_high": 37.2,
"action": "持有观察 | ⚠️盈亏比偏低(1:1.0),不建议加仓 | 止损30.56 | 目标36.15 | 买入区36.83~37.2 | 信号:弱势持有",
"tech_snapshot": "形态:光头光脚阴线/bearish 量价:买卖均衡 强撑:34.24 弱撑:36.83 弱压:37.47 强压:40.17",
"reassessed_at": "2026-06-24 11:06",
"status": "updated",
"rr_ratio": 1.04,
"action_note": "⚠️盈亏比偏低(1:1.0),不建议加仓",
"timing_signal": "弱势持有"
},
"price": 37.06,
"change_pct": -0.91
},
{
"code": "600563",
"name": "法拉电子",
"shares": 200,
"cost": 155.5032,
"position_pct": 3.3,
"is_active": 1,
"stop_loss": 161.41,
"take_profit": 192.67,
"entry_low": 165.51,
"entry_high": 173.79,
"action": "盈利良好 | 止损161.41 | 目标192.67 | 买入区165.51~173.79 | 信号:持有",
"strategy_updated": "2026-06-19 16:01",
"analysis": {
"stop_loss": 167.87,
"take_profit": 184.12,
"entry_low": 162.51,
"entry_high": 170.64,
"action": "盈利良好 | ⚠️盈亏比偏低(1:0.6),不建议加仓 | 止损167.87 | 目标184.12 | 买入区162.51~170.64 | 信号:持有",
"tech_snapshot": "形态:光头光脚阳线/bullish 量价:买卖均衡 强撑:146.26 弱撑:162.51 弱压:181.32 强压:178.76",
"reassessed_at": "2026-06-24 11:06",
"status": "updated",
"rr_ratio": 0.61,
"action_note": "⚠️盈亏比偏低(1:0.6),不建议加仓",
"timing_signal": "持有"
},
"price": 176.87,
"change_pct": 8.84
"avail_shares": 11000,
"price": 7.57,
"cost_price": 13.8089,
"pl": -59438.6,
"pl_pct": -45.18,
"currency": "HKD",
"market_val": 72120.15,
"cost_amount": 131558.75,
"exchange_rate": 0.8661,
"change_pct": -3.93
},
{
"code": "600739",
"name": "辽宁成大",
"shares": 6600,
"cost": 12.2862,
"position_pct": 6.52,
"is_active": 1,
"stop_loss": 9.1,
"take_profit": 11.19,
"entry_low": 10.0,
"entry_high": 10.12,
"action": "持有观察 | ⚠️盈亏比偏低(1:1.1),不建议加仓 | 止损9.1 | 目标11.19 | 买入区10.0~10.12 | 信号:持有",
"strategy_updated": "2026-06-19 16:01",
"analysis": {
"stop_loss": 8.56,
"take_profit": 10.52,
"entry_low": 10.34,
"entry_high": 10.64,
"action": "持有观察 | ⚠️盈亏比偏低(1:1.3),不建议加仓 | 止损8.56 | 目标10.52 | 买入区10.34~10.64 | 信号:持有",
"tech_snapshot": "形态:带上影阴线/bearish 量价:主动买盘占优 强撑:9.59 弱撑:10.34 弱压:10.75 强压:11.69",
"reassessed_at": "2026-06-24 11:06",
"status": "updated",
"rr_ratio": 1.33,
"action_note": "⚠️盈亏比偏低(1:1.3),不建议加仓",
"timing_signal": "持有"
},
"price": 10.49,
"change_pct": -1.5
"avail_shares": 6600,
"price": 10.44,
"cost_price": 12.2862,
"pl": -11789.02,
"pl_pct": -14.54,
"currency": "CNY",
"market_val": 69300.0,
"cost_amount": 81089.02,
"exchange_rate": 0.866,
"change_pct": -1.97
},
{
"code": "601899",
"name": "紫金矿业",
"shares": 2400,
"cost": 40.2685,
"position_pct": 6.98,
"is_active": 1,
"stop_loss": 24.48,
"take_profit": 34.47,
"entry_low": 26.72,
"entry_high": 31.17,
"action": "深套持有 | 深套持有 | 止损24.48 | 目标34.47 | 买入区26.72~31.17 | 信号:持有",
"strategy_updated": "2026-06-19 16:01",
"analysis": {
"stop_loss": 22.65,
"take_profit": 30.53,
"entry_low": 24.72,
"entry_high": 28.84,
"action": "深套持有 | 深套持有 | 止损22.65 | 目标30.53 | 买入区24.72~28.84 | 信号:持有",
"tech_snapshot": "形态:倒T线/射击之星/neutral 量价:主动买盘占优 强撑:24.98 弱撑:27.21 弱压:27.85 强压:30.53",
"reassessed_at": "2026-06-24 11:06",
"status": "updated",
"rr_ratio": 0.74,
"action_note": "深套持有",
"timing_signal": "持有"
},
"price": 27.45,
"change_pct": -1.08
"avail_shares": 2400,
"price": 27.38,
"cost_price": 40.2685,
"pl": -30572.29,
"pl_pct": -31.63,
"currency": "CNY",
"market_val": 66072.0,
"cost_amount": 96644.29,
"exchange_rate": 0.866
},
{
"code": "688639",
"name": "华恒生物",
"shares": 2800,
"avail_shares": 0,
"price": 21.31,
"cost_price": 21.5085,
"pl": -135.75,
"pl_pct": -0.23,
"currency": "CNY",
"market_val": 60088.0,
"cost_amount": 60223.75,
"exchange_rate": 0.866
},
{
"code": "09988",
"name": "阿里巴巴-W",
"shares": 700,
"avail_shares": 700,
"price": 98.55,
"cost_price": 126.1516,
"pl": -16582.48,
"pl_pct": -21.68,
"currency": "HKD",
"market_val": 59899.48,
"cost_amount": 76481.96,
"exchange_rate": 0.8661,
"change_pct": -0.4
},
{
"code": "603259",
"name": "药明康德",
"shares": 400,
"cost": 96.201,
"position_pct": 4.02,
"is_active": 1,
"stop_loss": 97.16,
"take_profit": 111.26,
"entry_low": 98.2,
"entry_high": 103.11,
"action": "盈利良好 | ⚠️盈亏比偏低(1:1.2),不建议加仓 | 止损97.16 | 目标111.26 | 买入区98.2~103.11 | 信号:持有",
"strategy_updated": "2026-06-19 16:01",
"analysis": {
"stop_loss": 113.15,
"take_profit": 139.5,
"entry_low": 106.31,
"entry_high": 111.63,
"action": "盈利良好 | 止损113.15 | 目标139.5 | 买入区106.31~111.63 | 信号:持有",
"tech_snapshot": "形态:光头光脚阳线/bullish 量价:买卖均衡 强撑:95.68 弱撑:106.31 弱压:120.29 强压:135.44",
"reassessed_at": "2026-06-24 11:06",
"status": "updated",
"rr_ratio": 3.16,
"action_note": "",
"timing_signal": "持有"
},
"avail_shares": 400,
"price": 116.94,
"change_pct": 10.0
},
{
"code": "688411",
"name": "海博思创",
"shares": 239,
"cost": 258.6163,
"position_pct": 6.58,
"is_active": 1,
"stop_loss": 253.82,
"take_profit": 316.5,
"entry_low": 273.21,
"entry_high": 286.87,
"action": "盈利良好 | 止损253.82 | 目标316.5 | 买入区273.21~286.87 | 信号:持有",
"strategy_updated": "2026-06-19 16:01",
"analysis": {
"stop_loss": 198.18,
"take_profit": 280.03,
"entry_low": 261.14,
"entry_high": 266.61,
"action": "盈利持有 | ⚠️盈亏比偏低(1:1.1),不建议加仓 | 止损198.18 | 目标280.03 | 买入区261.14~266.61 | 信号:加仓",
"tech_snapshot": "形态:带下影阴线/neutral 量价:买卖均衡 强撑:222.07 弱撑:261.14 弱压:272.24 强压:311.15",
"reassessed_at": "2026-06-24 11:06",
"status": "updated",
"rr_ratio": 1.05,
"action_note": "⚠️盈亏比偏低(1:1.1),不建议加仓",
"timing_signal": "加仓"
},
"price": 265.89,
"change_pct": -2.33
"cost_price": 96.201,
"pl": 8295.62,
"pl_pct": 21.56,
"currency": "CNY",
"market_val": 46776.0,
"cost_amount": 38480.38,
"exchange_rate": 0.866
},
{
"code": "688981",
"name": "中芯国际",
"shares": 300,
"cost": 126.0681,
"position_pct": 4.13,
"is_active": 1,
"stop_loss": 132.76,
"take_profit": 164.45,
"entry_low": 134.18,
"entry_high": 140.89,
"action": "盈利良好 | 止损132.76 | 目标164.45 | 买入区134.18~140.89 | 信号:持有",
"strategy_updated": "2026-06-19 16:01",
"analysis": {
"stop_loss": 137.58,
"take_profit": 170.04,
"entry_low": 141.7,
"entry_high": 148.78,
"action": "盈利良好 | 止损137.58 | 目标170.04 | 买入区141.7~148.78 | 信号:持有",
"tech_snapshot": "形态:光头光脚阳线/bullish 量价:买卖均衡 强撑:119.44 弱撑:141.7 弱压:154.82 强压:170.04",
"reassessed_at": "2026-06-24 11:07",
"status": "updated",
"rr_ratio": 2.78,
"action_note": "",
"timing_signal": "持有"
},
"price": 150.73,
"change_pct": 6.37
"avail_shares": 300,
"price": 149.89,
"cost_price": 126.0681,
"pl": 7173.58,
"pl_pct": 18.97,
"currency": "CNY",
"market_val": 44994.0,
"cost_amount": 37820.42,
"exchange_rate": 0.866,
"change_pct": 5.78
},
{
"code": "01888",
"name": "建滔积层板",
"shares": 500,
"avail_shares": 500,
"price": 93.5,
"cost_price": 88.3855,
"pl": 2409.7,
"pl_pct": 6.3,
"currency": "HKD",
"market_val": 40685.05,
"cost_amount": 38275.35,
"exchange_rate": 0.8661,
"change_pct": 7.16
},
{
"code": "02202",
"name": "万科企业",
"shares": 19700,
"avail_shares": 19700,
"price": 2.37,
"cost_price": 4.676,
"pl": -39344.79,
"pl_pct": -49.32,
"currency": "HKD",
"market_val": 40437.34,
"cost_amount": 79782.13,
"exchange_rate": 0.8661
},
{
"code": "02388",
"name": "中银香港",
"shares": 1000,
"avail_shares": 1000,
"price": 46.22,
"cost_price": 43.7892,
"pl": 2053.39,
"pl_pct": 5.41,
"currency": "HKD",
"market_val": 39979.18,
"cost_amount": 37925.79,
"exchange_rate": 0.8661,
"change_pct": -1.66
},
{
"code": "300750",
"name": "宁德时代",
"shares": 100,
"avail_shares": 100,
"price": 391.09,
"cost_price": 401.7803,
"pl": -1063.03,
"pl_pct": -2.65,
"currency": "CNY",
"market_val": 39115.0,
"cost_amount": 40178.03,
"exchange_rate": 0.866,
"change_pct": -0.36
},
{
"code": "01211",
"name": "比亚迪股份",
"shares": 600,
"avail_shares": 600,
"price": 75.0,
"cost_price": 105.0542,
"pl": -15539.97,
"pl_pct": -28.47,
"currency": "HKD",
"market_val": 39052.45,
"cost_amount": 54592.42,
"exchange_rate": 0.8661
},
{
"code": "00700",
"name": "腾讯控股",
"shares": 100,
"avail_shares": 100,
"price": 420.0,
"cost_price": 443.9024,
"pl": -2035.55,
"pl_pct": -5.29,
"currency": "HKD",
"market_val": 36410.84,
"cost_amount": 38446.39,
"exchange_rate": 0.8661,
"change_pct": 1.25
},
{
"code": "00981",
"name": "中芯国际",
"shares": 500,
"avail_shares": 500,
"price": 83.15,
"cost_price": 76.0724,
"pl": 3151.55,
"pl_pct": 9.57,
"currency": "HKD",
"market_val": 36094.72,
"cost_amount": 32943.17,
"exchange_rate": 0.8661,
"change_pct": 6.81
},
{
"code": "09868",
"name": "小鹏集团-W",
"shares": 700,
"avail_shares": 700,
"price": 50.2,
"cost_price": 51.3644,
"pl": -675.62,
"pl_pct": -2.17,
"currency": "HKD",
"market_val": 30465.07,
"cost_amount": 31140.69,
"exchange_rate": 0.8661
},
{
"code": "600036",
"name": "招商银行",
"shares": 800,
"avail_shares": 800,
"price": 37.06,
"cost_price": 38.1582,
"pl": -846.53,
"pl_pct": -2.77,
"currency": "CNY",
"market_val": 29680.0,
"cost_amount": 30526.53,
"exchange_rate": 0.866,
"change_pct": -0.91
},
{
"code": "300548",
"name": "长芯博创",
"shares": 100,
"avail_shares": 100,
"price": 276.12,
"cost_price": 231.46,
"pl": 4766.0,
"pl_pct": 20.59,
"currency": "CNY",
"market_val": 27912.0,
"cost_amount": 23146.0,
"exchange_rate": 0.866,
"change_pct": -3.46
},
{
"code": "02318",
"name": "中国平安",
"shares": 500,
"avail_shares": 500,
"price": 52.7,
"cost_price": 54.8199,
"pl": -896.35,
"pl_pct": -3.78,
"currency": "HKD",
"market_val": 22843.39,
"cost_amount": 23739.74,
"exchange_rate": 0.8661,
"change_pct": -1.68
},
{
"code": "300035",
"name": "中科电气",
"shares": 1400,
"avail_shares": 1400,
"price": 16.02,
"cost_price": 22.2914,
"pl": -8765.91,
"pl_pct": -28.09,
"currency": "CNY",
"market_val": 22442.0,
"cost_amount": 31207.91,
"exchange_rate": 0.866
},
{
"code": "000700",
"name": "模塑科技",
"shares": 1400,
"avail_shares": 1400,
"price": 14.53,
"cost_price": 14.8336,
"pl": -327.0,
"pl_pct": -1.57,
"currency": "CNY",
"market_val": 20440.0,
"cost_amount": 20767.0,
"exchange_rate": 0.866,
"change_pct": -3.0
},
{
"code": "518880",
"name": "黄金ETF华安",
"shares": 2400,
"avail_shares": 2400,
"price": 8.43,
"cost_price": 12.1915,
"pl": -8982.04,
"pl_pct": -30.7,
"currency": "CNY",
"market_val": 20277.6,
"cost_amount": 29259.64,
"exchange_rate": 0.866,
"change_pct": -1.21
},
{
"code": "01088",
"name": "中国神华",
"shares": 500,
"avail_shares": 500,
"price": 41.92,
"cost_price": 45.974,
"pl": -1764.27,
"pl_pct": -8.86,
"currency": "HKD",
"market_val": 18144.8,
"cost_amount": 19909.06,
"exchange_rate": 0.8661
},
{
"code": "600563",
"name": "法拉电子",
"shares": 100,
"avail_shares": 100,
"price": 178.76,
"cost_price": 146.95,
"pl": 2762.0,
"pl_pct": 18.8,
"currency": "CNY",
"market_val": 17457.0,
"cost_amount": 14695.0,
"exchange_rate": 0.866
},
{
"code": "300690",
"name": "双一科技",
"shares": 400,
"avail_shares": 400,
"price": 22.7,
"cost_price": 27.178,
"pl": -1759.2,
"pl_pct": -16.18,
"currency": "CNY",
"market_val": 9112.0,
"cost_amount": 10871.2,
"exchange_rate": 0.866
}
]
],
"cash": 80476,
"total_market_value": 930199.93,
"total_pl": -164810.3,
"position_pct": 92.0,
"updated_at": "2026-06-24 11:47",
"source": "/home/hmo/stocks/holding.xls"
}
+45 -45
View File
@@ -108,7 +108,7 @@
"date": "2026-06-24",
"high": 88.32,
"low": 82.78,
"close": 82.81
"close": 82.82
}
],
"00700": [
@@ -164,7 +164,7 @@
"date": "2026-06-24",
"high": 432.4,
"low": 412.6,
"close": 417.8
"close": 421.6
}
],
"000700": [
@@ -220,7 +220,7 @@
"date": "2026-06-24",
"high": 15.6,
"low": 14.3,
"close": 14.55
"close": 14.59
}
],
"001309": [
@@ -276,7 +276,7 @@
"date": "2026-06-24",
"high": 816.0,
"low": 706.0,
"close": 783.28
"close": 794.11
}
],
"00968": [
@@ -332,7 +332,7 @@
"date": "2026-06-24",
"high": 2.26,
"low": 1.93,
"close": 1.96
"close": 2.0
}
],
"00981": [
@@ -388,7 +388,7 @@
"date": "2026-06-24",
"high": 84.9,
"low": 76.5,
"close": 82.9
"close": 83.15
}
],
"01070": [
@@ -444,7 +444,7 @@
"date": "2026-06-24",
"high": 13.47,
"low": 12.55,
"close": 13.04
"close": 13.08
}
],
"01088": [
@@ -500,7 +500,7 @@
"date": "2026-06-24",
"high": 43.14,
"low": 41.26,
"close": 41.48
"close": 41.8
}
],
"01211": [
@@ -556,7 +556,7 @@
"date": "2026-06-24",
"high": 78.3,
"low": 74.3,
"close": 74.7
"close": 75.05
}
],
"01478": [
@@ -611,8 +611,8 @@
{
"date": "2026-06-24",
"high": 8.54,
"low": 7.54,
"close": 7.55
"low": 7.51,
"close": 7.52
}
],
"01888": [
@@ -668,7 +668,7 @@
"date": "2026-06-24",
"high": 97.4,
"low": 83.7,
"close": 93.15
"close": 93.85
}
],
"02202": [
@@ -724,7 +724,7 @@
"date": "2026-06-24",
"high": 2.53,
"low": 2.32,
"close": 2.35
"close": 2.37
}
],
"02318": [
@@ -780,7 +780,7 @@
"date": "2026-06-24",
"high": 55.5,
"low": 52.3,
"close": 52.65
"close": 52.7
}
],
"02359": [
@@ -834,9 +834,9 @@
},
{
"date": "2026-06-24",
"high": 143.5,
"high": 143.8,
"low": 130.0,
"close": 142.2
"close": 143.8
}
],
"02388": [
@@ -892,7 +892,7 @@
"date": "2026-06-24",
"high": 47.86,
"low": 45.9,
"close": 46.0
"close": 46.16
}
],
"02628": [
@@ -948,7 +948,7 @@
"date": "2026-06-24",
"high": 30.56,
"low": 28.18,
"close": 28.34
"close": 28.38
}
],
"06160": [
@@ -1002,9 +1002,9 @@
},
{
"date": "2026-06-24",
"high": 168.3,
"high": 168.5,
"low": 160.0,
"close": 166.2
"close": 168.5
}
],
"06869": [
@@ -1060,7 +1060,7 @@
"date": "2026-06-24",
"high": 305.0,
"low": 253.4,
"close": 254.6
"close": 256.2
}
],
"09868": [
@@ -1116,7 +1116,7 @@
"date": "2026-06-24",
"high": 52.3,
"low": 48.82,
"close": 49.84
"close": 50.25
}
],
"09988": [
@@ -1172,7 +1172,7 @@
"date": "2026-06-24",
"high": 103.4,
"low": 97.65,
"close": 98.15
"close": 98.65
}
],
"300035": [
@@ -1284,7 +1284,7 @@
"date": "2026-06-24",
"high": 68.8,
"low": 65.74,
"close": 65.91
"close": 65.87
}
],
"300548": [
@@ -1756,7 +1756,7 @@
"date": "2026-06-24",
"high": 309.6,
"low": 275.86,
"close": 276.81
"close": 276.92
}
],
"300750": [
@@ -1812,7 +1812,7 @@
"date": "2026-06-24",
"high": 414.04,
"low": 386.66,
"close": 390.0
"close": 390.67
}
],
"518880": [
@@ -1868,7 +1868,7 @@
"date": "2026-06-24",
"high": 8.674,
"low": 8.426,
"close": 8.438
"close": 8.439
}
],
"600036": [
@@ -1930,7 +1930,7 @@
"date": "2026-06-24",
"high": 38.19,
"low": 36.94,
"close": 37.1
"close": 37.04
}
],
"600110": [
@@ -2030,7 +2030,7 @@
"date": "2026-06-24",
"high": 178.76,
"low": 160.6,
"close": 174.19
"close": 178.76
}
],
"600739": [
@@ -2085,8 +2085,8 @@
{
"date": "2026-06-24",
"high": 11.0,
"low": 10.44,
"close": 10.5
"low": 10.43,
"close": 10.43
}
],
"601899": [
@@ -2148,7 +2148,7 @@
"date": "2026-06-24",
"high": 30.0,
"low": 27.33,
"close": 27.47
"close": 27.41
}
],
"688411": [
@@ -2204,7 +2204,7 @@
"date": "2026-06-24",
"high": 285.98,
"low": 261.8,
"close": 265.95
"close": 264.75
}
],
"688639": [
@@ -2260,7 +2260,7 @@
"date": "2026-06-24",
"high": 22.47,
"low": 20.99,
"close": 21.51
"close": 21.35
}
],
"688795": [
@@ -2316,7 +2316,7 @@
"date": "2026-06-24",
"high": 745.2,
"low": 660.01,
"close": 678.7
"close": 678.5
}
],
"688802": [
@@ -2372,7 +2372,7 @@
"date": "2026-06-24",
"high": 808.0,
"low": 726.1,
"close": 735.92
"close": 736.12
}
],
"688981": [
@@ -2428,7 +2428,7 @@
"date": "2026-06-24",
"high": 153.0,
"low": 139.6,
"close": 149.89
"close": 150.15
}
],
"000711": [
@@ -2466,7 +2466,7 @@
"date": "2026-06-24",
"high": 5.38,
"low": 4.86,
"close": 5.2
"close": 5.16
}
],
"688630": [
@@ -2498,7 +2498,7 @@
"date": "2026-06-24",
"high": 499.0,
"low": 455.55,
"close": 496.51
"close": 493.7
}
],
"300690": [
@@ -2529,8 +2529,8 @@
{
"date": "2026-06-24",
"high": 24.39,
"low": 22.71,
"close": 22.75
"low": 22.69,
"close": 22.7
}
],
"000657": [
@@ -2550,7 +2550,7 @@
"date": "2026-06-24",
"high": 113.99,
"low": 94.79,
"close": 98.49
"close": 98.45
}
],
"300308": [
@@ -2570,7 +2570,7 @@
"date": "2026-06-24",
"high": 1395.0,
"low": 1296.0,
"close": 1300.79
"close": 1300.0
}
],
"600519": [
@@ -2590,7 +2590,7 @@
"date": "2026-06-24",
"high": 1264.0,
"low": 1209.11,
"close": 1218.51
"close": 1215.18
}
],
"601318": [
@@ -2610,7 +2610,7 @@
"date": "2026-06-24",
"high": 52.43,
"low": 49.03,
"close": 49.58
"close": 49.38
}
],
"002171": [
+138
View File
@@ -0,0 +1,138 @@
#!/usr/bin/env python3
"""
import_holding_xls.py — 从券商导出文件 holding.xls 导入持仓数据
读取 /home/hmo/stocks/holding.xlsTSV格式,GBK编码)
写入 /home/hmo/web-dashboard/data/portfolio.json
触发 per_stock_reassess 全量重评(更新 decisions.json + 决策树)
用法:python3 import_holding_xls.py
"""
import csv, json, sys, subprocess
from datetime import datetime
STOCKS_FILE = "/home/hmo/stocks/holding.xls"
PORTFOLIO_PATH = "/home/hmo/web-dashboard/data/portfolio.json"
CASH = 80476 # 现金余额(手动更新或从其他源读取)
def clean_cell(v):
v = v.strip()
if v.startswith('="') and v.endswith('"'):
v = v[2:-1]
elif v.startswith('='):
v = v[1:]
return v.strip()
def main():
with open(STOCKS_FILE, 'r', encoding='gbk') as f:
reader = csv.reader(f, delimiter='\t')
rows = list(reader)
print(f"读取 {STOCKS_FILE}: {len(rows)-1} 条记录")
holdings = []
total_mv_cny = 0
total_pl = 0
for r in rows[1:]:
code = clean_cell(r[0])
name = r[1].strip()
shares = int(clean_cell(r[2]))
avail = int(clean_cell(r[3]))
price_raw = r[4].strip()
currency = 'HKD' if '港币' in price_raw or '' in r[10] else 'CNY'
price_str = price_raw.replace('港币', '').replace('港元', '').replace('', '').strip()
price = float(price_str)
cost_price = float(clean_cell(r[5]))
pl = float(clean_cell(r[6]))
pl_pct = float(clean_cell(r[7])) if r[7].strip() else 0.0
mkt_val = float(clean_cell(r[11]))
cost_amount = float(clean_cell(r[15])) if r[15].strip() and r[15].strip() != '--' else 0
rate_str = clean_cell(r[16])
rate = float(rate_str) if rate_str and rate_str != '--' else 0.866
holdings.append({
'code': code,
'name': name,
'shares': shares,
'avail_shares': avail,
'price': price,
'cost_price': cost_price,
'pl': pl,
'pl_pct': pl_pct,
'currency': currency,
'market_val': mkt_val,
'cost_amount': cost_amount,
'exchange_rate': rate,
})
total_pl += pl
mv_cny = mkt_val if currency == 'CNY' else mkt_val * rate
total_mv_cny += mv_cny
pfx = 'HK$' if currency == 'HKD' else ''
print(f" {code} {name} {shares}{pfx}{price:.2f} 盈亏{pl:+,.0f}({pl_pct:+.1f}%)")
total_assets = total_mv_cny + CASH
position_pct = round(total_mv_cny / total_assets * 100, 1) if total_assets > 0 else 0
portfolio = {
'holdings': holdings,
'cash': CASH,
'total_market_value': round(total_mv_cny, 2),
'total_pl': round(total_pl, 2),
'position_pct': position_pct,
'updated_at': datetime.now().strftime('%Y-%m-%d %H:%M'),
'source': STOCKS_FILE,
}
with open(PORTFOLIO_PATH, 'w') as f:
json.dump(portfolio, f, indent=2, ensure_ascii=False)
print(f"\n已写入 {len(holdings)} 只持仓")
print(f"A股: {sum(1 for h in holdings if h['currency']=='CNY')} | 港股: {sum(1 for h in holdings if h['currency']=='HKD')}")
print(f"总市值: {round(total_mv_cny):,.0f}元 | 现金: {CASH:,}")
print(f"总资产: {round(total_assets):,.0f}元 | 仓位: {position_pct}%")
print(f"累计盈亏: {round(total_pl):+,}")
# 触发策略重评
print("\n→ 触发 per_stock_reassess 全量重评...")
r = subprocess.run(
["python3", "/home/hmo/.hermes/profiles/position-analyst/scripts/per_stock_reassess.py"],
capture_output=True, text=True, timeout=120
)
print(r.stdout[-500:] if len(r.stdout) > 500 else r.stdout)
# 重建决策树
print("\n→ 重建决策树...")
sys.path.insert(0, '/home/hmo/web-dashboard')
from strategy_tree import init_default_branches
with open('/home/hmo/web-dashboard/data/decisions.json') as f:
data = json.load(f)
ok = 0
for e in data.get('decisions', []):
branches = init_default_branches(
e.get('code', ''),
e.get('name', ''),
e.get('entry_low', 0),
e.get('entry_high', 0),
e.get('stop_loss', 0),
e.get('take_profit', 0),
)
e['strategy_tree'] = {
'branches': branches,
'created_at': datetime.now().strftime('%Y-%m-%d'),
}
ok += 1
with open('/home/hmo/web-dashboard/data/decisions.json', 'w') as f:
json.dump(data, f, indent=2, ensure_ascii=False)
print(f"决策树重建完成: {ok}/{len(data.get('decisions',[]))}")
if __name__ == '__main__':
main()
+4 -8
View File
@@ -307,22 +307,18 @@ def main():
except Exception:
pass
# 仓位计算:读取总资产和现金
# 仓位计算:从holding.xls导入的portfolio.json读取总资产和现金
n = len(actionable)
total_assets = 0
available_cash = 0
try:
with open("/home/hmo/web-dashboard/data/strategy_staleness_report.json") as f:
sr = json.load(f)
port = sr.get("portfolio", {})
available_cash = port.get("cash", 0) or 0
except Exception:
pass
try:
with open("/home/hmo/web-dashboard/data/portfolio.json") as f:
pf = json.load(f)
available_cash = pf.get("cash", 0) or 0
for h in pf.get("holdings", []):
mv = h.get("shares", 0) * h.get("price", 0)
if h.get("currency") == "HKD":
mv *= h.get("exchange_rate", 0.866)
total_assets += mv
total_assets += available_cash
except Exception: