Treat option-option amplitude as a maximum cap.
Reject opens when range exceeds the setting; update UI and docs labels. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -442,7 +442,7 @@ class StrategySession:
|
||||
return self._apply_pair(pair, mark=float(mark), idx=idx)
|
||||
|
||||
def align_oo_instruments(self) -> OptionPair | None:
|
||||
"""期期监控:按振幅高低点选虚值 Call/Put(展示用;振幅不足仍对齐候选)。"""
|
||||
"""期期监控:按振幅高低点选虚值 Call/Put(展示用;振幅超限仍对齐候选)。"""
|
||||
from ..exchange.candles import fetch_amplitude_hl_for_runtime
|
||||
from .oo_selection import select_oo_pair
|
||||
|
||||
@@ -465,8 +465,8 @@ class StrategySession:
|
||||
"mid": float(amp.mid),
|
||||
"range_pct": float(amp.range_pct),
|
||||
"hours": float(amp_hours),
|
||||
"min_pct": float(amp_pct),
|
||||
"ok": float(amp.range_pct) + 1e-12 >= float(amp_pct),
|
||||
"max_pct": float(amp_pct),
|
||||
"ok": float(amp.range_pct) <= float(amp_pct) + 1e-12,
|
||||
}
|
||||
contracts = self.ex.list_option_contracts(s.option_inst_family)
|
||||
skip = _skip_expiry_ymds_for_next()
|
||||
@@ -518,9 +518,9 @@ class StrategySession:
|
||||
if amp is None:
|
||||
logger.info("oo: amplitude candles unavailable")
|
||||
return None
|
||||
if float(amp.range_pct) + 1e-12 < float(amp_pct):
|
||||
if float(amp.range_pct) > float(amp_pct) + 1e-12:
|
||||
logger.info(
|
||||
"oo: amplitude %.3f%% < need %.3f%% (H=%.2f L=%.2f)",
|
||||
"oo: amplitude %.3f%% > max %.3f%% (H=%.2f L=%.2f)",
|
||||
amp.range_pct,
|
||||
amp_pct,
|
||||
amp.high,
|
||||
@@ -584,7 +584,7 @@ class StrategySession:
|
||||
"mid": float(amp.mid),
|
||||
"range_pct": float(amp.range_pct),
|
||||
"hours": float(amp_hours),
|
||||
"min_pct": float(amp_pct),
|
||||
"max_pct": float(amp_pct),
|
||||
"ok": True,
|
||||
}
|
||||
self._apply_pair(pair, mark=underlying, idx=idx)
|
||||
@@ -837,8 +837,8 @@ class StrategySession:
|
||||
"mid": float(amp.mid),
|
||||
"range_pct": float(amp.range_pct),
|
||||
"hours": float(amp_hours),
|
||||
"min_pct": float(_amp_pct),
|
||||
"ok": float(amp.range_pct) + 1e-12 >= float(_amp_pct),
|
||||
"max_pct": float(_amp_pct),
|
||||
"ok": float(amp.range_pct) <= float(_amp_pct) + 1e-12,
|
||||
}
|
||||
contracts = self.ex.list_option_contracts(self.settings.option_inst_family)
|
||||
picked = select_oo_pair(
|
||||
|
||||
Reference in New Issue
Block a user