Count instance win rate by positive PnL and show external closes as manual close.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dekun
2026-06-25 22:27:52 +08:00
parent 0a20ee7eec
commit 448e88ec55
7 changed files with 54 additions and 27 deletions
+2 -6
View File
@@ -192,7 +192,7 @@ from history_window_lib import (
utc_window_to_bj_sql_strings,
utc_window_to_utc_sql_strings,
)
from trade_result_lib import normalize_result_with_pnl
from trade_result_lib import count_winning_trades, normalize_result_with_pnl
def load_env_file(path):
@@ -6270,11 +6270,7 @@ def render_main_page(page="trade", embed_mode=None):
records = [to_effective_trade_dict(r) for r in raw_records]
total = len(records)
miss_count = sum(1 for r in records if (r.get("effective_result") or "") == "错过")
win = sum(
1
for r in records
if (r.get("effective_result") or "") in ("止盈", "保本止盈", "移动止盈")
)
win = count_winning_trades(records)
occupied_miss_total = sum(
1
for r in records