feat: 筹码S/R集成到reassess_strategy
- calc_chip_sr(): 从筹码分布计算支撑/阻力
- reassess_strategy新增筹码S/R输出+共振检测
- 止损用枢轴(短期),目标参考筹码(中线)
- 两者差距<3%时标记共振⚡
This commit is contained in:
Binary file not shown.
@@ -1 +1 @@
|
|||||||
{"winner_pct": 0.8905253861016628, "loser_pct": 0.10947461389833724, "bias": 0.0021894922779667446, "updated_at": "2026-07-02T00:35:07.027353"}
|
{"winner_pct": 0.9806336040435885, "loser_pct": 0.01936639595641151, "bias": 0.0003873279191282302, "updated_at": "2026-07-02T00:44:45.975293"}
|
||||||
@@ -1 +1 @@
|
|||||||
{"winner_pct": 0.7051650439382611, "loser_pct": 0.29483495606173893, "bias": 0.005896699121234778, "updated_at": "2026-07-02T00:35:08.872295"}
|
{"winner_pct": 0.9366643901055676, "loser_pct": 0.06333560989443245, "bias": 0.001266712197888649, "updated_at": "2026-07-02T00:44:48.085198"}
|
||||||
@@ -1 +1 @@
|
|||||||
{"winner_pct": 0.4599205028102528, "loser_pct": 0.5400794971897471, "bias": 0.010801589943794944, "updated_at": "2026-07-02T00:35:10.904477"}
|
{"winner_pct": 0.8576946920402719, "loser_pct": 0.14230530795972807, "bias": 0.0028461061591945613, "updated_at": "2026-07-02T00:44:50.155122"}
|
||||||
@@ -1 +1 @@
|
|||||||
{"winner_pct": 0.9384281148873177, "loser_pct": 0.061571885112682245, "bias": 0.001231437702253645, "updated_at": "2026-07-02T00:35:13.007896"}
|
{"winner_pct": 0.9896105603070028, "loser_pct": 0.010389439692997248, "bias": 0.0007439340403273239, "updated_at": "2026-07-02T00:44:52.287382"}
|
||||||
@@ -1 +1 @@
|
|||||||
{"winner_pct": 0.06109805218679897, "loser_pct": 0.938901947813201, "bias": 0.01877803895626402, "updated_at": "2026-07-02T00:35:15.121583"}
|
{"winner_pct": 0.1347851485695232, "loser_pct": 0.8652148514304768, "bias": 0.017304297028609538, "updated_at": "2026-07-02T00:44:54.433552"}
|
||||||
@@ -1 +1 @@
|
|||||||
{"winner_pct": 0.11515632261891377, "loser_pct": 0.8848436773810862, "bias": 0.017696873547621724, "updated_at": "2026-07-02T00:35:21.588604"}
|
{"winner_pct": 0.9048415259336623, "loser_pct": 0.0951584740663377, "bias": 0.0019031694813267542, "updated_at": "2026-07-02T00:45:01.123204"}
|
||||||
@@ -1 +1 @@
|
|||||||
{"winner_pct": 0.01442763129876452, "loser_pct": 0.9855723687012354, "bias": 0.01971144737402471, "updated_at": "2026-07-02T00:35:23.448927"}
|
{"winner_pct": 0.8241215447247867, "loser_pct": 0.17587845527521323, "bias": 0.0035175691055042645, "updated_at": "2026-07-02T00:45:03.212196"}
|
||||||
@@ -1 +1 @@
|
|||||||
{"winner_pct": 0.012654394366315136, "loser_pct": 0.9873456056336849, "bias": 0.0197469121126737, "updated_at": "2026-07-02T00:35:25.515177"}
|
{"winner_pct": 0.0019470276458546261, "loser_pct": 0.9980529723541453, "bias": 0.019961059447082905, "updated_at": "2026-07-02T00:45:05.297271"}
|
||||||
@@ -1 +1 @@
|
|||||||
{"winner_pct": 0.02378383161135486, "loser_pct": 0.9762161683886451, "bias": 0.019524323367772902, "updated_at": "2026-07-02T00:35:27.617318"}
|
{"winner_pct": 0.44137334122971467, "loser_pct": 0.5586266587702853, "bias": 0.011172533175405706, "updated_at": "2026-07-02T00:45:07.463245"}
|
||||||
@@ -1 +1 @@
|
|||||||
{"winner_pct": 0.9605101031912507, "loser_pct": 0.039489896808749314, "bias": 0.0007897979361749863, "updated_at": "2026-07-02T00:35:29.720189"}
|
{"winner_pct": 0.9866163993464405, "loser_pct": 0.013383600653559464, "bias": 0.0006651935425033301, "updated_at": "2026-07-02T00:45:09.546450"}
|
||||||
@@ -1 +1 @@
|
|||||||
{"winner_pct": 0.0054820390352224024, "loser_pct": 0.9945179609647776, "bias": 0.019890359219295554, "updated_at": "2026-07-02T00:35:31.579501"}
|
{"winner_pct": 0.00024203244508924288, "loser_pct": 0.9997579675549108, "bias": 0.039564098261682626, "updated_at": "2026-07-02T00:45:11.637672"}
|
||||||
@@ -1 +1 @@
|
|||||||
{"winner_pct": 0.02266099339387972, "loser_pct": 0.9773390066061202, "bias": 0.019546780132122403, "updated_at": "2026-07-02T00:35:33.432173"}
|
{"winner_pct": 0.6241393442090698, "loser_pct": 0.3758606557909302, "bias": 0.007517213115818604, "updated_at": "2026-07-02T00:45:13.738933"}
|
||||||
@@ -1 +1 @@
|
|||||||
{"winner_pct": 0.9788099282869067, "loser_pct": 0.02119007171309323, "bias": 0.00042380143426186466, "updated_at": "2026-07-02T00:35:35.527231"}
|
{"winner_pct": 0.9983363743718657, "loser_pct": 0.0016636256281342872, "bias": 3.3272512562685745e-05, "updated_at": "2026-07-02T00:45:15.860775"}
|
||||||
@@ -1 +1 @@
|
|||||||
{"winner_pct": 0.03250983201120672, "loser_pct": 0.9674901679887933, "bias": 0.019349803359775868, "updated_at": "2026-07-02T00:35:37.394766"}
|
{"winner_pct": 0.8901293359594721, "loser_pct": 0.10987066404052795, "bias": 0.002197413280810559, "updated_at": "2026-07-02T00:45:17.975256"}
|
||||||
@@ -1 +1 @@
|
|||||||
{"winner_pct": 0.16852330162051746, "loser_pct": 0.8314766983794825, "bias": 0.01662953396758965, "updated_at": "2026-07-02T00:35:39.254760"}
|
{"winner_pct": 0.7900078948017442, "loser_pct": 0.20999210519825579, "bias": 0.004199842103965116, "updated_at": "2026-07-02T00:45:20.091419"}
|
||||||
@@ -1 +1 @@
|
|||||||
{"winner_pct": 0.36653309165872255, "loser_pct": 0.6334669083412774, "bias": 0.012669338166825549, "updated_at": "2026-07-02T00:35:41.322663"}
|
{"winner_pct": 0.5722888851123522, "loser_pct": 0.42771111488764785, "bias": 0.008554222297752958, "updated_at": "2026-07-02T00:45:22.179638"}
|
||||||
@@ -1 +1 @@
|
|||||||
{"winner_pct": 0.8235950164623566, "loser_pct": 0.17640498353764347, "bias": 0.0035280996707528697, "updated_at": "2026-07-02T00:35:43.401261"}
|
{"winner_pct": 0.9729771285366041, "loser_pct": 0.027022871463395843, "bias": 0.0005404574292679168, "updated_at": "2026-07-02T00:45:24.286446"}
|
||||||
@@ -1 +1 @@
|
|||||||
{"winner_pct": 0.10325476172315214, "loser_pct": 0.8967452382768478, "bias": 0.017934904765536958, "updated_at": "2026-07-02T00:35:45.448103"}
|
{"winner_pct": 0.3252340331221118, "loser_pct": 0.6747659668778883, "bias": 0.013495319337557765, "updated_at": "2026-07-02T00:45:26.369838"}
|
||||||
@@ -1 +1 @@
|
|||||||
{"winner_pct": 0.053119794705996114, "loser_pct": 0.9468802052940039, "bias": 0.018937604105880076, "updated_at": "2026-07-02T00:35:47.336553"}
|
{"winner_pct": 0.2719839509092063, "loser_pct": 0.7280160490907936, "bias": 0.014560320981815873, "updated_at": "2026-07-02T00:45:28.476701"}
|
||||||
@@ -1 +1 @@
|
|||||||
{"winner_pct": 0.028368192935391008, "loser_pct": 0.971631807064609, "bias": 0.019432636141292182, "updated_at": "2026-07-02T00:35:49.222809"}
|
{"winner_pct": 0.24517735256570908, "loser_pct": 0.7548226474342911, "bias": 0.015096452948685822, "updated_at": "2026-07-02T00:45:30.594484"}
|
||||||
@@ -1 +1 @@
|
|||||||
{"winner_pct": 0.36417545165724186, "loser_pct": 0.6358245483427581, "bias": 0.012716490966855162, "updated_at": "2026-07-02T00:35:51.342524"}
|
{"winner_pct": 0.5085832238108319, "loser_pct": 0.4914167761891682, "bias": 0.009828335523783364, "updated_at": "2026-07-02T00:45:32.751358"}
|
||||||
@@ -1 +1 @@
|
|||||||
{"winner_pct": 0.792023910513367, "loser_pct": 0.20797608948663301, "bias": 0.004159521789732661, "updated_at": "2026-07-02T00:35:53.208843"}
|
{"winner_pct": 0.9836595299961747, "loser_pct": 0.016340470003825366, "bias": 0.00032680940007650736, "updated_at": "2026-07-02T00:45:34.879675"}
|
||||||
@@ -1 +1 @@
|
|||||||
{"winner_pct": 0.5896316941534578, "loser_pct": 0.41036830584654216, "bias": 0.008207366116930844, "updated_at": "2026-07-02T00:35:55.349248"}
|
{"winner_pct": 0.9643635376930005, "loser_pct": 0.03563646230699947, "bias": 0.0007127292461399894, "updated_at": "2026-07-02T00:45:36.995336"}
|
||||||
@@ -1 +1 @@
|
|||||||
{"winner_pct": 0.051381452378474426, "loser_pct": 0.9486185476215256, "bias": 0.018972370952430512, "updated_at": "2026-07-02T00:35:57.452499"}
|
{"winner_pct": 0.8250221210073526, "loser_pct": 0.17497787899264738, "bias": 0.0034995575798529477, "updated_at": "2026-07-02T00:45:39.111567"}
|
||||||
@@ -1 +1 @@
|
|||||||
{"winner_pct": 0.9278175418685898, "loser_pct": 0.07218245813141022, "bias": 0.0014436491626282045, "updated_at": "2026-07-02T00:35:59.312573"}
|
{"winner_pct": 0.9874395067179887, "loser_pct": 0.012560493282011215, "bias": 0.00025120986564022434, "updated_at": "2026-07-02T00:45:41.239585"}
|
||||||
@@ -1 +1 @@
|
|||||||
{"winner_pct": 0.015377013137657148, "loser_pct": 0.9846229868623428, "bias": 0.019692459737246856, "updated_at": "2026-07-02T00:36:01.402360"}
|
{"winner_pct": 0.5509915567863326, "loser_pct": 0.4490084432136674, "bias": 0.008980168864273348, "updated_at": "2026-07-02T00:45:43.410106"}
|
||||||
@@ -1 +1 @@
|
|||||||
{"winner_pct": 0.10535744228960574, "loser_pct": 0.8946425577103942, "bias": 0.035427845285331605, "updated_at": "2026-07-02T00:36:03.265204"}
|
{"winner_pct": 0.022019682466754367, "loser_pct": 0.9779803175332457, "bias": 0.03872802057431653, "updated_at": "2026-07-02T00:45:45.564306"}
|
||||||
@@ -1 +1 @@
|
|||||||
{"winner_pct": 0.901115667682602, "loser_pct": 0.09888433231739803, "bias": 0.0019776866463479606, "updated_at": "2026-07-02T00:36:05.897221"}
|
{"winner_pct": 0.9736309318514315, "loser_pct": 0.026369068148568535, "bias": 0.0005273813629713707, "updated_at": "2026-07-02T00:45:47.673568"}
|
||||||
@@ -1 +1 @@
|
|||||||
{"winner_pct": 0.12629635051048638, "loser_pct": 0.8737036494895137, "bias": 0.017474072989790274, "updated_at": "2026-07-02T00:36:07.760371"}
|
{"winner_pct": 0.4249266733297725, "loser_pct": 0.5750733266702275, "bias": 0.01150146653340455, "updated_at": "2026-07-02T00:45:49.780753"}
|
||||||
@@ -1 +1 @@
|
|||||||
{"winner_pct": 0.03603420474156716, "loser_pct": 0.9639657952584328, "bias": 0.019279315905168657, "updated_at": "2026-07-02T00:36:09.643701"}
|
{"winner_pct": 0.5877933411419987, "loser_pct": 0.41220665885800134, "bias": 0.008244133177160027, "updated_at": "2026-07-02T00:45:51.892513"}
|
||||||
@@ -1 +1 @@
|
|||||||
{"winner_pct": 0.5745885997936249, "loser_pct": 0.42541140020637513, "bias": 0.008508228004127504, "updated_at": "2026-07-02T00:36:11.528137"}
|
{"winner_pct": 0.6831599702559918, "loser_pct": 0.31684002974400816, "bias": 0.006336800594880163, "updated_at": "2026-07-02T00:45:54.018131"}
|
||||||
@@ -1 +1 @@
|
|||||||
{"winner_pct": 0.9180078278115366, "loser_pct": 0.08199217218846348, "bias": 0.0016398434437692698, "updated_at": "2026-07-02T00:36:13.369248"}
|
{"winner_pct": 0.986690766691903, "loser_pct": 0.013309233308096953, "bias": 0.00026618466616193907, "updated_at": "2026-07-02T00:45:56.137095"}
|
||||||
@@ -1 +1 @@
|
|||||||
{"winner_pct": 0.19133053163048952, "loser_pct": 0.8086694683695105, "bias": 0.01617338936739021, "updated_at": "2026-07-02T00:36:15.460650"}
|
{"winner_pct": 0.025566719946732226, "loser_pct": 0.9744332800532678, "bias": 0.019488665601065356, "updated_at": "2026-07-02T00:45:58.254879"}
|
||||||
@@ -49,6 +49,12 @@
|
|||||||
"high": 101.33,
|
"high": 101.33,
|
||||||
"low": 92.52,
|
"low": 92.52,
|
||||||
"close": 95.94
|
"close": 95.94
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"date": "2026-07-02",
|
||||||
|
"high": 101.33,
|
||||||
|
"low": 94.41,
|
||||||
|
"close": 95.94
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"000700": [
|
"000700": [
|
||||||
@@ -101,6 +107,12 @@
|
|||||||
"high": 4.77,
|
"high": 4.77,
|
||||||
"low": 4.1,
|
"low": 4.1,
|
||||||
"close": 4.77
|
"close": 4.77
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"date": "2026-07-02",
|
||||||
|
"high": 4.77,
|
||||||
|
"low": 4.77,
|
||||||
|
"close": 4.77
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"001309": [
|
"001309": [
|
||||||
@@ -127,6 +139,12 @@
|
|||||||
"high": 976.0,
|
"high": 976.0,
|
||||||
"low": 880.0,
|
"low": 880.0,
|
||||||
"close": 893.22
|
"close": 893.22
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"date": "2026-07-02",
|
||||||
|
"high": 976.0,
|
||||||
|
"low": 880.0,
|
||||||
|
"close": 893.22
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"002594": [
|
"002594": [
|
||||||
@@ -153,6 +171,12 @@
|
|||||||
"high": 81.65,
|
"high": 81.65,
|
||||||
"low": 78.55,
|
"low": 78.55,
|
||||||
"close": 80.66
|
"close": 80.66
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"date": "2026-07-02",
|
||||||
|
"high": 81.65,
|
||||||
|
"low": 78.55,
|
||||||
|
"close": 80.66
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"00700": [
|
"00700": [
|
||||||
@@ -205,6 +229,12 @@
|
|||||||
"high": 2.08,
|
"high": 2.08,
|
||||||
"low": 2.01,
|
"low": 2.01,
|
||||||
"close": 2.06
|
"close": 2.06
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"date": "2026-07-02",
|
||||||
|
"high": 2.08,
|
||||||
|
"low": 2.01,
|
||||||
|
"close": 2.06
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"00981": [
|
"00981": [
|
||||||
@@ -257,6 +287,12 @@
|
|||||||
"high": 13.22,
|
"high": 13.22,
|
||||||
"low": 12.59,
|
"low": 12.59,
|
||||||
"close": 12.89
|
"close": 12.89
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"date": "2026-07-02",
|
||||||
|
"high": 13.22,
|
||||||
|
"low": 12.59,
|
||||||
|
"close": 12.89
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"01088": [
|
"01088": [
|
||||||
@@ -413,6 +449,12 @@
|
|||||||
"high": 52.6,
|
"high": 52.6,
|
||||||
"low": 50.75,
|
"low": 50.75,
|
||||||
"close": 51.05
|
"close": 51.05
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"date": "2026-07-02",
|
||||||
|
"high": 52.6,
|
||||||
|
"low": 50.75,
|
||||||
|
"close": 51.05
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"02359": [
|
"02359": [
|
||||||
@@ -439,6 +481,12 @@
|
|||||||
"high": 158.4,
|
"high": 158.4,
|
||||||
"low": 151.7,
|
"low": 151.7,
|
||||||
"close": 153.7
|
"close": 153.7
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"date": "2026-07-02",
|
||||||
|
"high": 158.4,
|
||||||
|
"low": 151.7,
|
||||||
|
"close": 153.7
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"02388": [
|
"02388": [
|
||||||
@@ -465,6 +513,12 @@
|
|||||||
"high": 43.6,
|
"high": 43.6,
|
||||||
"low": 41.82,
|
"low": 41.82,
|
||||||
"close": 42.38
|
"close": 42.38
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"date": "2026-07-02",
|
||||||
|
"high": 43.6,
|
||||||
|
"low": 41.82,
|
||||||
|
"close": 42.38
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"02628": [
|
"02628": [
|
||||||
@@ -491,6 +545,12 @@
|
|||||||
"high": 27.18,
|
"high": 27.18,
|
||||||
"low": 26.32,
|
"low": 26.32,
|
||||||
"close": 26.66
|
"close": 26.66
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"date": "2026-07-02",
|
||||||
|
"high": 27.18,
|
||||||
|
"low": 26.32,
|
||||||
|
"close": 26.66
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"06160": [
|
"06160": [
|
||||||
@@ -777,6 +837,12 @@
|
|||||||
"high": 1196.8,
|
"high": 1196.8,
|
||||||
"low": 1166.33,
|
"low": 1166.33,
|
||||||
"close": 1193.01
|
"close": 1193.01
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"date": "2026-07-02",
|
||||||
|
"high": 1196.8,
|
||||||
|
"low": 1166.33,
|
||||||
|
"close": 1193.01
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"600563": [
|
"600563": [
|
||||||
|
|||||||
@@ -100,7 +100,7 @@ class ChipFactors:
|
|||||||
os.environ.pop(k)
|
os.environ.pop(k)
|
||||||
# 从腾讯API取60日K线
|
# 从腾讯API取60日K线
|
||||||
prefix = "sh" if code.startswith(('60','68','51')) else "sz" if code.startswith(('00','30','15')) else "hk"
|
prefix = "sh" if code.startswith(('60','68','51')) else "sz" if code.startswith(('00','30','15')) else "hk"
|
||||||
url = f"http://ifzq.gtimg.cn/appstock/app/fqkline/get?param={prefix}{code},day,,,60,qfq"
|
url = f"http://ifzq.gtimg.cn/appstock/app/fqkline/get?param={prefix}{code},day,,,640,qfq"
|
||||||
try:
|
try:
|
||||||
opener = urllib.request.build_opener(urllib.request.ProxyHandler({}))
|
opener = urllib.request.build_opener(urllib.request.ProxyHandler({}))
|
||||||
req = urllib.request.Request(url, headers={"User-Agent": "Mozilla/5.0"})
|
req = urllib.request.Request(url, headers={"User-Agent": "Mozilla/5.0"})
|
||||||
|
|||||||
@@ -51,6 +51,55 @@ def calc_atr(code, period=14):
|
|||||||
except Exception:
|
except Exception:
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
|
||||||
|
def calc_chip_sr(code, price):
|
||||||
|
"""从筹码分布计算支撑/阻力位。
|
||||||
|
|
||||||
|
返回: {"chip_ss": 筹码强支撑, "chip_sr": 筹码强阻力} 或 None
|
||||||
|
筹码强支撑 = 当前价下方成交量最大的价格区间
|
||||||
|
筹码强阻力 = 当前价上方成交量最大的价格区间
|
||||||
|
|
||||||
|
用法:
|
||||||
|
sr = calc_chip_sr("600519", 1193)
|
||||||
|
if sr:
|
||||||
|
print(f"筹码支撑{sr['chip_ss']} 筹码阻力{sr['chip_sr']}")
|
||||||
|
"""
|
||||||
|
if not price or price <= 0:
|
||||||
|
return None
|
||||||
|
try:
|
||||||
|
# 复用chip_factors的筹码分布构建
|
||||||
|
import sys as _sys
|
||||||
|
_sys.path.insert(0, "/home/hmo/MoFin/scripts")
|
||||||
|
from chip_factors import ChipFactors
|
||||||
|
cf = ChipFactors()
|
||||||
|
chip = cf._build_chip_distribution(code)
|
||||||
|
if not chip:
|
||||||
|
return None
|
||||||
|
total = sum(chip.values())
|
||||||
|
if total <= 0:
|
||||||
|
return None
|
||||||
|
# 2%区间聚合
|
||||||
|
step = max(round(price * 0.02, 2), 1.0)
|
||||||
|
bins = {}
|
||||||
|
for p, v in chip.items():
|
||||||
|
k = round(p / step) * step
|
||||||
|
bins[k] = bins.get(k, 0) + v
|
||||||
|
sb = sorted(bins.items())
|
||||||
|
below = [(p, v) for p, v in sb if p < price]
|
||||||
|
above = [(p, v) for p, v in sb if p >= price]
|
||||||
|
if not below or not above:
|
||||||
|
return None
|
||||||
|
|
||||||
|
# 支撑 = 下方成交量最大的密集区
|
||||||
|
chip_ss = max(below, key=lambda x: x[1])[0]
|
||||||
|
# 阻力 = 上方成交量最大的密集区
|
||||||
|
chip_sr = max(above, key=lambda x: x[1])[0]
|
||||||
|
|
||||||
|
return {"chip_ss": chip_ss, "chip_sr": chip_sr}
|
||||||
|
except Exception as e:
|
||||||
|
print(f" ⚠️ 筹码S/R计算失败: {e}", file=sys.stderr)
|
||||||
|
return None
|
||||||
|
|
||||||
# 提示词版本追踪
|
# 提示词版本追踪
|
||||||
try:
|
try:
|
||||||
from prompt_manager.tracking import record_strategy_generation
|
from prompt_manager.tracking import record_strategy_generation
|
||||||
@@ -542,6 +591,25 @@ def reassess_strategy(code, name, price, cost, shares, current_action,
|
|||||||
except Exception as e:
|
except Exception as e:
|
||||||
print(f" 多周期分析失败: {e}", file=sys.stderr)
|
print(f" 多周期分析失败: {e}", file=sys.stderr)
|
||||||
|
|
||||||
|
# ----- 筹码分布支撑/阻力(中长线参考) -----
|
||||||
|
chip_sr = None
|
||||||
|
try:
|
||||||
|
chip_sr = calc_chip_sr(code, price)
|
||||||
|
if chip_sr:
|
||||||
|
print(f" 筹码: 强撑={chip_sr['chip_ss']} 强压={chip_sr['chip_sr']}")
|
||||||
|
# 与枢轴点对比,判断共振/分歧
|
||||||
|
if ss and ws and pivot:
|
||||||
|
chip_ss_pct = (price - chip_sr['chip_ss']) / price * 100 if chip_sr['chip_ss'] > 0 else 0
|
||||||
|
chip_sr_pct = (chip_sr['chip_sr'] - price) / price * 100 if chip_sr['chip_sr'] > 0 else 0
|
||||||
|
pivot_ss_pct = (price - ss) / price * 100 if ss > 0 else 0
|
||||||
|
pivot_sr_pct = (sr_resist - price) / price * 100 if sr_resist > 0 else 0
|
||||||
|
if abs(chip_ss_pct - pivot_ss_pct) < 3:
|
||||||
|
print(f" ⚡ 支撑共振: 筹码+枢轴均指向{chip_sr['chip_ss']:.0f}附近")
|
||||||
|
if abs(chip_sr_pct - pivot_sr_pct) < 3:
|
||||||
|
print(f" ⚡ 阻力共振: 筹码+枢轴均指向{chip_sr['chip_sr']:.0f}附近")
|
||||||
|
except Exception:
|
||||||
|
pass
|
||||||
|
|
||||||
profit_pct = (price - cost) / cost * 100 if cost else 0
|
profit_pct = (price - cost) / cost * 100 if cost else 0
|
||||||
is_new_entry = (cost == 0) or (shares == 0)
|
is_new_entry = (cost == 0) or (shares == 0)
|
||||||
is_deep_loss = profit_pct < -20
|
is_deep_loss = profit_pct < -20
|
||||||
|
|||||||
Reference in New Issue
Block a user