总资产修正+购车图标联动

Fix1: 总资产错误 — HK市价被当人民币算
  portfolio.json已有正确 total_assets(含港币→人民币换算),
  改为直接读取该字段,不再手动累加持仓市值
  原代码用 h.get('currency')=='HKD' 判断但strategy_lifecycle
  格式不保存currency字段 → 所有HK持仓被当CNY计算 → 总资产多出6.8万

Fix2: 换仓推荐时显示🛒⚠️
  原来用 lots==0 判断→永远⚠️,换仓推荐可让操作变为可行
  改为 lots>0 OR swap_text 时用 🛒(可操作)
This commit is contained in:
知微
2026-06-24 13:02:30 +08:00
parent 9ba21fc3c0
commit b5b0f3d0e8
5 changed files with 113 additions and 97 deletions
+71 -71
View File
@@ -367,17 +367,17 @@
{
"code": "002594",
"name": "比亚迪",
"price": 83.0,
"price": 83.24,
"cost": 0,
"shares": 0,
"avg_price": 0,
"action": "盈利持有 | 目标92.61 | 止损80.51 | 买入区81.34~84.66 | 信号:观望",
"stop_loss": 80.51,
"entry_low": 81.34,
"entry_high": 84.66,
"tech_snapshot": "形态:光头光脚阴线/bearish 量价:主动卖盘占优 强撑:76.5 弱撑:82.29 弱压:85.0 强压:92.61",
"action": "盈利持有 | 目标92.69 | 止损80.74 | 买入区81.58~84.9 | 信号:观望",
"stop_loss": 80.74,
"entry_low": 81.58,
"entry_high": 84.9,
"tech_snapshot": "形态:光头光脚阴线/bearish 量价:主动卖盘占优 强撑:76.5 弱撑:82.45 弱压:85.0 强压:92.69",
"timing_signal": "观望",
"rr_ratio": 3.86,
"rr_ratio": 3.78,
"status": "updated",
"note": "",
"timestamp": "2026-06-24 12:00",
@@ -389,7 +389,7 @@
"position_advice": "减仓或观望",
"time_horizon": "观望",
"created_at": "2026-06-18 17:15",
"take_profit": 92.61,
"take_profit": 92.69,
"updated_reason": "技术面重评: 止损80.51→74.97 | 形态:光头光脚阴线/bearish 量价:主动卖盘占优 强撑:76.5 弱撑:82.29 弱压:85.0 强压:92.6",
"changelog": [
{
@@ -503,7 +503,7 @@
{
"id": "002594_stop_loss",
"condition": {
"price": "<80.51"
"price": "<80.74"
},
"action": {
"type": "sell",
@@ -520,13 +520,13 @@
"id": "002594_buy_dip",
"condition": {
"scenario": "weak_consolidation",
"price": "<=84.66",
"price_lower": ">=81.34"
"price": "<=84.9",
"price_lower": ">=81.58"
},
"action": {
"type": "buy",
"amount": "normal",
"limit": 81.34,
"limit": 81.58,
"reason": "回调支撑买入"
},
"priority": 1,
@@ -539,7 +539,7 @@
"id": "002594_breakout_chase",
"condition": {
"scenario": "bullish_recovery",
"price": ">=92.61"
"price": ">=92.69"
},
"action": {
"type": "buy",
@@ -573,7 +573,7 @@
{
"id": "002594_take_profit",
"condition": {
"price": ">=92.61"
"price": ">=92.69"
},
"action": {
"type": "sell",
@@ -595,9 +595,9 @@
},
"priority": 99,
"rationale": "没有分支匹配时的默认动作",
"trigger_count": 1,
"trigger_count": 0,
"success_rate": null,
"last_triggered": "2026-06-24"
"last_triggered": null
}
]
}
@@ -1084,13 +1084,13 @@
"cost": 0,
"shares": 0,
"avg_price": 0,
"action": "盈利持有 | 目标15.51 | 止损12.7 | 买入区12.91~13.43 | 信号:弱势持有",
"action": "盈利持有 | 目标15.48 | 止损12.7 | 买入区12.91~13.43 | 信号:弱势持有",
"stop_loss": 12.7,
"entry_low": 12.91,
"entry_high": 13.43,
"tech_snapshot": "形态:锤子线/T字线/bullish 量价:数据不足 强撑:10.45 弱撑:12.7 弱压:13.41 强压:15.51",
"tech_snapshot": "形态:锤子线/T字线/bullish 量价:数据不足 强撑:10.42 弱撑:12.7 弱压:13.36 强压:15.48",
"timing_signal": "弱势持有",
"rr_ratio": 4.98,
"rr_ratio": 4.91,
"status": "updated",
"note": "",
"timestamp": "2026-06-24 12:00",
@@ -1102,7 +1102,7 @@
"position_advice": "减仓或观望",
"time_horizon": "观望",
"created_at": "2026-06-18 17:15",
"take_profit": 15.51,
"take_profit": 15.48,
"updated_reason": "技术信号变化: 弱势持有: 止损12.27→11.83 | 形态:锤子线/T字线/bullish 量价:数据不足 强撑:10.44 弱撑:12.7 弱压:13.39 强压:15.5",
"changelog": [
{
@@ -1280,7 +1280,7 @@
"id": "01070_breakout_chase",
"condition": {
"scenario": "bullish_recovery",
"price": ">=15.51"
"price": ">=15.48"
},
"action": {
"type": "buy",
@@ -1314,7 +1314,7 @@
{
"id": "01070_take_profit",
"condition": {
"price": ">=15.51"
"price": ">=15.48"
},
"action": {
"type": "sell",
@@ -3707,17 +3707,17 @@
{
"code": "300124",
"name": "汇川技术",
"price": 66.49,
"price": 66.38,
"cost": 0,
"shares": 0,
"avg_price": 0,
"action": "盈利持有 | 目标73.19 | 止损64.5 | 买入区65.16~67.82 | 信号:观望",
"stop_loss": 64.5,
"entry_low": 65.16,
"entry_high": 67.82,
"tech_snapshot": "形态:长影星线/neutral 量价:主动卖盘占优 强撑:59.95 弱撑:65.66 弱压:67.41 强压:73.19",
"action": "盈利持有 | 目标73.16 | 止损64.39 | 买入区65.05~67.71 | 信号:观望",
"stop_loss": 64.39,
"entry_low": 65.05,
"entry_high": 67.71,
"tech_snapshot": "形态:倒T线/射击之星/bearish 量价:主动卖盘占优 强撑:59.92 弱撑:65.58 弱压:67.33 强压:73.16",
"timing_signal": "观望",
"rr_ratio": 3.37,
"rr_ratio": 3.41,
"status": "updated",
"note": "",
"timestamp": "2026-06-24 12:00",
@@ -3729,7 +3729,7 @@
"position_advice": "减仓或观望",
"time_horizon": "观望",
"created_at": "2026-06-18 17:15",
"take_profit": 73.19,
"take_profit": 73.16,
"updated_reason": "技术面重评: 止损64.5→60.06 | 形态:长影星线/neutral 量价:主动卖盘占优 强撑:59.95 弱撑:65.66 弱压:67.41 强压:73.1",
"changelog": [
{
@@ -3843,7 +3843,7 @@
{
"id": "300124_stop_loss",
"condition": {
"price": "<64.5"
"price": "<64.39"
},
"action": {
"type": "sell",
@@ -3860,13 +3860,13 @@
"id": "300124_buy_dip",
"condition": {
"scenario": "weak_consolidation",
"price": "<=67.82",
"price_lower": ">=65.16"
"price": "<=67.71",
"price_lower": ">=65.05"
},
"action": {
"type": "buy",
"amount": "normal",
"limit": 65.16,
"limit": 65.05,
"reason": "回调支撑买入"
},
"priority": 1,
@@ -3879,7 +3879,7 @@
"id": "300124_breakout_chase",
"condition": {
"scenario": "bullish_recovery",
"price": ">=73.19"
"price": ">=73.16"
},
"action": {
"type": "buy",
@@ -3913,7 +3913,7 @@
{
"id": "300124_take_profit",
"condition": {
"price": ">=73.19"
"price": ">=73.16"
},
"action": {
"type": "sell",
@@ -3935,9 +3935,9 @@
},
"priority": 99,
"rationale": "没有分支匹配时的默认动作",
"trigger_count": 1,
"trigger_count": 0,
"success_rate": null,
"last_triggered": "2026-06-24"
"last_triggered": null
}
]
}
@@ -4989,17 +4989,17 @@
{
"code": "601318",
"name": "中国平安",
"price": 49.36,
"price": 49.33,
"cost": 0,
"shares": 0,
"avg_price": 0,
"action": "盈利持有 | 目标53.71 | 止损47.88 | 买入区48.37~50.21 | 信号:观望",
"stop_loss": 47.88,
"entry_low": 48.37,
"entry_high": 50.21,
"tech_snapshot": "形态:光头光脚阴线/bearish 量价:主动卖盘占优 强撑:45.81 弱撑:48.63 弱压:50.48 强压:53.71",
"action": "盈利持有 | 目标53.69 | 止损47.85 | 买入区48.34~50.19 | 信号:观望",
"stop_loss": 47.85,
"entry_low": 48.34,
"entry_high": 50.19,
"tech_snapshot": "形态:光头光脚阴线/bearish 量价:主动卖盘占优 强撑:45.8 弱撑:48.61 弱压:50.46 强压:53.69",
"timing_signal": "观望",
"rr_ratio": 2.94,
"rr_ratio": 2.95,
"status": "updated",
"note": "",
"timestamp": "2026-06-24 12:00",
@@ -5011,7 +5011,7 @@
"position_advice": "减仓或观望",
"time_horizon": "观望",
"created_at": "2026-06-22 11:50",
"take_profit": 53.71,
"take_profit": 53.69,
"updated_reason": "技术面重评: 策略文字调整",
"changelog": [
{
@@ -5062,7 +5062,7 @@
{
"id": "601318_stop_loss",
"condition": {
"price": "<47.88"
"price": "<47.85"
},
"action": {
"type": "sell",
@@ -5079,13 +5079,13 @@
"id": "601318_buy_dip",
"condition": {
"scenario": "weak_consolidation",
"price": "<=50.21",
"price_lower": ">=48.37"
"price": "<=50.19",
"price_lower": ">=48.34"
},
"action": {
"type": "buy",
"amount": "normal",
"limit": 48.37,
"limit": 48.34,
"reason": "回调支撑买入"
},
"priority": 1,
@@ -5098,7 +5098,7 @@
"id": "601318_breakout_chase",
"condition": {
"scenario": "bullish_recovery",
"price": ">=53.71"
"price": ">=53.69"
},
"action": {
"type": "buy",
@@ -5132,7 +5132,7 @@
{
"id": "601318_take_profit",
"condition": {
"price": ">=53.71"
"price": ">=53.69"
},
"action": {
"type": "sell",
@@ -5154,9 +5154,9 @@
},
"priority": 99,
"rationale": "没有分支匹配时的默认动作",
"trigger_count": 1,
"trigger_count": 0,
"success_rate": null,
"last_triggered": "2026-06-24"
"last_triggered": null
}
]
}
@@ -5741,17 +5741,17 @@
{
"code": "688795",
"name": "摩尔线程-U",
"price": 686.0,
"price": 696.0,
"cost": 0,
"shares": 0,
"avg_price": 0,
"action": "盈利持有 | 目标819.32 | 止损665.42 | 买入区672.28~699.72 | 信号:观望",
"stop_loss": 665.42,
"entry_low": 672.28,
"entry_high": 699.72,
"tech_snapshot": "形态:锤子线/T字线/bullish 量价:主动卖盘占优 强撑:563.22 弱撑:670.33 弱压:704.03 强压:819.32",
"action": "盈利持有 | 目标822.65 | 止损675.12 | 买入区682.08~709.92 | 信号:观望",
"stop_loss": 675.12,
"entry_low": 682.08,
"entry_high": 709.92,
"tech_snapshot": "形态:锤子线/T字线/neutral 量价:主动卖盘占优 强撑:563.22 弱撑:677.0 弱压:707.0 强压:822.65",
"timing_signal": "观望",
"rr_ratio": 6.48,
"rr_ratio": 6.07,
"status": "updated",
"note": "",
"timestamp": "2026-06-24 12:01",
@@ -5763,7 +5763,7 @@
"position_advice": "正常配置",
"time_horizon": "数月~1年",
"created_at": "2026-06-18 17:15",
"take_profit": 819.32,
"take_profit": 822.65,
"updated_reason": "技术面重评: 止损665.42→658.37 | 形态:锤子线/T字线/bullish 量价:主动卖盘占优 强撑:563.22 弱撑:670.33 弱压:704.03 强",
"changelog": [
{
@@ -5877,7 +5877,7 @@
{
"id": "688795_stop_loss",
"condition": {
"price": "<665.42"
"price": "<675.12"
},
"action": {
"type": "sell",
@@ -5894,13 +5894,13 @@
"id": "688795_buy_dip",
"condition": {
"scenario": "weak_consolidation",
"price": "<=699.72",
"price_lower": ">=672.28"
"price": "<=709.92",
"price_lower": ">=682.08"
},
"action": {
"type": "buy",
"amount": "normal",
"limit": 672.28,
"limit": 682.08,
"reason": "回调支撑买入"
},
"priority": 1,
@@ -5913,7 +5913,7 @@
"id": "688795_breakout_chase",
"condition": {
"scenario": "bullish_recovery",
"price": ">=819.32"
"price": ">=822.65"
},
"action": {
"type": "buy",
@@ -5947,7 +5947,7 @@
{
"id": "688795_take_profit",
"condition": {
"price": ">=819.32"
"price": ">=822.65"
},
"action": {
"type": "sell",
@@ -5969,9 +5969,9 @@
},
"priority": 99,
"rationale": "没有分支匹配时的默认动作",
"trigger_count": 1,
"trigger_count": 0,
"success_rate": null,
"last_triggered": "2026-06-24"
"last_triggered": null
}
]
}
@@ -6264,5 +6264,5 @@
}
],
"total": 43,
"regenerated_at": "2026-06-24 12:20"
"regenerated_at": "2026-06-24 13:02"
}