Gate order cancel to trading hours and sync trade logs from CTP.
Disable cancel UI outside sessions, query exchange fills for records, and label local vs counterparty rows. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
+2
-1
@@ -7,6 +7,7 @@ from datetime import datetime
|
||||
from typing import Any, Callable, Optional
|
||||
from zoneinfo import ZoneInfo
|
||||
|
||||
from market_sessions import is_trading_session
|
||||
from vnpy_bridge import ctp_cancel_order, ctp_list_active_orders, ctp_status
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
@@ -132,7 +133,7 @@ def reconcile_pending_orders(
|
||||
continue
|
||||
|
||||
if vt_oid and vt_oid in active_orders:
|
||||
if age >= limit_sec:
|
||||
if age >= limit_sec and is_trading_session():
|
||||
if ctp_cancel_order(mode, vt_oid):
|
||||
conn.execute(
|
||||
"UPDATE trade_order_monitors SET status='closed' WHERE id=?",
|
||||
|
||||
Reference in New Issue
Block a user