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:
@@ -193,7 +193,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):
|
||||
@@ -6766,11 +6766,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
|
||||
|
||||
Reference in New Issue
Block a user