修复期权到期结算漏推企业微信:页面同步与模拟盘结算一并通知。
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -760,6 +760,13 @@ class SimBroker:
|
||||
conn.execute("DELETE FROM sim_option_positions WHERE inst_id=?", (inst_id,))
|
||||
try:
|
||||
closed_at = _now()
|
||||
open_ids = [
|
||||
int(r["id"])
|
||||
for r in conn.execute(
|
||||
"SELECT id FROM options_trades WHERE inst_id=? AND status='open'",
|
||||
(inst_id,),
|
||||
).fetchall()
|
||||
]
|
||||
conn.execute(
|
||||
"""
|
||||
UPDATE options_trades
|
||||
@@ -783,6 +790,18 @@ class SimBroker:
|
||||
inst_id,
|
||||
),
|
||||
)
|
||||
if open_ids:
|
||||
from lib.options.options_notify_lib import (
|
||||
active_options_notify_cfg,
|
||||
notify_options_close_trade_ids,
|
||||
)
|
||||
|
||||
notify_options_close_trade_ids(
|
||||
active_options_notify_cfg(),
|
||||
conn,
|
||||
open_ids,
|
||||
reason="到期结算",
|
||||
)
|
||||
except Exception:
|
||||
pass
|
||||
conn.commit()
|
||||
|
||||
Reference in New Issue
Block a user