Split OO budget per leg and size Call/Put independently.
Each half of the risk budget buys its own qty from ask; equal qty no longer forced. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -152,16 +152,17 @@ def assess_open_capacity(
|
||||
ca = float(snap.call.ask)
|
||||
if pa is None and snap.put and snap.put.ask:
|
||||
pa = float(snap.put.ask)
|
||||
except Exception:
|
||||
pass
|
||||
cush = float(
|
||||
ledger.get_setting_float("oo_budget_cushion", s.oo_budget_cushion)
|
||||
or s.oo_budget_cushion
|
||||
)
|
||||
cush = min(1.0, max(0.5, cush))
|
||||
except Exception:
|
||||
pass
|
||||
if ca is not None and pa is not None and ca > 0 and pa > 0:
|
||||
# 与定仓一致:按预留后的权利金需求估资金门
|
||||
premium_need = (ca + pa) * opt_qty * (1.0 + fee_rate) * cush
|
||||
call_q = float(opt_qty)
|
||||
put_q = float(
|
||||
ledger.get_setting_float("oo_put_qty_eth", call_q) or call_q
|
||||
)
|
||||
# 与定仓一致:两腿各自权利金
|
||||
premium_need = (
|
||||
(ca * call_q + pa * put_q) * (1.0 + fee_rate)
|
||||
)
|
||||
else:
|
||||
premium_need = None
|
||||
margin_need = 0.0
|
||||
|
||||
Reference in New Issue
Block a user