Gate opens when ATM-spot offset exceeds configurable max (default 3).
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -52,6 +52,9 @@ class StrategyEngine:
|
||||
min_opt_lev = self.ledger.get_setting_float(
|
||||
"min_option_leverage", s.min_option_leverage
|
||||
)
|
||||
max_atm_off = self.ledger.get_setting_float(
|
||||
"max_atm_open_offset", s.max_atm_open_offset
|
||||
)
|
||||
rest_until = row["rest_until_ms"]
|
||||
rest_left = 0
|
||||
if rest_until:
|
||||
@@ -77,6 +80,7 @@ class StrategyEngine:
|
||||
"leverage": leverage,
|
||||
"min_option_hours": min_hours,
|
||||
"min_option_leverage": min_opt_lev,
|
||||
"max_atm_open_offset": max_atm_off,
|
||||
"can_open": allow_open,
|
||||
"last_error": last_error,
|
||||
"position": upl,
|
||||
@@ -306,7 +310,7 @@ class StrategyEngine:
|
||||
pick = await get_session().pick_for_open_async()
|
||||
if pick is None:
|
||||
self._set_state(
|
||||
last_error="无合格期权:需剩余时长与杠杆倍数同时满足"
|
||||
last_error="无合格期权:需剩余时长、ATM开仓偏差与杠杆同时满足"
|
||||
)
|
||||
return
|
||||
|
||||
|
||||
Reference in New Issue
Block a user