Fix trade log equity_after to chain from initial capital by close time.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
+5
-1
@@ -16,7 +16,7 @@ from zoneinfo import ZoneInfo
|
||||
from contract_specs import calc_position_metrics
|
||||
from ctp_symbol import ths_to_vnpy_symbol
|
||||
from fee_specs import calc_round_trip_fee
|
||||
from trade_log_lib import calc_equity_after
|
||||
from trade_log_lib import calc_equity_after, refresh_trade_log_equity_chain
|
||||
from market_sessions import is_trading_session
|
||||
from symbols import ths_to_codes
|
||||
from vnpy_bridge import (
|
||||
@@ -336,6 +336,10 @@ def write_trade_log(
|
||||
result if result in TRADE_RESULTS else "手动平仓",
|
||||
),
|
||||
)
|
||||
try:
|
||||
refresh_trade_log_equity_chain(conn, capital if capital > 0 else None)
|
||||
except Exception as exc:
|
||||
logger.debug("equity chain refresh after trade log: %s", exc)
|
||||
try:
|
||||
from stats_engine import refresh_stats_cache
|
||||
refresh_stats_cache(conn, capital)
|
||||
|
||||
Reference in New Issue
Block a user