增加关键位人工输入

This commit is contained in:
dekun
2026-05-22 22:15:46 +08:00
parent 593f8fcff5
commit ac762b540c
20 changed files with 1541 additions and 42 deletions
+19 -8
View File
@@ -63,18 +63,16 @@ class WeComNotifier:
stop_pct = max(0.0, min(stop_pct, 10.0))
long_m = 1.0 - stop_pct / 100.0
short_m = 1.0 + stop_pct / 100.0
stop_a = _px(breakout_low * long_m if signal_side == "LONG" else breakout_high * short_m)
stop_b = _px(range_low * long_m if signal_side == "LONG" else range_high * short_m)
if abs(stop_pct - round(stop_pct)) < 1e-9:
stop_pct_label = str(int(round(stop_pct)))
else:
stop_pct_label = f"{stop_pct:.4f}".rstrip("0").rstrip(".") or "0"
box_size = (range_high - range_low)
tp_a = _px(confirm_close + box_size if signal_side == "LONG" else confirm_close - box_size)
tp_b = _px(confirm_close + box_size * 1.5 if signal_side == "LONG" else confirm_close - box_size * 1.5)
stop_sl = _px(breakout_low * long_m if signal_side == "LONG" else breakout_high * short_m)
tp_sl = _px(confirm_close + box_size if signal_side == "LONG" else confirm_close - box_size)
t_cn = format_beijing_wall(utc_now())
content = (
"🚨 Gate 突破预警信号\n"
"🚨 Gate 扫描突破参考(自动箱体)\n"
"━━━━━━━━━━━━━━\n"
f"🔹 交易对:{pair_line}\n"
f"⏱️ K线周期:{bar_cn}\n"
@@ -90,9 +88,10 @@ class WeComNotifier:
"📌 关键价位:\n"
f" {'箱体下沿' if signal_side == 'LONG' else '箱体上沿'}{key_ref}\n"
f" 确认K收盘价:{_px(confirm_close)}\n"
"💡 操作提示\n"
f" 1. 入场区间A止盈 {signal_cn} 箱体1.0倍距离{tp_a}),止损 突破K高低点±{stop_pct_label}%{stop_a}\n"
f" 2. 入场区间B:止盈 {signal_cn} 箱体1.5倍距离({tp_b}),止损 箱体边沿±{stop_pct_label}%{stop_b}\n"
"💡 参考计划(非关键位录入)\n"
f" · 止盈{signal_cn} 箱体1.0倍({tp_sl}\n"
f" · 止损:突破K极值外 {stop_pct_label}%{stop_sl}\n"
" · 正式下单请以「关键位突破监控」录入上下沿后的方案为准。\n"
f"⏰ 触发时间:{t_cn}(北京时间 UTC+8"
)
payload = {
@@ -106,6 +105,18 @@ class WeComNotifier:
resp = await client.post(self.conf.webhook, json=payload)
resp.raise_for_status()
async def send_text(self, content: str) -> None:
payload = {
"msgtype": "text",
"text": {
"content": content,
"mentioned_mobile_list": self.conf.mentioned_mobile_list,
},
}
async with httpx.AsyncClient(**self._client_kwargs()) as client:
resp = await client.post(self.conf.webhook, json=payload)
resp.raise_for_status()
async def send_funnel_priority(
self,
symbol: str,