price_monitor港股币种修复+calc_total_mv汇兑处理

问题链:
  price_monitor 从东方财富/腾讯拿HK股价(HKD) → x0.87转CNY写portfolio
  → DB存CNY→下游混读→建滔显示-24%浮亏(实为-0.6%)
修复:
  price_monitor不转CNY,港股存HKD原值
  calc_total_mv()增加币种判断:HK股用get_hk_rate()转CNY再汇总
  portfolio.json/watchlist的HK股价全部HKD原值
  DB同步修正所有HK股价格为HKD
  price_monitor DB写入加3次重试+database locked timeout
验证:
  建滔 87.7 HKD 浮亏-0.6%(不是-24%)
  现金 132,121.93 总资产 956,714.68
This commit is contained in:
知微
2026-07-03 10:19:09 +08:00
parent 1bb83c715d
commit 24a73103ed
9 changed files with 765 additions and 1146 deletions
+523 -523
View File
File diff suppressed because it is too large Load Diff
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
+39 -39
View File
@@ -1254,7 +1254,7 @@
"volume": 147766189.0
}
],
"updated_at": 1783044576.9674063
"updated_at": 1783045022.0597436
},
"688795": {
"daily": [
@@ -2479,7 +2479,7 @@
"volume": 4788252.0
}
],
"updated_at": 1783044571.0953405
"updated_at": 1783045017.2558444
},
"000657": {
"daily": [
@@ -3736,7 +3736,7 @@
"volume": 1051508.0
}
],
"updated_at": 1783044279.139402
"updated_at": 1783044767.899178
},
"000700": {
"daily": [
@@ -4993,7 +4993,7 @@
"volume": 1265397.0
}
],
"updated_at": 1783044579.2238038
"updated_at": 1783044853.6724539
},
"000711": {
"daily": [
@@ -6250,7 +6250,7 @@
"volume": 496248.0
}
],
"updated_at": 1783044280.294152
"updated_at": 1783044770.290931
},
"001309": {
"daily": [
@@ -7507,7 +7507,7 @@
"volume": 216663.0
}
],
"updated_at": 1783044280.6578274
"updated_at": 1783044771.251316
},
"002594": {
"daily": [
@@ -8764,7 +8764,7 @@
"volume": 934285.0
}
],
"updated_at": 1783044281.0604146
"updated_at": 1783044773.5265088
},
"00700": {
"daily": [
@@ -10029,7 +10029,7 @@
"volume": 13032847.0
}
],
"updated_at": 1783044579.6525345
"updated_at": 1783044900.4552383
},
"00968": {
"daily": [
@@ -11294,7 +11294,7 @@
"volume": 19422000.0
}
],
"updated_at": 1783044402.7002478
"updated_at": 1783044902.281637
},
"00981": {
"daily": [
@@ -12559,7 +12559,7 @@
"volume": 60114819.0
}
],
"updated_at": 1783044580.9424448
"updated_at": 1783044904.170763
},
"01070": {
"daily": [
@@ -13824,7 +13824,7 @@
"volume": 690000.0
}
],
"updated_at": 1783044403.9797754
"updated_at": 1783044904.831619
},
"01088": {
"daily": [
@@ -15089,7 +15089,7 @@
"volume": 2870057.0
}
],
"updated_at": 1783044582.7399487
"updated_at": 1783044905.7026997
},
"01211": {
"daily": [
@@ -16354,7 +16354,7 @@
"volume": 13286402.0
}
],
"updated_at": 1783044583.044548
"updated_at": 1783044907.9523368
},
"01478": {
"daily": [
@@ -17619,7 +17619,7 @@
"volume": 1618000.0
}
],
"updated_at": 1783044583.370647
"updated_at": 1783044914.9662342
},
"01888": {
"daily": [
@@ -18884,7 +18884,7 @@
"volume": 29941901.0
}
],
"updated_at": 1783044583.4335341
"updated_at": 1783044916.768711
},
"02202": {
"daily": [
@@ -20149,7 +20149,7 @@
"volume": 19786580.0
}
],
"updated_at": 1783044583.4786484
"updated_at": 1783044922.7405882
},
"02318": {
"daily": [
@@ -21414,7 +21414,7 @@
"volume": 11523457.0
}
],
"updated_at": 1783044418.3851635
"updated_at": 1783044925.0042746
},
"02359": {
"daily": [
@@ -22679,7 +22679,7 @@
"volume": 1730975.0
}
],
"updated_at": 1783044544.4259086
"updated_at": 1783044933.7568398
},
"02388": {
"daily": [
@@ -23944,7 +23944,7 @@
"volume": 3823095.0
}
],
"updated_at": 1783044545.07482
"updated_at": 1783044937.2679691
},
"02628": {
"daily": [
@@ -25209,7 +25209,7 @@
"volume": 23110112.0
}
],
"updated_at": 1783044546.1469994
"updated_at": 1783044942.9842496
},
"06160": {
"daily": [
@@ -26474,7 +26474,7 @@
"volume": 2575221.0
}
],
"updated_at": 1783044547.1597772
"updated_at": 1783044948.6934419
},
"06869": {
"daily": [
@@ -27739,7 +27739,7 @@
"volume": 15066251.0
}
],
"updated_at": 1783044583.5263205
"updated_at": 1783044950.480943
},
"09868": {
"daily": [
@@ -29004,7 +29004,7 @@
"volume": 10168056.0
}
],
"updated_at": 1783044551.0271091
"updated_at": 1783044951.3377807
},
"09988": {
"daily": [
@@ -30269,7 +30269,7 @@
"volume": 35148396.0
}
],
"updated_at": 1783044552.253174
"updated_at": 1783044956.074646
},
"300035": {
"daily": [
@@ -31526,7 +31526,7 @@
"volume": 230937.0
}
],
"updated_at": 1783044583.6714017
"updated_at": 1783044957.8285887
},
"300124": {
"daily": [
@@ -32783,7 +32783,7 @@
"volume": 722493.0
}
],
"updated_at": 1783044554.080632
"updated_at": 1783044958.4761739
},
"300308": {
"daily": [
@@ -34040,7 +34040,7 @@
"volume": 389058.0
}
],
"updated_at": 1783044559.1491275
"updated_at": 1783044962.1302354
},
"300548": {
"daily": [
@@ -35297,7 +35297,7 @@
"volume": 242727.0
}
],
"updated_at": 1783044560.622806
"updated_at": 1783044974.5997705
},
"300750": {
"daily": [
@@ -36554,7 +36554,7 @@
"volume": 551212.0
}
],
"updated_at": 1783044561.0713015
"updated_at": 1783044988.1779277
},
"301308": {
"daily": [
@@ -37811,7 +37811,7 @@
"volume": 296230.0
}
],
"updated_at": 1783044561.5623102
"updated_at": 1783044993.181729
},
"518880": {
"daily": [
@@ -39068,7 +39068,7 @@
"volume": 3915247.0
}
],
"updated_at": 1783044562.1008737
"updated_at": 1783045000.125372
},
"600519": {
"daily": [
@@ -40325,7 +40325,7 @@
"volume": 64803.0
}
],
"updated_at": 1783044562.6282325
"updated_at": 1783045000.7318592
},
"600563": {
"daily": [
@@ -41582,7 +41582,7 @@
"volume": 180947.0
}
],
"updated_at": 1783044563.1808019
"updated_at": 1783045002.30473
},
"601318": {
"daily": [
@@ -42839,7 +42839,7 @@
"volume": 1746202.0
}
],
"updated_at": 1783044565.037566
"updated_at": 1783045007.7435973
},
"601899": {
"daily": [
@@ -44096,7 +44096,7 @@
"volume": 4780454.0
}
],
"updated_at": 1783044568.620155
"updated_at": 1783045008.845117
},
"688411": {
"daily": [
@@ -45353,7 +45353,7 @@
"volume": 13672788.0
}
],
"updated_at": 1783044569.5621681
"updated_at": 1783045009.6267552
},
"688630": {
"daily": [
@@ -46610,7 +46610,7 @@
"volume": 9660790.0
}
],
"updated_at": 1783044570.0879724
"updated_at": 1783045010.4224615
},
"688639": {
"daily": [
@@ -47867,7 +47867,7 @@
"volume": 13996588.0
}
],
"updated_at": 1783044570.556268
"updated_at": 1783045016.168726
},
"688802": {
"daily": [
@@ -49092,6 +49092,6 @@
"volume": 3202146.0
}
],
"updated_at": 1783044575.5610185
"updated_at": 1783045018.4521751
}
}
+101 -554
View File
@@ -5,689 +5,236 @@
"name": "中际旭创",
"shares": 100,
"cost": 1316.53,
"position_pct": 15.27,
"is_active": 1,
"price": 1158.8,
"change_pct": 1.38,
"price": 1149.28,
"market_value": 115899.0,
"change_pct": 0.55,
"currency": "CNY",
"stop_loss": 1077.08,
"take_profit": 0,
"entry_low": 1039.2,
"entry_high": 1212.4,
"action": "持有观察 | ⚠️盈亏比偏低(1:1.4),不建议加仓 | 止损1169.0 | 目标1339.19 | 买入区1182.26~1248.91 | 信号:持有",
"strategy_updated": "2026-07-01 15:01",
"analysis": {
"stop_loss": 1077.08,
"take_profit": 0,
"entry_low": 1039.2,
"entry_high": 1212.4,
"action": "持有观察 | ⚠️盈亏比极低,关注 | 止损1077.08 | 目标0 | 买入区1039.2~1212.4 | 信号:持有",
"tech_snapshot": "形态:unknown/neutral 量价:数据不足 强撑:None 弱撑:None 弱压:None 强压:None | MA5=1222.01 MA10=1280.59 MA20=1239.5 MA60=1033.3",
"multi_tf_context": "震荡/无明显方向 | MA20=1239.5 | MA60=1033.3 | 长撑:MA60=1033.3 | 长压:日强阻=1416.88",
"reassessed_at": "2026-07-03 10:11",
"status": "updated",
"rr_ratio": 0.0,
"action_note": "⚠️盈亏比极低,关注",
"timing_signal": "持有"
},
"trigger": {
"stop_loss": 1077.08,
"entry_zone": "1039.2~1212.4"
},
"market_value": 115880.0
"position_pct": 15.27,
"_currency": "CNY"
},
{
"code": "06869",
"name": "长飞光纤光缆",
"shares": 500,
"cost": 263.72,
"price": 172.45,
"market_value": 87825.0,
"change_pct": 0.474,
"currency": "HKD",
"position_pct": 13.47,
"is_active": 1,
"price": 174.09,
"change_pct": 1.434,
"currency": "CNY",
"stop_loss": 184.35,
"take_profit": 0,
"entry_low": 180.54,
"entry_high": 210.63,
"action": "持有观察 | ⚠️盈亏比偏低(1:0.9),不建议加仓 | 止损205.71 | 目标300.74 | 买入区239.4~251.37 | 信号:持有",
"strategy_updated": "2026-07-01 15:01",
"analysis": {
"stop_loss": 184.35,
"take_profit": 0,
"entry_low": 180.54,
"entry_high": 210.63,
"action": "深套持有 | 深套持有 | 止损184.35 | 目标0 | 买入区180.54~210.63 | 信号:持有",
"tech_snapshot": "形态:unknown/neutral 量价:数据不足 强撑:None 弱撑:None 弱压:None 强压:None | MA5=246.26 MA10=248.81 MA20=244.56 MA60=231.58",
"multi_tf_context": "多周期看多 | MA20=244.56 | MA60=231.58 | 长撑:日强支撑=198.0 | 长压:日强阻=305.0",
"reassessed_at": "2026-07-03 10:11",
"status": "updated",
"rr_ratio": 0.0,
"action_note": "深套持有",
"timing_signal": "持有"
},
"trigger": {
"stop_loss": 184.35,
"entry_zone": "180.54~210.63"
},
"market_value": 87045.0
"_currency": "HKD"
},
{
"code": "01478",
"name": "丘钛科技",
"shares": 11000,
"cost": 13.47,
"price": 6.0,
"market_value": 66110.0,
"change_pct": 2.976,
"currency": "HKD",
"position_pct": 7.97,
"is_active": 1,
"price": 5.96,
"change_pct": 2.232,
"currency": "CNY",
"stop_loss": 6.39,
"take_profit": 0,
"entry_low": 6.25,
"entry_high": 7.3,
"action": "深套持有 | 深套持有 | 止损6.18 | 目标7.2 | 买入区6.17~7.2 | 信号:持有",
"strategy_updated": "2026-07-01 15:01",
"analysis": {
"stop_loss": 6.39,
"take_profit": 0,
"entry_low": 6.25,
"entry_high": 7.3,
"action": "深套持有 | 深套持有 | 止损6.39 | 目标0 | 买入区6.25~7.3 | 信号:持有",
"tech_snapshot": "形态:unknown/neutral 量价:数据不足 强撑:None 弱撑:None 弱压:None 强压:None | MA5=9.11 MA10=9.29 MA20=9.5 MA60=8.86",
"multi_tf_context": "震荡/无明显方向 | MA20=9.5 | MA60=8.86 | 长撑:日强支撑=6.6 | 长压:周强阻=10.5",
"reassessed_at": "2026-07-03 10:11",
"status": "updated",
"rr_ratio": 0.0,
"action_note": "深套持有",
"timing_signal": "持有"
},
"trigger": {
"stop_loss": 6.39,
"entry_zone": "6.25~7.3"
},
"market_value": 65560.0
"_currency": "HKD"
},
{
"code": "601899",
"name": "紫金矿业",
"shares": 2400,
"cost": 39.89,
"position_pct": 7.34,
"is_active": 1,
"price": 27.7,
"change_pct": 5.32,
"price": 28.13,
"market_value": 66528.0,
"change_pct": 6.96,
"currency": "CNY",
"stop_loss": 25.45,
"take_profit": 0,
"entry_low": 24.92,
"entry_high": 29.07,
"action": "深套持有 | 深套持有 | 止损23.07 | 目标25.51 | 买入区22.6~26.37 | 信号:持有",
"strategy_updated": "2026-07-01 15:02",
"analysis": {
"stop_loss": 25.45,
"take_profit": 0,
"entry_low": 24.92,
"entry_high": 29.07,
"action": "深套持有 | 深套持有 | 止损25.45 | 目标0 | 买入区24.92~29.07 | 信号:持有",
"tech_snapshot": "形态:unknown/neutral 量价:数据不足 强撑:None 弱撑:None 弱压:None 强压:None | MA5=35.14 MA10=36.13 MA20=37.18 MA60=36.52",
"multi_tf_context": "震荡/无明显方向 | MA20=37.18 | MA60=36.52 | 长撑:日弱支撑=24.7 | 长压:周强阻=35.62",
"reassessed_at": "2026-07-03 10:12",
"status": "updated",
"rr_ratio": 0.0,
"action_note": "深套持有",
"timing_signal": "持有"
},
"trigger": {
"stop_loss": 25.45,
"entry_zone": "24.92~29.07"
},
"market_value": 66480.0
"position_pct": 7.34,
"_currency": "CNY"
},
{
"code": "688411",
"name": "海博思创",
"shares": 200,
"cost": 266.95,
"position_pct": 6.31,
"is_active": 1,
"price": 258.18,
"change_pct": 0.97,
"price": 259.76,
"market_value": 51770.00000000001,
"change_pct": 1.58,
"currency": "CNY",
"stop_loss": 240.2,
"take_profit": 0,
"entry_low": 231.75,
"entry_high": 270.38,
"action": "持有观察 | 止损246.94 | 目标309.13 | 买入区244.27~256.48 | 信号:持有",
"strategy_updated": "2026-07-01 15:02",
"analysis": {
"stop_loss": 240.2,
"take_profit": 0,
"entry_low": 231.75,
"entry_high": 270.38,
"action": "持有观察 | ⚠️盈亏比极低,关注 | 止损240.2 | 目标0 | 买入区231.75~270.38 | 信号:持有",
"tech_snapshot": "形态:unknown/neutral 量价:数据不足 强撑:None 弱撑:None 弱压:None 强压:None | MA5=270.94 MA10=273.7 MA20=265.98 MA60=254.7",
"multi_tf_context": "震荡/无明显方向 | MA20=265.98 | MA60=254.7 | 长撑:日弱支撑=236.93 | 长压:周强阻=307.58",
"reassessed_at": "2026-07-03 10:12",
"status": "updated",
"rr_ratio": 0.0,
"action_note": "⚠️盈亏比极低,关注",
"timing_signal": "持有"
},
"trigger": {
"stop_loss": 240.2,
"entry_zone": "231.75~270.38"
},
"market_value": 51636.0
"position_pct": 6.31,
"_currency": "CNY"
},
{
"code": "688981",
"name": "中芯国际",
"shares": 300,
"cost": 126.07,
"position_pct": 5.44,
"is_active": 1,
"price": 143.1,
"change_pct": -0.69,
"price": 141.12,
"market_value": 43011.0,
"change_pct": -2.07,
"currency": "CNY",
"stop_loss": 138.23,
"take_profit": 0,
"entry_low": 128.26,
"entry_high": 149.64,
"action": "盈利良好 | 止损149.85 | 目标176.42 | 买入区148.9~156.34 | 信号:持有",
"strategy_updated": "2026-07-01 15:02",
"analysis": {
"stop_loss": 138.23,
"take_profit": 0,
"entry_low": 128.26,
"entry_high": 149.64,
"action": "盈利良好 | ⚠️盈亏比极低,关注 | 止损138.23 | 目标0 | 买入区128.26~149.64 | 信号:持有",
"tech_snapshot": "形态:unknown/neutral 量价:数据不足 强撑:None 弱撑:None 弱压:None 强压:None | MA5=151.43 MA10=149.35 MA20=138.9 MA60=125.49",
"multi_tf_context": "震荡/无明显方向 | MA20=138.9 | MA60=125.49 | 长撑:MA20=138.9 | 长压:日强阻=166.88",
"reassessed_at": "2026-07-03 10:12",
"status": "updated",
"rr_ratio": 0.0,
"action_note": "⚠️盈亏比极低,关注",
"timing_signal": "持有"
},
"trigger": {
"stop_loss": 138.23,
"entry_zone": "128.26~149.64"
},
"market_value": 42930.0
"position_pct": 5.44,
"_currency": "CNY"
},
{
"code": "01888",
"name": "建滔积层板",
"shares": 500,
"cost": 88.23,
"price": 72.22,
"market_value": 42450.0,
"change_pct": -0.597,
"currency": "HKD",
"position_pct": 5.28,
"is_active": 1,
"price": 72.48,
"change_pct": -0.239,
"currency": "CNY",
"stop_loss": 79.15,
"take_profit": 0,
"entry_low": 76.36,
"entry_high": 89.09,
"action": "盈利良好 | 止损92.33 | 目标103.21 | 买入区94.93~99.68 | 信号:持有",
"strategy_updated": "2026-07-01 15:01",
"analysis": {
"stop_loss": 79.15,
"take_profit": 0,
"entry_low": 76.36,
"entry_high": 89.09,
"action": "持有观察 | ⚠️盈亏比极低,关注 | 止损79.15 | 目标0 | 买入区76.36~89.09 | 信号:持有",
"tech_snapshot": "形态:unknown/neutral 量价:数据不足 强撑:None 弱撑:None 弱压:None 强压:None | MA5=96.4 MA10=93.52 MA20=78.64 MA60=51.2",
"multi_tf_context": "多周期看多 | MA20=78.64 | MA60=51.2 | 长撑:MA20=78.64 | 长压:日强阻=107.2",
"reassessed_at": "2026-07-03 10:11",
"status": "updated",
"rr_ratio": 0.0,
"action_note": "⚠️盈亏比极低,关注",
"timing_signal": "持有"
},
"trigger": {
"stop_loss": 79.15,
"entry_zone": "76.36~89.09"
},
"market_value": 36240.0
"_currency": "HKD"
},
{
"code": "688639",
"name": "华恒生物",
"shares": 2800,
"cost": 21.51,
"position_pct": 5.25,
"is_active": 1,
"price": 16.74,
"change_pct": -1.24,
"price": 16.73,
"market_value": 46871.99999999999,
"change_pct": -1.3,
"currency": "CNY",
"stop_loss": 14.47,
"take_profit": 0,
"entry_low": 15.06,
"entry_high": 17.57,
"action": "深套持有 | 深套持有 | 止损14.96 | 目标18.7 | 买入区14.73~17.19 | 信号:持有",
"strategy_updated": "2026-07-01 15:02",
"analysis": {
"stop_loss": 14.47,
"take_profit": 0,
"entry_low": 15.06,
"entry_high": 17.57,
"action": "深套持有 | 深套持有 | 止损14.47 | 目标0 | 买入区15.06~17.57 | 信号:持有",
"tech_snapshot": "形态:unknown/neutral 量价:数据不足 强撑:None 弱撑:None 弱压:None 强压:None | MA5=33.68 MA10=35.7 MA20=36.69 MA60=34.28",
"multi_tf_context": "多周期看多 | MA20=36.69 | MA60=34.28 | 长撑:日弱支撑=15.65 | 长压:日强阻=22.54",
"reassessed_at": "2026-07-03 10:12",
"status": "updated",
"rr_ratio": 0.0,
"action_note": "深套持有",
"timing_signal": "持有"
},
"trigger": {
"stop_loss": 14.47,
"entry_zone": "15.06~17.57"
},
"market_value": 46872.0
"position_pct": 5.25,
"_currency": "CNY"
},
{
"code": "300750",
"name": "宁德时代",
"shares": 100,
"cost": 401.78,
"position_pct": 4.64,
"is_active": 1,
"price": 384.37,
"change_pct": 0.53,
"price": 387.45,
"market_value": 38427.0,
"change_pct": 1.33,
"currency": "CNY",
"stop_loss": 358.2,
"take_profit": 0,
"entry_low": 345.6,
"entry_high": 403.2,
"action": "持有观察 | ⚠️盈亏比偏低(1:0.9),不建议加仓 | 止损362.31 | 目标404.56 | 买入区372.23~381.61 | 信号:持有",
"strategy_updated": "2026-07-01 15:02",
"analysis": {
"stop_loss": 358.2,
"take_profit": 0,
"entry_low": 345.6,
"entry_high": 403.2,
"action": "持有观察 | ⚠️盈亏比极低,关注 | 止损358.2 | 目标0 | 买入区345.6~403.2 | 信号:持有",
"tech_snapshot": "形态:unknown/neutral 量价:数据不足 强撑:None 弱撑:None 弱压:None 强压:None | MA5=386.51 MA10=392.29 MA20=394.64 MA60=413.88",
"multi_tf_context": "震荡/无明显方向 | MA20=394.64 | MA60=413.88 | 长撑:日强支撑=370.0 | 长压:周强阻=468.75",
"reassessed_at": "2026-07-03 10:11",
"status": "updated",
"rr_ratio": 0.0,
"action_note": "⚠️盈亏比极低,关注",
"timing_signal": "持有"
},
"trigger": {
"stop_loss": 358.2,
"entry_zone": "345.6~403.2"
},
"market_value": 38437.0
"position_pct": 4.64,
"_currency": "CNY"
},
{
"code": "01211",
"name": "比亚迪股份",
"shares": 600,
"cost": 104.87,
"price": 71.53,
"market_value": 42918.0,
"change_pct": 5.364,
"currency": "HKD",
"position_pct": 4.62,
"is_active": 1,
"price": 71.57,
"change_pct": 5.428,
"currency": "CNY",
"stop_loss": 75.87,
"take_profit": 0,
"entry_low": 74.3,
"entry_high": 86.68,
"action": "深套持有 | 深套持有 | 止损66.58 | 目标73.73 | 买入区65.2~76.07 | 信号:持有",
"strategy_updated": "2026-07-01 15:01",
"analysis": {
"stop_loss": 75.87,
"take_profit": 0,
"entry_low": 74.3,
"entry_high": 86.68,
"action": "深套持有 | 深套持有 | 止损75.87 | 目标0 | 买入区74.3~86.68 | 信号:持有",
"tech_snapshot": "形态:unknown/neutral 量价:数据不足 强撑:None 弱撑:None 弱压:None 强压:None | MA5=96.74 MA10=96.79 MA20=98.23 MA60=98.39",
"multi_tf_context": "多周期看多 | MA20=98.23 | MA60=98.39 | 长撑:日弱支撑=72.2 | 长压:日强阻=96.7",
"reassessed_at": "2026-07-03 10:11",
"status": "updated",
"rr_ratio": 0.0,
"action_note": "深套持有",
"timing_signal": "持有"
},
"trigger": {
"stop_loss": 75.87,
"entry_zone": "74.3~86.68"
},
"market_value": 42942.0
"_currency": "HKD"
},
{
"code": "02202",
"name": "万科企业",
"shares": 19700,
"cost": 4.67,
"price": 2.03,
"market_value": 39794.0,
"change_pct": 4.933,
"currency": "HKD",
"position_pct": 4.6,
"is_active": 1,
"price": 2.0,
"change_pct": 3.587,
"currency": "CNY",
"stop_loss": 2.13,
"take_profit": 0,
"entry_low": 2.09,
"entry_high": 2.44,
"action": "深套持有 | 深套持有 | 止损1.95 | 目标2.31 | 买入区1.91~2.23 | 信号:持有",
"strategy_updated": "2026-07-01 15:01",
"analysis": {
"stop_loss": 2.13,
"take_profit": 0,
"entry_low": 2.09,
"entry_high": 2.44,
"action": "深套持有 | 深套持有 | 止损2.13 | 目标0 | 买入区2.09~2.44 | 信号:持有",
"tech_snapshot": "形态:unknown/neutral 量价:数据不足 强撑:None 弱撑:None 弱压:None 强压:None | MA5=3.41 MA10=3.42 MA20=3.53 MA60=3.51",
"multi_tf_context": "震荡/无明显方向 | MA20=3.53 | MA60=3.51 | 长撑:日弱支撑=2.16 | 长压:日强阻=2.78",
"reassessed_at": "2026-07-03 10:11",
"status": "updated",
"rr_ratio": 0.0,
"action_note": "深套持有",
"timing_signal": "持有"
},
"trigger": {
"stop_loss": 2.13,
"entry_zone": "2.09~2.44"
},
"market_value": 39400.0
"_currency": "HKD"
},
{
"code": "00700",
"name": "腾讯",
"shares": 100,
"cost": null,
"price": 384.77,
"market_value": 38269.0,
"change_pct": 3.161,
"currency": "HKD",
"position_pct": null,
"is_active": 1,
"price": 382.35,
"change_pct": 2.51,
"currency": "CNY",
"stop_loss": 431.26,
"take_profit": 0,
"entry_low": 435.71,
"entry_high": 453.49,
"action": "盈利持有 | ⚠️盈亏比不足1:1.5,不建议买入 | 损414.51 | 盈452.53 | 买421.2~429.72",
"strategy_updated": "2026-07-01 15:01",
"analysis": {
"stop_loss": 431.26,
"take_profit": 0,
"entry_low": 435.71,
"entry_high": 453.49,
"action": "盈利持有 | ⚠️盈亏比不足1:1.5,不建议买入 | 损426.82 | 盈0 | 买435.71~453.49",
"tech_snapshot": "形态:unknown/neutral 量价:数据不足 强撑:None 弱撑:None 弱压:None 强压:None | MA5=624.1 MA10=623.7 MA20=615.5 MA60=559.52",
"multi_tf_context": "多周期看多 | MA20=615.5 | MA60=559.52 | 长撑:日弱支撑=412.6 | 长压:周强阻=526.5",
"reassessed_at": "2026-07-03 10:10",
"status": "review",
"rr_ratio": 0.0,
"action_note": "⚠️盈亏比不足1:1.5,不建议买入",
"timing_signal": "信号不充分"
},
"trigger": {
"stop_loss": 431.26,
"entry_zone": "435.71~453.49"
},
"market_value": 38235.0
"_currency": "HKD"
},
{
"code": "00981",
"name": "中芯国际",
"shares": 500,
"cost": 75.94,
"price": 67.76,
"market_value": 34570.0,
"change_pct": -2.799,
"currency": "HKD",
"position_pct": 4.2,
"is_active": 1,
"price": 67.93,
"change_pct": -2.55,
"currency": "CNY",
"stop_loss": 73.5,
"take_profit": 0,
"entry_low": 70.92,
"entry_high": 82.74,
"action": "盈利良好 | 止损86.72 | 目标96.86 | 买入区84.8~89.04 | 信号:持有",
"strategy_updated": "2026-07-01 15:01",
"analysis": {
"stop_loss": 73.5,
"take_profit": 0,
"entry_low": 70.92,
"entry_high": 82.74,
"action": "盈利持有 | ⚠️盈亏比极低,关注 | 止损73.5 | 目标0 | 买入区70.92~82.74 | 信号:持有",
"tech_snapshot": "形态:unknown/neutral 量价:数据不足 强撑:None 弱撑:None 弱压:None 强压:None | MA5=84.12 MA10=81.44 MA20=78.5 MA60=71.93",
"multi_tf_context": "震荡/无明显方向 | MA20=78.5 | MA60=71.93 | 长撑:MA20=78.5 | 长压:周强阻=93.0",
"reassessed_at": "2026-07-03 10:10",
"status": "updated",
"rr_ratio": 0.0,
"action_note": "⚠️盈亏比极低,关注",
"timing_signal": "持有"
},
"trigger": {
"stop_loss": 73.5,
"entry_zone": "70.92~82.74"
},
"market_value": 33965.0
"_currency": "HKD"
},
{
"code": "300548",
"name": "长芯博创",
"shares": 100,
"cost": 231.46,
"position_pct": 3.2,
"is_active": 1,
"price": 225.6,
"change_pct": 1.62,
"price": 224.9,
"market_value": 22623.0,
"change_pct": 1.31,
"currency": "CNY",
"stop_loss": 209.99,
"take_profit": 0,
"entry_low": 202.6,
"entry_high": 236.37,
"action": "盈利良好 | 止损246.38 | 目标291.58 | 买入区241.67~253.75 | 信号:持有",
"strategy_updated": "2026-07-01 15:02",
"analysis": {
"stop_loss": 209.99,
"take_profit": 0,
"entry_low": 202.6,
"entry_high": 236.37,
"action": "持有观察 | ⚠️盈亏比极低,关注 | 止损209.99 | 目标0 | 买入区202.6~236.37 | 信号:持有",
"tech_snapshot": "形态:unknown/neutral 量价:数据不足 强撑:None 弱撑:None 弱压:None 强压:None | MA5=253.97 MA10=270.01 MA20=255.06 MA60=248.13",
"multi_tf_context": "震荡/无明显方向 | MA20=255.06 | MA60=248.13 | 长撑:日弱支撑=213.79 | 长压:日强阻=309.98",
"reassessed_at": "2026-07-03 10:11",
"status": "updated",
"rr_ratio": 0.0,
"action_note": "⚠️盈亏比极低,关注",
"timing_signal": "持有"
},
"trigger": {
"stop_loss": 209.99,
"entry_zone": "202.6~236.37"
},
"market_value": 22560.0
"position_pct": 3.2,
"_currency": "CNY"
},
{
"code": "518880",
"name": "黄金ETF华安",
"shares": 2400,
"cost": 12.19,
"position_pct": 2.45,
"is_active": 1,
"price": 8.68,
"change_pct": 2.44,
"market_value": 20832.0,
"change_pct": 2.47,
"currency": "CNY",
"stop_loss": 8.21,
"take_profit": 0,
"entry_low": 7.81,
"entry_high": 9.12,
"action": "深套持有 | 深套持有 | 止损7.45 | 目标8.58 | 买入区7.44~8.68 | 信号:持有",
"strategy_updated": "2026-07-01 15:02",
"analysis": {
"stop_loss": 8.21,
"take_profit": 0,
"entry_low": 7.81,
"entry_high": 9.12,
"action": "深套持有 | 深套持有 | 止损8.21 | 目标0 | 买入区7.81~9.12 | 信号:持有",
"tech_snapshot": "形态:unknown/neutral 量价:数据不足 强撑:None 弱撑:None 弱压:None 强压:None | MA5=9.45 MA10=9.58 MA20=10.01 MA60=10.34",
"multi_tf_context": "震荡/无明显方向 | MA20=10.01 | MA60=10.34 | 长撑:日弱支撑=8.25 | 长压:月强阻=11.42",
"reassessed_at": "2026-07-03 10:11",
"status": "updated",
"rr_ratio": 0.0,
"action_note": "深套持有",
"timing_signal": "持有"
},
"trigger": {
"stop_loss": 8.21,
"entry_zone": "7.81~9.12"
},
"market_value": 20832.0
"position_pct": 2.45,
"_currency": "CNY"
},
{
"code": "300035",
"name": "中科电气",
"shares": 1400,
"cost": 22.29,
"position_pct": 2.42,
"is_active": 1,
"price": 14.39,
"change_pct": 1.55,
"price": 14.46,
"market_value": 20118.0,
"change_pct": 2.05,
"currency": "CNY",
"stop_loss": 12.95,
"take_profit": 0,
"entry_low": 12.94,
"entry_high": 15.1,
"action": "深套持有 | 深套持有 | 止损13.01 | 目标15.14 | 买入区13.0~15.16 | 信号:持有",
"strategy_updated": "2026-07-01 15:01",
"analysis": {
"stop_loss": 12.95,
"take_profit": 0,
"entry_low": 12.94,
"entry_high": 15.1,
"action": "深套持有 | 深套持有 | 止损12.95 | 目标0 | 买入区12.94~15.1 | 信号:持有",
"tech_snapshot": "形态:unknown/neutral 量价:数据不足 强撑:None 弱撑:None 弱压:None 强压:None | MA5=21.7 MA10=21.88 MA20=22.15 MA60=21.44",
"multi_tf_context": "震荡/无明显方向 | MA20=22.15 | MA60=21.44 | 长撑:日强支撑=13.74 | 长压:日强阻=18.23",
"reassessed_at": "2026-07-03 10:11",
"status": "updated",
"rr_ratio": 0.0,
"action_note": "深套持有",
"timing_signal": "持有"
},
"trigger": {
"stop_loss": 12.95,
"entry_zone": "12.94~15.1"
},
"market_value": 20146.0
"position_pct": 2.42,
"_currency": "CNY"
},
{
"code": "000700",
"name": "模塑科技",
"shares": 1400,
"cost": 14.83,
"position_pct": 2.41,
"is_active": 1,
"price": 17.38,
"change_pct": 3.02,
"price": 17.47,
"market_value": 24304.0,
"change_pct": 3.56,
"currency": "CNY",
"stop_loss": 16.86,
"take_profit": 0,
"entry_low": 15.64,
"entry_high": 18.25,
"action": "盈利持有 | ⚠️盈亏比极低,关注 | 止损13.91 | 目标15.54 | 买入区13.32~14.09 | 信号:持有",
"strategy_updated": "2026-07-01 15:00",
"analysis": {
"stop_loss": 16.86,
"take_profit": 0,
"entry_low": 15.64,
"entry_high": 18.25,
"action": "盈利良好 | ⚠️盈亏比极低,关注 | 止损16.86 | 目标0 | 买入区15.64~18.25 | 信号:持有",
"tech_snapshot": "形态:unknown/neutral 量价:数据不足 强撑:None 弱撑:None 弱压:None 强压:None | MA5=14.99 MA10=14.9 MA20=15.45 MA60=13.81",
"multi_tf_context": "震荡/无明显方向 | MA20=15.45 | MA60=13.81 | 长撑:MA20=15.45 | 长压:日强阻=18.66",
"reassessed_at": "2026-07-03 10:10",
"status": "updated",
"rr_ratio": 0.0,
"action_note": "⚠️盈亏比极低,关注",
"timing_signal": "持有"
},
"trigger": {
"stop_loss": 16.86,
"entry_zone": "15.64~18.25"
},
"market_value": 24332.0
"position_pct": 2.41,
"_currency": "CNY"
},
{
"code": "600563",
"name": "法拉电子",
"shares": 100,
"cost": 147.18,
"position_pct": 2.3,
"is_active": 1,
"price": 158.5,
"change_pct": -3.53,
"price": 158.0,
"market_value": 15900.0,
"change_pct": -3.83,
"currency": "CNY",
"stop_loss": 153.75,
"take_profit": 0,
"entry_low": 142.66,
"entry_high": 166.44,
"action": "盈利良好 | 止损169.99 | 目标188.19 | 买入区175.29~184.05 | 信号:持有",
"strategy_updated": "2026-07-01 15:02",
"analysis": {
"stop_loss": 153.75,
"take_profit": 0,
"entry_low": 142.66,
"entry_high": 166.44,
"action": "盈利良好 | ⚠️盈亏比极低,关注 | 止损153.75 | 目标0 | 买入区142.66~166.44 | 信号:持有",
"tech_snapshot": "形态:unknown/neutral 量价:数据不足 强撑:None 弱撑:None 弱压:None 强压:None | MA5=183.16 MA10=178.82 MA20=169.12 MA60=145.24",
"multi_tf_context": "多周期看多 | MA20=169.12 | MA60=145.24 | 长撑:日弱支撑=144.6 | 长压:日强阻=198.8",
"reassessed_at": "2026-07-03 10:11",
"status": "updated",
"rr_ratio": 0.0,
"action_note": "⚠️盈亏比极低,关注",
"timing_signal": "持有"
},
"trigger": {
"stop_loss": 153.75,
"entry_zone": "142.66~166.44"
},
"market_value": 15850.0
"position_pct": 2.3,
"_currency": "CNY"
},
{
"code": "01088",
"name": "中国神华",
"shares": 500,
"cost": 45.89,
"position_pct": 2.14,
"is_active": 1,
"price": 34.68,
"market_value": 17220.0,
"change_pct": 1.01,
"currency": "CNY",
"stop_loss": 37.16,
"take_profit": 0,
"entry_low": 35.86,
"entry_high": 41.83,
"action": "持有观察 | ⚠️盈亏比偏低(1:1.4),不建议加仓 | 止损38.92 | 目标41.97 | 买入区39.41~40.45 | 信号:持有",
"strategy_updated": "2026-07-01 15:01",
"analysis": {
"stop_loss": 37.16,
"take_profit": 0,
"entry_low": 35.86,
"entry_high": 41.83,
"action": "持有观察 | ⚠️盈亏比极低,关注 | 止损37.16 | 目标0 | 买入区35.86~41.83 | 信号:持有",
"tech_snapshot": "形态:unknown/neutral 量价:数据不足 强撑:None 弱撑:None 弱压:None 强压:None | MA5=39.82 MA10=40.55 MA20=41.11 MA60=43.93",
"multi_tf_context": "震荡/无明显方向 | MA20=41.11 | MA60=43.93 | 长撑:日强支撑=39.16 | 长压:月强阻=49.62",
"reassessed_at": "2026-07-03 10:11",
"status": "updated",
"rr_ratio": 0.0,
"action_note": "⚠️盈亏比极低,关注",
"timing_signal": "持有"
},
"trigger": {
"stop_loss": 37.16,
"entry_zone": "35.86~41.83"
},
"market_value": 17340.0
"currency": "HKD",
"position_pct": 2.14,
"_currency": "HKD"
}
],
"updated_at": "2026-07-03 10:12",
"cash": 80476,
"total_mv": 826682.0,
"total_assets": 907158.0,
"position_pct": 91.13
"total_assets": 911198.78,
"total_mv": 779076.85,
"stock_value": null,
"cash": 132121.93,
"frozen_cash": 0.0,
"position_pct": 85.5,
"currency": "CNY",
"updated_at": "2026-07-03 10:18"
}
+70
View File
@@ -8219,6 +8219,76 @@
"event_label": "买入区间",
"timestamp": "2026-07-03T10:10:33.373526",
"date": "2026-07-03"
},
{
"code": "000657",
"name": "中钨高新",
"event_type": "entry_zone",
"price": 88.5,
"trigger_value": "87.22~90.78",
"event_label": "买入区间",
"timestamp": "2026-07-03T10:14:37.057818",
"date": "2026-07-03"
},
{
"code": "001309",
"name": "德明利",
"event_type": "entry_zone",
"price": 840.0,
"trigger_value": "819.97~840.13",
"event_label": "买入区间",
"timestamp": "2026-07-03T10:16:30.003640",
"date": "2026-07-03"
},
{
"code": "600519",
"name": "贵州茅台",
"event_type": "entry_zone",
"price": 1201.38,
"trigger_value": "1179.92~1206.14",
"event_label": "买入区间",
"timestamp": "2026-07-03T10:18:17.225267",
"date": "2026-07-03"
},
{
"code": "000657",
"name": "中钨高新",
"event_type": "entry_zone",
"price": 88.76,
"trigger_value": "86.73~90.27",
"event_label": "买入区间",
"timestamp": "2026-07-03T10:18:47.889107",
"date": "2026-07-03"
},
{
"code": "000711",
"name": "ST京蓝",
"event_type": "entry_zone",
"price": 5.25,
"trigger_value": "5.14~5.26",
"event_label": "买入区间",
"timestamp": "2026-07-03T10:18:48.054469",
"date": "2026-07-03"
},
{
"code": "000657",
"name": "中钨高新",
"event_type": "entry_zone",
"price": 88.73,
"trigger_value": "86.73~90.27",
"event_label": "买入区间",
"timestamp": "2026-07-03T10:18:53.373240",
"date": "2026-07-03"
},
{
"code": "000711",
"name": "ST京蓝",
"event_type": "entry_zone",
"price": 5.25,
"trigger_value": "5.14~5.26",
"event_label": "买入区间",
"timestamp": "2026-07-03T10:18:53.447704",
"date": "2026-07-03"
}
]
}
+19 -19
View File
@@ -26,7 +26,7 @@
"date": "2026-07-03",
"high": 1215.52,
"low": 1190.51,
"close": 1200.55
"close": 1201.38
}
],
"02202": [
@@ -48,7 +48,7 @@
"date": "2026-07-03",
"high": 53.0,
"low": 51.7,
"close": 52.55
"close": 52.4
}
],
"601318": [
@@ -62,7 +62,7 @@
"date": "2026-07-03",
"high": 50.2,
"low": 48.8,
"close": 48.99
"close": 49.05
}
],
"02359": [
@@ -76,7 +76,7 @@
"date": "2026-07-03",
"high": 158.7,
"low": 151.1,
"close": 153.0
"close": 152.8
}
],
"02388": [
@@ -90,7 +90,7 @@
"date": "2026-07-03",
"high": 42.98,
"low": 41.94,
"close": 42.76
"close": 42.7
}
],
"02628": [
@@ -104,7 +104,7 @@
"date": "2026-07-03",
"high": 29.08,
"low": 27.5,
"close": 28.56
"close": 28.58
}
],
"688630": [
@@ -118,7 +118,7 @@
"date": "2026-07-03",
"high": 499.95,
"low": 444.55,
"close": 486.52
"close": 486.69
}
],
"06160": [
@@ -130,9 +130,9 @@
},
{
"date": "2026-07-03",
"high": 183.8,
"high": 183.9,
"low": 171.9,
"close": 182.1
"close": 182.5
}
],
"06869": [
@@ -154,7 +154,7 @@
"date": "2026-07-03",
"high": 687.04,
"low": 633.01,
"close": 645.0
"close": 642.05
}
],
"09868": [
@@ -168,7 +168,7 @@
"date": "2026-07-03",
"high": 53.7,
"low": 49.3,
"close": 50.8
"close": 50.5
}
],
"09988": [
@@ -182,7 +182,7 @@
"date": "2026-07-03",
"high": 97.4,
"low": 93.55,
"close": 95.65
"close": 95.35
}
],
"688802": [
@@ -196,7 +196,7 @@
"date": "2026-07-03",
"high": 733.99,
"low": 713.0,
"close": 724.96
"close": 719.01
}
],
"300124": [
@@ -210,7 +210,7 @@
"date": "2026-07-03",
"high": 71.79,
"low": 67.31,
"close": 71.29
"close": 71.42
}
],
"000657": [
@@ -223,8 +223,8 @@
{
"date": "2026-07-03",
"high": 101.5,
"low": 88.23,
"close": 89.1
"low": 87.92,
"close": 88.72
}
],
"000711": [
@@ -252,7 +252,7 @@
"date": "2026-07-03",
"high": 872.83,
"low": 795.0,
"close": 843.79
"close": 841.41
}
],
"002594": [
@@ -266,7 +266,7 @@
"date": "2026-07-03",
"high": 87.28,
"low": 81.9,
"close": 86.74
"close": 86.91
}
],
"00700": [
@@ -310,7 +310,7 @@
"date": "2026-07-03",
"high": 13.19,
"low": 12.63,
"close": 13.12
"close": 13.13
}
],
"01088": [
+11 -5
View File
@@ -87,11 +87,17 @@ def to_cny(price, code):
# ── 总资产计算(唯一公式) ────────────────────────────────────────────
def calc_total_mv(holdings):
"""计算持仓总市值(所有价格已为 CNY"""
return round(sum(
(h.get('shares', 0) or 0) * (h.get('price', 0) or 0)
for h in (holdings or [])
), 2)
"""计算持仓总市值。港股 price 为 HKD,需 × 汇率转 CNY"""
total = 0
rate = get_hk_rate()
for h in (holdings or []):
p = (h.get('price', 0) or 0)
s = (h.get('shares', 0) or 0)
if h.get('currency') == 'HKD' or (str(h.get('code','')).startswith(('0','1')) and len(str(h.get('code',''))) == 5):
total += s * p * rate
else:
total += s * p
return round(total, 2)
def calc_total_assets(pf):
+2 -6
View File
@@ -251,13 +251,12 @@ def refresh_data_prices():
if s['code'] in prices:
price, _, change_pct = prices[s['code']]
if price > 0:
# 港股API返回HKD需转RMB
if is_hk_stock(s['code']):
price = round(price * HK_RATE, 2)
# 港股API返回HKD直接存HKD原值。calc_total_mv统一做CNY折算
old = s.get('price', 0)
if abs(old - price) > 0.001:
s['price'] = round(price, 2)
s['change_pct'] = float(change_pct) if change_pct else 0
s['currency'] = 'HKD' if is_hk_stock(s['code']) else 'CNY'
updated += 1
changed = True
if changed:
@@ -298,9 +297,6 @@ def refresh_data_prices():
if s['code'] in prices:
price, _, change_pct = prices[s['code']]
if price > 0:
# 港股:API返回HKD,需转RMB
if is_hk_stock(s['code']):
price = round(price * HK_RATE, 2)
old = s.get('price', 0)
if abs(old - price) > 0.001:
s['price'] = round(price, 2)