复盘增加左侧条件单与上一个入场周期,K线生成默认勾选。
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -130,6 +130,7 @@ def init_options_review_tables(conn: sqlite3.Connection) -> None:
|
||||
_ensure_column(conn, "options_review_trades", "target_price_up", "REAL")
|
||||
_ensure_column(conn, "options_review_trades", "target_price_down", "REAL")
|
||||
_ensure_column(conn, "options_review_trades", "profit_rr", "REAL")
|
||||
_ensure_column(conn, "options_review_entries", "prev_entry_tf", "TEXT")
|
||||
|
||||
|
||||
def _ensure_column(conn: sqlite3.Connection, table: str, col: str, typedef: str) -> None:
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -314,6 +314,15 @@
|
||||
<select id="or-f-entry" title="入场逻辑" style="width:100%;margin-bottom:6px;box-sizing:border-box">
|
||||
<option value="">入场逻辑</option>
|
||||
</select>
|
||||
<select id="or-f-prev-tf" title="上一个入场周期" style="width:100%;margin-bottom:6px;box-sizing:border-box">
|
||||
<option value="">上一个入场周期</option>
|
||||
<option value="15m">15m</option>
|
||||
<option value="1h">1h</option>
|
||||
<option value="2h">2h</option>
|
||||
<option value="4h">4h</option>
|
||||
<option value="8h">8h</option>
|
||||
<option value="12h">12h</option>
|
||||
</select>
|
||||
|
||||
<div class="journal-upload-slots" id="or-upload-slots">
|
||||
{% for tf in ['5m', '15m', '1h', '4h'] %}
|
||||
@@ -329,7 +338,7 @@
|
||||
|
||||
<div class="form-row or-chart-options journal-chart-options hidden" id="or-chart-options" style="flex-wrap:wrap;align-items:center">
|
||||
<label style="display:flex;align-items:center;gap:6px;font-size:.82rem">
|
||||
<input type="checkbox" id="or-exchange-chart" value="true">
|
||||
<input type="checkbox" id="or-exchange-chart" value="true" checked>
|
||||
保存后后台生成 K 线图并作为截图(不阻塞保存)
|
||||
</label>
|
||||
<label style="font-size:.82rem;color:#9aa">周期1</label>
|
||||
@@ -447,4 +456,4 @@
|
||||
</section>
|
||||
</div>
|
||||
|
||||
<script src="/static/options_review.js?v=23"></script>
|
||||
<script src="/static/options_review.js?v=24"></script>
|
||||
|
||||
Reference in New Issue
Block a user