复盘增加左侧条件单与上一个入场周期,K线生成默认勾选。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dekun
2026-10-07 13:34:15 +08:00
parent 03dde1853d
commit 3328b7fcc1
4 changed files with 28 additions and 5 deletions
+9 -1
View File
@@ -669,6 +669,7 @@ def enrich_trade_row(row: dict[str, Any], entry: dict[str, Any] | None = None) -
out["strategy_tag"] = entry.get("strategy_tag")
out["direction_view"] = entry.get("direction_view")
out["entry_logic"] = entry.get("entry_logic")
out["prev_entry_tf"] = entry.get("prev_entry_tf")
out["result_tag"] = entry.get("result_tag")
out["reviewed_at"] = entry.get("reviewed_at") or entry.get("updated_at")
else:
@@ -676,6 +677,7 @@ def enrich_trade_row(row: dict[str, Any], entry: dict[str, Any] | None = None) -
out["strategy_tag"] = None
out["direction_view"] = None
out["entry_logic"] = None
out["prev_entry_tf"] = None
out["result_tag"] = None
out["reviewed_at"] = None
return out
@@ -837,7 +839,7 @@ def list_review_trades(
rows = conn.execute(
f"""
SELECT t.*, e.id AS entry_id, e.strategy_tag AS e_strategy_tag,
e.direction_view, e.entry_logic, e.exit_reason, e.followed_plan,
e.direction_view, e.entry_logic, e.prev_entry_tf, e.exit_reason, e.followed_plan,
e.mistake_tags, e.result_tag, e.note, e.images_json, e.image,
e.reviewed_at, e.updated_at
FROM options_review_trades t
@@ -858,6 +860,7 @@ def list_review_trades(
"strategy_tag": d.pop("e_strategy_tag", None),
"direction_view": d.pop("direction_view", None),
"entry_logic": d.pop("entry_logic", None),
"prev_entry_tf": d.pop("prev_entry_tf", None),
"exit_reason": d.pop("exit_reason", None),
"followed_plan": d.pop("followed_plan", None),
"mistake_tags": d.pop("mistake_tags", None),
@@ -874,6 +877,7 @@ def list_review_trades(
"e_strategy_tag",
"direction_view",
"entry_logic",
"prev_entry_tf",
"exit_reason",
"followed_plan",
"mistake_tags",
@@ -924,10 +928,14 @@ def save_review_entry(
primary = None
if images:
primary = str(images[0].get("file") or "").strip() or None
prev_tf = str(payload.get("prev_entry_tf") or "").strip().lower()
if prev_tf and prev_tf not in ("15m", "1h", "2h", "4h", "8h", "12h"):
prev_tf = ""
fields = {
"strategy_tag": str(payload.get("strategy_tag") or "").strip() or None,
"direction_view": str(payload.get("direction_view") or "").strip() or None,
"entry_logic": str(payload.get("entry_logic") or "").strip() or None,
"prev_entry_tf": prev_tf or None,
"exit_reason": str(payload.get("exit_reason") or "").strip() or None,
"followed_plan": str(payload.get("followed_plan") or "").strip() or None,
"mistake_tags": str(payload.get("mistake_tags") or "").strip() or None,