Gate one-open-per-expiry by historical expiry_ymd across days.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -873,17 +873,17 @@ class StrategyEngine:
|
||||
if pick is not None and one_expiry_per_day:
|
||||
from .clock import (
|
||||
expiry_blocked_by_one_per_day,
|
||||
used_expiry_ymds_for_day,
|
||||
used_expiry_ymds,
|
||||
)
|
||||
|
||||
used = used_expiry_ymds_for_day(self.db)
|
||||
used = used_expiry_ymds(self.db)
|
||||
if expiry_blocked_by_one_per_day(
|
||||
pick.pair.expiry_ymd, used, enabled=True
|
||||
):
|
||||
self._set_state(
|
||||
phase="idle",
|
||||
last_error=(
|
||||
f"同到期日一天只开一次:今日已用过 {pick.pair.expiry_ymd},"
|
||||
f"每个到期只开一次:已用过 {pick.pair.expiry_ymd},"
|
||||
"请等下一到期日"
|
||||
),
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user