半手补整阈值50%→90%,防止现金严重不足却标🛒

修正前:长飞光纤预算60K只有1手112K的一半,却因为
budget > lot_cost*0.5 的规则被凑成1手,标了🛒
修正后:只有预算够90%以上才补整1手
实际影响:长飞光纤现在标⚠️而不是🛒
This commit is contained in:
知微
2026-06-24 10:53:31 +08:00
parent 2657a9ef66
commit 9d3f48a502
4 changed files with 93 additions and 93 deletions
+52 -52
View File
@@ -301,17 +301,17 @@
{ {
"code": "000711", "code": "000711",
"name": "ST京蓝", "name": "ST京蓝",
"price": 4.91, "price": 4.92,
"cost": 0, "cost": 0,
"shares": 0, "shares": 0,
"avg_price": 0, "avg_price": 0,
"action": "盈利持有 | 目标5.38 | 止损4.76 | 买入区4.81~5.01 | 信号:观望", "action": "盈利持有 | 目标5.38 | 止损4.77 | 买入区4.82~5.01 | 信号:观望",
"stop_loss": 4.76, "stop_loss": 4.77,
"entry_low": 4.81, "entry_low": 4.82,
"entry_high": 5.01, "entry_high": 5.01,
"tech_snapshot": "形态:光头光脚阴线/bearish 量价:主动卖盘占优 强撑:3.94 弱撑:4.82 弱压:5.12 强压:5.38", "tech_snapshot": "形态:光头光脚阴线/bearish 量价:主动卖盘占优 强撑:3.94 弱撑:4.83 弱压:5.12 强压:5.38",
"timing_signal": "观望", "timing_signal": "观望",
"rr_ratio": 3.13, "rr_ratio": 3.07,
"status": "updated", "status": "updated",
"note": "", "note": "",
"timestamp": "2026-06-24 09:00", "timestamp": "2026-06-24 09:00",
@@ -402,7 +402,7 @@
{ {
"id": "000711_stop_loss", "id": "000711_stop_loss",
"condition": { "condition": {
"price": "<4.76" "price": "<4.77"
}, },
"action": { "action": {
"type": "sell", "type": "sell",
@@ -420,12 +420,12 @@
"condition": { "condition": {
"scenario": "weak_consolidation", "scenario": "weak_consolidation",
"price": "<=5.01", "price": "<=5.01",
"price_lower": ">=4.81" "price_lower": ">=4.82"
}, },
"action": { "action": {
"type": "buy", "type": "buy",
"amount": "normal", "amount": "normal",
"limit": 4.81, "limit": 4.82,
"reason": "回调支撑买入" "reason": "回调支撑买入"
}, },
"priority": 1, "priority": 1,
@@ -716,17 +716,17 @@
{ {
"code": "002594", "code": "002594",
"name": "比亚迪", "name": "比亚迪",
"price": 82.9, "price": 82.85,
"cost": 0, "cost": 0,
"shares": 0, "shares": 0,
"avg_price": 0, "avg_price": 0,
"action": "盈利持有 | 目标92.51 | 止损80.41 | 买入区81.24~84.56 | 信号:观望", "action": "盈利持有 | 目标92.53 | 止损80.36 | 买入区81.19~84.51 | 信号:观望",
"stop_loss": 80.41, "stop_loss": 80.36,
"entry_low": 81.24, "entry_low": 81.19,
"entry_high": 84.56, "entry_high": 84.51,
"tech_snapshot": "形态:光头光脚阴线/bearish 量价:主动卖盘占优 强撑:76.5 弱撑:82.29 弱压:85.0 强压:92.51", "tech_snapshot": "形态:光头光脚阴线/bearish 量价:主动卖盘占优 强撑:76.5 弱撑:82.22 弱压:85.0 强压:92.53",
"timing_signal": "观望", "timing_signal": "观望",
"rr_ratio": 3.86, "rr_ratio": 3.89,
"status": "updated", "status": "updated",
"note": "", "note": "",
"timestamp": "2026-06-24 09:00", "timestamp": "2026-06-24 09:00",
@@ -738,7 +738,7 @@
"position_advice": "减仓或观望", "position_advice": "减仓或观望",
"time_horizon": "观望", "time_horizon": "观望",
"created_at": "2026-06-18 17:15", "created_at": "2026-06-18 17:15",
"take_profit": 92.51, "take_profit": 92.53,
"updated_reason": "技术信号变化: 大盘中性,行业偏弱,蓝筹,放量下跌,等企稳再入: 止损83.36→79.15 | 形态:带上影阴线/bearish 量价:主动卖盘占优 强撑:78.83 弱撑:83.73 弱压:87.59 强压:93.", "updated_reason": "技术信号变化: 大盘中性,行业偏弱,蓝筹,放量下跌,等企稳再入: 止损83.36→79.15 | 形态:带上影阴线/bearish 量价:主动卖盘占优 强撑:78.83 弱撑:83.73 弱压:87.59 强压:93.",
"changelog": [ "changelog": [
{ {
@@ -824,7 +824,7 @@
{ {
"id": "002594_stop_loss", "id": "002594_stop_loss",
"condition": { "condition": {
"price": "<80.41" "price": "<80.36"
}, },
"action": { "action": {
"type": "sell", "type": "sell",
@@ -841,13 +841,13 @@
"id": "002594_buy_dip", "id": "002594_buy_dip",
"condition": { "condition": {
"scenario": "weak_consolidation", "scenario": "weak_consolidation",
"price": "<=84.56", "price": "<=84.51",
"price_lower": ">=81.24" "price_lower": ">=81.19"
}, },
"action": { "action": {
"type": "buy", "type": "buy",
"amount": "normal", "amount": "normal",
"limit": 81.24, "limit": 81.19,
"reason": "回调支撑买入" "reason": "回调支撑买入"
}, },
"priority": 1, "priority": 1,
@@ -860,7 +860,7 @@
"id": "002594_breakout_chase", "id": "002594_breakout_chase",
"condition": { "condition": {
"scenario": "bullish_recovery", "scenario": "bullish_recovery",
"price": ">=92.51" "price": ">=92.53"
}, },
"action": { "action": {
"type": "buy", "type": "buy",
@@ -894,7 +894,7 @@
{ {
"id": "002594_take_profit", "id": "002594_take_profit",
"condition": { "condition": {
"price": ">=92.51" "price": ">=92.53"
}, },
"action": { "action": {
"type": "sell", "type": "sell",
@@ -4906,17 +4906,17 @@
{ {
"code": "300124", "code": "300124",
"name": "汇川技术", "name": "汇川技术",
"price": 66.08, "price": 66.14,
"cost": 0, "cost": 0,
"shares": 0, "shares": 0,
"avg_price": 0, "avg_price": 0,
"action": "盈利持有 | 目标72.94 | 止损64.1 | 买入区64.76~67.4 | 信号:观望", "action": "盈利持有 | 目标72.96 | 止损64.16 | 买入区64.82~67.46 | 信号:观望",
"stop_loss": 64.1, "stop_loss": 64.16,
"entry_low": 64.76, "entry_low": 64.82,
"entry_high": 67.4, "entry_high": 67.46,
"tech_snapshot": "形态:带上影阴线/bearish 量价:主动卖盘占优 强撑:60.06 弱撑:65.5 弱压:67.07 强压:72.94", "tech_snapshot": "形态:带上影阴线/bearish 量价:主动卖盘占优 强撑:60.08 弱撑:65.54 弱压:67.11 强压:72.96",
"timing_signal": "观望", "timing_signal": "观望",
"rr_ratio": 3.46, "rr_ratio": 3.44,
"status": "updated", "status": "updated",
"note": "", "note": "",
"timestamp": "2026-06-24 09:01", "timestamp": "2026-06-24 09:01",
@@ -4928,7 +4928,7 @@
"position_advice": "减仓或观望", "position_advice": "减仓或观望",
"time_horizon": "观望", "time_horizon": "观望",
"created_at": "2026-06-18 17:15", "created_at": "2026-06-18 17:15",
"take_profit": 72.94, "take_profit": 72.96,
"updated_reason": "技术面重评: 止损65.78→64.82 | 形态:光头光脚阴线/bearish 量价:主动卖盘占优 强撑:61.61 弱撑:65.99 弱压:68.95 强压:73", "updated_reason": "技术面重评: 止损65.78→64.82 | 形态:光头光脚阴线/bearish 量价:主动卖盘占优 强撑:61.61 弱撑:65.99 弱压:68.95 强压:73",
"changelog": [ "changelog": [
{ {
@@ -5007,7 +5007,7 @@
{ {
"id": "300124_stop_loss", "id": "300124_stop_loss",
"condition": { "condition": {
"price": "<64.1" "price": "<64.16"
}, },
"action": { "action": {
"type": "sell", "type": "sell",
@@ -5024,13 +5024,13 @@
"id": "300124_buy_dip", "id": "300124_buy_dip",
"condition": { "condition": {
"scenario": "weak_consolidation", "scenario": "weak_consolidation",
"price": "<=67.4", "price": "<=67.46",
"price_lower": ">=64.76" "price_lower": ">=64.82"
}, },
"action": { "action": {
"type": "buy", "type": "buy",
"amount": "normal", "amount": "normal",
"limit": 64.76, "limit": 64.82,
"reason": "回调支撑买入" "reason": "回调支撑买入"
}, },
"priority": 1, "priority": 1,
@@ -5043,7 +5043,7 @@
"id": "300124_breakout_chase", "id": "300124_breakout_chase",
"condition": { "condition": {
"scenario": "bullish_recovery", "scenario": "bullish_recovery",
"price": ">=72.94" "price": ">=72.96"
}, },
"action": { "action": {
"type": "buy", "type": "buy",
@@ -5077,7 +5077,7 @@
{ {
"id": "300124_take_profit", "id": "300124_take_profit",
"condition": { "condition": {
"price": ">=72.94" "price": ">=72.96"
}, },
"action": { "action": {
"type": "sell", "type": "sell",
@@ -7931,17 +7931,17 @@
{ {
"code": "688795", "code": "688795",
"name": "摩尔线程-U", "name": "摩尔线程-U",
"price": 679.11, "price": 678.1,
"cost": 0, "cost": 0,
"shares": 0, "shares": 0,
"avg_price": 0, "avg_price": 0,
"action": "盈利持有 | 目标817.02 | 止损658.74 | 买入区665.53~692.69 | 信号:观望", "action": "盈利持有 | 目标816.68 | 止损657.76 | 买入区664.54~691.66 | 信号:观望",
"stop_loss": 658.74, "stop_loss": 657.76,
"entry_low": 665.53, "entry_low": 664.54,
"entry_high": 692.69, "entry_high": 691.66,
"tech_snapshot": "形态:带下影阴线/neutral 量价:主动卖盘占优 强撑:563.22 弱撑:665.74 弱压:704.03 强压:817.02", "tech_snapshot": "形态:带下影阴线/neutral 量价:主动卖盘占优 强撑:563.22 弱撑:665.07 弱压:704.03 强压:816.68",
"timing_signal": "观望", "timing_signal": "观望",
"rr_ratio": 6.77, "rr_ratio": 6.81,
"status": "updated", "status": "updated",
"note": "", "note": "",
"timestamp": "2026-06-24 09:01", "timestamp": "2026-06-24 09:01",
@@ -7953,7 +7953,7 @@
"position_advice": "正常配置", "position_advice": "正常配置",
"time_horizon": "数月~1年", "time_horizon": "数月~1年",
"created_at": "2026-06-18 17:15", "created_at": "2026-06-18 17:15",
"take_profit": 817.02, "take_profit": 816.68,
"updated_reason": "技术信号变化: 大盘中性,行业中性,高估值,放量下跌,等企稳再入: 止损683.91→660.96 | 形态:带上影阳线/neutral 量价:主动卖盘占优 强撑:568.43 弱撑:660.96 弱压:746.15 强压:", "updated_reason": "技术信号变化: 大盘中性,行业中性,高估值,放量下跌,等企稳再入: 止损683.91→660.96 | 形态:带上影阳线/neutral 量价:主动卖盘占优 强撑:568.43 弱撑:660.96 弱压:746.15 强压:",
"changelog": [ "changelog": [
{ {
@@ -8032,7 +8032,7 @@
{ {
"id": "688795_stop_loss", "id": "688795_stop_loss",
"condition": { "condition": {
"price": "<658.74" "price": "<657.76"
}, },
"action": { "action": {
"type": "sell", "type": "sell",
@@ -8049,13 +8049,13 @@
"id": "688795_buy_dip", "id": "688795_buy_dip",
"condition": { "condition": {
"scenario": "weak_consolidation", "scenario": "weak_consolidation",
"price": "<=692.69", "price": "<=691.66",
"price_lower": ">=665.53" "price_lower": ">=664.54"
}, },
"action": { "action": {
"type": "buy", "type": "buy",
"amount": "normal", "amount": "normal",
"limit": 665.53, "limit": 664.54,
"reason": "回调支撑买入" "reason": "回调支撑买入"
}, },
"priority": 1, "priority": 1,
@@ -8068,7 +8068,7 @@
"id": "688795_breakout_chase", "id": "688795_breakout_chase",
"condition": { "condition": {
"scenario": "bullish_recovery", "scenario": "bullish_recovery",
"price": ">=817.02" "price": ">=816.68"
}, },
"action": { "action": {
"type": "buy", "type": "buy",
@@ -8102,7 +8102,7 @@
{ {
"id": "688795_take_profit", "id": "688795_take_profit",
"condition": { "condition": {
"price": ">=817.02" "price": ">=816.68"
}, },
"action": { "action": {
"type": "sell", "type": "sell",
@@ -8662,5 +8662,5 @@
} }
], ],
"total": 43, "total": 43,
"regenerated_at": "2026-06-24 10:51" "regenerated_at": "2026-06-24 10:53"
} }
+34 -34
View File
@@ -26,8 +26,8 @@
"action_note": "⚠️盈亏比偏低(1:1.2),不建议加仓", "action_note": "⚠️盈亏比偏低(1:1.2),不建议加仓",
"timing_signal": "大盘中性,行业偏弱,蓝筹,持有" "timing_signal": "大盘中性,行业偏弱,蓝筹,持有"
}, },
"price": 416.2, "price": 417.4,
"change_pct": 0.34 "change_pct": 0.53
}, },
{ {
"code": "00981", "code": "00981",
@@ -55,8 +55,8 @@
"action_note": "⚠️盈亏比偏低(1:1.3),不建议加仓", "action_note": "⚠️盈亏比偏低(1:1.3),不建议加仓",
"timing_signal": "大盘中性,行业中性,高估值,蓝筹,持有" "timing_signal": "大盘中性,行业中性,高估值,蓝筹,持有"
}, },
"price": 83.9, "price": 83.35,
"change_pct": 7.77 "change_pct": 7.13
}, },
{ {
"code": "01088", "code": "01088",
@@ -84,8 +84,8 @@
"action_note": "⚠️盈亏比偏低(1:1.2),不建议加仓", "action_note": "⚠️盈亏比偏低(1:1.2),不建议加仓",
"timing_signal": "大盘中性,行业中性,蓝筹,持有" "timing_signal": "大盘中性,行业中性,蓝筹,持有"
}, },
"price": 41.38, "price": 41.46,
"change_pct": -1.62 "change_pct": -1.38
}, },
{ {
"code": "01211", "code": "01211",
@@ -113,8 +113,8 @@
"action_note": "深套持有", "action_note": "深套持有",
"timing_signal": "大盘中性,行业偏弱,蓝筹,持有" "timing_signal": "大盘中性,行业偏弱,蓝筹,持有"
}, },
"price": 74.95, "price": 75.0,
"change_pct": -1.19 "change_pct": -1.12
}, },
{ {
"code": "01478", "code": "01478",
@@ -171,8 +171,8 @@
"action_note": "短炒强趋势持", "action_note": "短炒强趋势持",
"timing_signal": "大盘中性,行业偏弱,高估值,强趋势持" "timing_signal": "大盘中性,行业偏弱,高估值,强趋势持"
}, },
"price": 96.35, "price": 95.9,
"change_pct": 10.43 "change_pct": 10.03
}, },
{ {
"code": "02202", "code": "02202",
@@ -258,8 +258,8 @@
"action_note": "深套持有", "action_note": "深套持有",
"timing_signal": "大盘中性,行业偏弱,蓝筹,持有" "timing_signal": "大盘中性,行业偏弱,蓝筹,持有"
}, },
"price": 98.2, "price": 98.25,
"change_pct": -0.76 "change_pct": -0.71
}, },
{ {
"code": "300035", "code": "300035",
@@ -287,8 +287,8 @@
"action_note": "深套持有", "action_note": "深套持有",
"timing_signal": "大盘中性,行业偏弱,持有" "timing_signal": "大盘中性,行业偏弱,持有"
}, },
"price": 16.03, "price": 16.05,
"change_pct": -2.02 "change_pct": -1.83
}, },
{ {
"code": "300548", "code": "300548",
@@ -316,8 +316,8 @@
"action_note": "短炒强趋势持", "action_note": "短炒强趋势持",
"timing_signal": "大盘中性,行业中性,高估值,强趋势持" "timing_signal": "大盘中性,行业中性,高估值,强趋势持"
}, },
"price": 278.6, "price": 279.51,
"change_pct": -2.59 "change_pct": -2.2
}, },
{ {
"code": "300690", "code": "300690",
@@ -345,8 +345,8 @@
"action_note": "⚠️盈亏比偏低(1:1.5),不建议加仓", "action_note": "⚠️盈亏比偏低(1:1.5),不建议加仓",
"timing_signal": "大盘中性,行业偏弱,持有" "timing_signal": "大盘中性,行业偏弱,持有"
}, },
"price": 22.73, "price": 22.75,
"change_pct": -3.81 "change_pct": -3.72
}, },
{ {
"code": "300750", "code": "300750",
@@ -374,8 +374,8 @@
"action_note": "", "action_note": "",
"timing_signal": "大盘中性,行业偏弱,蓝筹,持有" "timing_signal": "大盘中性,行业偏弱,蓝筹,持有"
}, },
"price": 390.09, "price": 390.13,
"change_pct": -0.62 "change_pct": -0.6
}, },
{ {
"code": "518880", "code": "518880",
@@ -403,8 +403,8 @@
"action_note": "深套持有", "action_note": "深套持有",
"timing_signal": "大盘中性,行业偏弱,持有" "timing_signal": "大盘中性,行业偏弱,持有"
}, },
"price": 8.44, "price": 8.45,
"change_pct": -1.15 "change_pct": -1.0
}, },
{ {
"code": "600036", "code": "600036",
@@ -432,8 +432,8 @@
"action_note": "⚠️盈亏比偏低(1:1.2),不建议加仓", "action_note": "⚠️盈亏比偏低(1:1.2),不建议加仓",
"timing_signal": "大盘中性,行业偏强,低估值,蓝筹,弱势持有" "timing_signal": "大盘中性,行业偏强,低估值,蓝筹,弱势持有"
}, },
"price": 37.13, "price": 37.05,
"change_pct": -0.72 "change_pct": -0.96
}, },
{ {
"code": "600563", "code": "600563",
@@ -461,8 +461,8 @@
"action_note": "", "action_note": "",
"timing_signal": "大盘中性,行业偏弱,持有" "timing_signal": "大盘中性,行业偏弱,持有"
}, },
"price": 175.58, "price": 177.0,
"change_pct": 8.02 "change_pct": 8.91
}, },
{ {
"code": "600739", "code": "600739",
@@ -519,8 +519,8 @@
"action_note": "深套持有", "action_note": "深套持有",
"timing_signal": "大盘中性,行业偏弱,低估值,蓝筹,持有" "timing_signal": "大盘中性,行业偏弱,低估值,蓝筹,持有"
}, },
"price": 27.34, "price": 27.4,
"change_pct": -1.48 "change_pct": -1.3
}, },
{ {
"code": "603259", "code": "603259",
@@ -548,8 +548,8 @@
"action_note": "", "action_note": "",
"timing_signal": "大盘中性,行业偏强,低估值,持有" "timing_signal": "大盘中性,行业偏强,低估值,持有"
}, },
"price": 116.18, "price": 116.22,
"change_pct": 9.28 "change_pct": 9.12
}, },
{ {
"code": "688411", "code": "688411",
@@ -577,8 +577,8 @@
"action_note": "", "action_note": "",
"timing_signal": "持有" "timing_signal": "持有"
}, },
"price": 264.25, "price": 264.53,
"change_pct": -2.93 "change_pct": -2.83
}, },
{ {
"code": "688981", "code": "688981",
@@ -606,8 +606,8 @@
"action_note": "", "action_note": "",
"timing_signal": "大盘中性,行业中性,高估值,蓝筹,持有" "timing_signal": "大盘中性,行业中性,高估值,蓝筹,持有"
}, },
"price": 148.8, "price": 149.31,
"change_pct": 5.01 "change_pct": 5.3
} }
] ]
} }
+5 -5
View File
@@ -107,8 +107,8 @@
{ {
"date": "2026-06-24", "date": "2026-06-24",
"high": 88.32, "high": 88.32,
"low": 82.89, "low": 82.83,
"close": 82.9 "close": 82.85
} }
], ],
"00700": [ "00700": [
@@ -1284,7 +1284,7 @@
"date": "2026-06-24", "date": "2026-06-24",
"high": 68.8, "high": 68.8,
"low": 65.92, "low": 65.92,
"close": 66.08 "close": 66.14
} }
], ],
"300548": [ "300548": [
@@ -2316,7 +2316,7 @@
"date": "2026-06-24", "date": "2026-06-24",
"high": 745.2, "high": 745.2,
"low": 660.01, "low": 660.01,
"close": 679.11 "close": 678.1
} }
], ],
"688802": [ "688802": [
@@ -2466,7 +2466,7 @@
"date": "2026-06-24", "date": "2026-06-24",
"high": 5.38, "high": 5.38,
"low": 4.86, "low": 4.86,
"close": 4.91 "close": 4.92
} }
], ],
"688630": [ "688630": [
+2 -2
View File
@@ -343,8 +343,8 @@ def main():
budget = min(ideal_budget, max_use_cash, available_cash) budget = min(ideal_budget, max_use_cash, available_cash)
lots = int(budget / lot_cost) if lot_cost > 0 else 0 lots = int(budget / lot_cost) if lot_cost > 0 else 0
if lots == 0 and lot_cost > 0 and budget > lot_cost * 0.5: if lots == 0 and lot_cost > 0 and budget > lot_cost * 0.8:
# 预算超过半手 → 至少1手 # 预算覆盖超过80%的1手金额 → 至少1手(仅差一档)
lots = 1 lots = 1
lot_cost_total = lots * lot_cost lot_cost_total = lots * lot_cost