Fix semi open stalls: one-leg asks, OTM realign, clearer pick errors.
Monitor no longer shows ATM Put bias while semi-auto is authorized for Call. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -76,15 +76,16 @@ def decide_fixed(
|
||||
) -> Signal | None:
|
||||
"""
|
||||
固定方向:
|
||||
- 永续多 → 买 Put
|
||||
- 永续空 → 买 Call
|
||||
- 永续多 → 买 Put(只需 Put 卖一)
|
||||
- 永续空 → 买 Call(只需 Call 卖一)
|
||||
对侧卖一缺失时用本侧占位,避免半自动虚值因对侧盘口空而拒单。
|
||||
"""
|
||||
if call_ask is None or put_ask is None:
|
||||
return None
|
||||
side = (perp_side or "").strip().lower()
|
||||
ca = float(call_ask)
|
||||
pa = float(put_ask)
|
||||
if side == "long":
|
||||
if put_ask is None or float(put_ask) <= 0:
|
||||
return None
|
||||
pa = float(put_ask)
|
||||
ca = float(call_ask) if call_ask is not None and float(call_ask) > 0 else pa
|
||||
return Signal(
|
||||
bias="fixed_long_put",
|
||||
option_side="put",
|
||||
@@ -93,6 +94,10 @@ def decide_fixed(
|
||||
put_ask=pa,
|
||||
)
|
||||
if side == "short":
|
||||
if call_ask is None or float(call_ask) <= 0:
|
||||
return None
|
||||
ca = float(call_ask)
|
||||
pa = float(put_ask) if put_ask is not None and float(put_ask) > 0 else ca
|
||||
return Signal(
|
||||
bias="fixed_short_call",
|
||||
option_side="call",
|
||||
|
||||
Reference in New Issue
Block a user