Isolate CTP in worker process and improve strategy roll UX.
Split vn.py into qihuo-ctp worker with IPC client bridge, keep CTP connected during breaks with cached account fallback, speed up strategy page loads, and allow off-session breakout roll submissions. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
+3
-1
@@ -277,9 +277,11 @@ def should_keep_ctp_connected(
|
||||
minutes_before: int = 30,
|
||||
minutes_after: int = 30,
|
||||
) -> bool:
|
||||
"""是否处于应连接 CTP 的窗口:交易时段 + 盘前 + 盘后宽限。"""
|
||||
"""是否处于应连接 CTP 的窗口:交易时段 + 小节/午间休盘 + 盘前 + 盘后宽限。"""
|
||||
if is_trading_session(now):
|
||||
return True
|
||||
if is_morning_break(now) or is_lunch_break(now):
|
||||
return True
|
||||
if in_postmarket_grace_window(now, minutes_after=minutes_after):
|
||||
return True
|
||||
return in_premarket_connect_window(now, minutes_before=minutes_before)
|
||||
|
||||
Reference in New Issue
Block a user