mirror of
https://ghfast.top/https://github.com/aeroxw/easy-tdx.git
synced 2026-09-12 18:04:16 +08:00
release: v1.14.2 — 缠论 JSON 可视化字段增强(中枢/买卖点/背驰补日期)
This commit is contained in:
@@ -99,6 +99,8 @@ class ChanlunResult:
|
||||
"gg": round(zs.gg, 2),
|
||||
"dd": round(zs.dd, 2),
|
||||
"line_count": zs.line_count,
|
||||
"start_date": zs.start.k.date.strftime("%Y-%m-%d") if zs.start else None,
|
||||
"end_date": zs.end.k.date.strftime("%Y-%m-%d") if zs.end else None,
|
||||
"done": zs.done,
|
||||
}
|
||||
for zs in self.zss
|
||||
@@ -117,6 +119,7 @@ class ChanlunResult:
|
||||
"mmds": [
|
||||
{
|
||||
"type": mmd.mmd_type.value,
|
||||
"date": mmd.bi.end.k.date.strftime("%Y-%m-%d") if mmd.bi else None,
|
||||
"msg": mmd.msg,
|
||||
}
|
||||
for mmd in self.mmds
|
||||
@@ -125,6 +128,8 @@ class ChanlunResult:
|
||||
{
|
||||
"type": bc.bc_type.value,
|
||||
"bc": bc.bc,
|
||||
"curr_date": bc.curr.end.k.date.strftime("%Y-%m-%d") if bc.curr else None,
|
||||
"prev_date": bc.prev.end.k.date.strftime("%Y-%m-%d") if bc.prev else None,
|
||||
"msg": bc.msg,
|
||||
}
|
||||
for bc in self.bcs
|
||||
|
||||
@@ -75,6 +75,8 @@ def _check_bi_level_beichi(bis: list[BI]) -> list[BC]:
|
||||
bc_type=BCType.BI,
|
||||
bc=True,
|
||||
zs=None,
|
||||
curr=curr,
|
||||
prev=prev,
|
||||
msg=(
|
||||
f"笔背驰: 笔[{curr.index}] 力度={curr_force:.2f} "
|
||||
f"< 笔[{prev.index}] 力度={prev_force:.2f}"
|
||||
@@ -108,6 +110,8 @@ def _check_pz_beichi(bis: list[BI], zss: list[ZS]) -> list[BC]:
|
||||
bc_type=BCType.PZ,
|
||||
bc=True,
|
||||
zs=zs,
|
||||
curr=last_bi,
|
||||
prev=first_bi,
|
||||
msg=(
|
||||
f"盘整背驰: 中枢[{zs.index}] 内末笔力度={last_force:.2f} "
|
||||
f"< 首笔力度={first_force:.2f}"
|
||||
@@ -138,6 +142,8 @@ def _check_qs_beichi(bis: list[BI], zss: list[ZS]) -> list[BC]:
|
||||
bc_type=BCType.QS,
|
||||
bc=True,
|
||||
zs=curr_zs,
|
||||
curr=curr_zs.lines[-1],
|
||||
prev=prev_zs.lines[-1],
|
||||
msg=(
|
||||
f"趋势背驰(下): 中枢[{curr_zs.index}] 离开力度={curr_exit_force:.2f} "
|
||||
f"< 中枢[{prev_zs.index}] 离开力度={prev_exit_force:.2f}"
|
||||
@@ -155,6 +161,8 @@ def _check_qs_beichi(bis: list[BI], zss: list[ZS]) -> list[BC]:
|
||||
bc_type=BCType.QS,
|
||||
bc=True,
|
||||
zs=curr_zs,
|
||||
curr=curr_zs.lines[-1],
|
||||
prev=prev_zs.lines[-1],
|
||||
msg=(
|
||||
f"趋势背驰(上): 中枢[{curr_zs.index}] 离开力度={curr_exit_force:.2f} "
|
||||
f"< 中枢[{prev_zs.index}] 离开力度={prev_exit_force:.2f}"
|
||||
|
||||
@@ -68,6 +68,7 @@ def _check_buy_point(bi: BI, zs: ZS, all_bis: list[BI]) -> MMD | None:
|
||||
return MMD(
|
||||
mmd_type=MMDType.BUY_1,
|
||||
zs=zs,
|
||||
bi=bi,
|
||||
msg=f"中枢下方力度衰减,一类买点 (l={bi.low:.2f} < zd={zs.zd:.2f})",
|
||||
)
|
||||
|
||||
@@ -82,6 +83,7 @@ def _check_buy_point(bi: BI, zs: ZS, all_bis: list[BI]) -> MMD | None:
|
||||
return MMD(
|
||||
mmd_type=MMDType.BUY_2,
|
||||
zs=zs,
|
||||
bi=bi,
|
||||
msg=f"回调不创新低,二类买点 (l={bi.low:.2f})",
|
||||
)
|
||||
|
||||
@@ -90,6 +92,7 @@ def _check_buy_point(bi: BI, zs: ZS, all_bis: list[BI]) -> MMD | None:
|
||||
return MMD(
|
||||
mmd_type=MMDType.BUY_3,
|
||||
zs=zs,
|
||||
bi=bi,
|
||||
msg=f"回调不破中枢上沿,三类买点 (l={bi.low:.2f} > zg={zs.zg:.2f})",
|
||||
)
|
||||
|
||||
@@ -104,6 +107,7 @@ def _check_sell_point(bi: BI, zs: ZS, all_bis: list[BI]) -> MMD | None:
|
||||
return MMD(
|
||||
mmd_type=MMDType.SELL_1,
|
||||
zs=zs,
|
||||
bi=bi,
|
||||
msg=f"中枢上方力度衰减,一类卖点 (h={bi.high:.2f} > zg={zs.zg:.2f})",
|
||||
)
|
||||
|
||||
@@ -117,6 +121,7 @@ def _check_sell_point(bi: BI, zs: ZS, all_bis: list[BI]) -> MMD | None:
|
||||
return MMD(
|
||||
mmd_type=MMDType.SELL_2,
|
||||
zs=zs,
|
||||
bi=bi,
|
||||
msg=f"反弹不创新高,二类卖点 (h={bi.high:.2f})",
|
||||
)
|
||||
|
||||
@@ -125,6 +130,7 @@ def _check_sell_point(bi: BI, zs: ZS, all_bis: list[BI]) -> MMD | None:
|
||||
return MMD(
|
||||
mmd_type=MMDType.SELL_3,
|
||||
zs=zs,
|
||||
bi=bi,
|
||||
msg=f"反弹不破中枢下沿,三类卖点 (h={bi.high:.2f} < zd={zs.zd:.2f})",
|
||||
)
|
||||
|
||||
|
||||
@@ -183,6 +183,7 @@ class MMD:
|
||||
|
||||
mmd_type: MMDType
|
||||
zs: ZS | None = None
|
||||
bi: BI | None = None # 触发该买卖点的笔(用于可视化锚定日期)
|
||||
msg: str = ""
|
||||
|
||||
def __str__(self) -> str:
|
||||
@@ -204,6 +205,8 @@ class BC:
|
||||
bc_type: BCType
|
||||
bc: bool = False # 是否背驰
|
||||
zs: ZS | None = None
|
||||
curr: BI | XD | None = None # 当前背驰笔/线段(用于可视化锚定日期)
|
||||
prev: BI | XD | None = None # 前一同向笔/线段(力度对照基准)
|
||||
msg: str = ""
|
||||
|
||||
def __str__(self) -> str:
|
||||
|
||||
Reference in New Issue
Block a user