修复趋势回调顺势加仓的交易记录

This commit is contained in:
dekun
2026-05-29 18:39:40 +08:00
parent 7af2717331
commit 81f27765ca
10 changed files with 202 additions and 47 deletions
+6 -1
View File
@@ -25,8 +25,12 @@ from strategy_trend_lib import (
calc_risk_fraction,
validate_trend_bounds,
)
from strategy_trade_labels import (
ENTRY_REASON_TREND_PULLBACK,
MONITOR_TYPE_TREND_PULLBACK,
)
MONITOR_TYPE_TREND = "趋势回调"
MONITOR_TYPE_TREND = MONITOR_TYPE_TREND_PULLBACK
def trend_add_zone_label(direction: str) -> str:
@@ -370,6 +374,7 @@ def _finalize_plan(cfg: dict, conn, row, result_label: str, exit_price: float) -
result=res,
opened_at=opened_at,
closed_at=closed_at,
entry_reason=ENTRY_REASON_TREND_PULLBACK,
)
if "trend_plan_id" in inspect.signature(m.insert_trade_record).parameters:
m.insert_trade_record(**kwargs, trend_plan_id=plan_id)