Use bid1-only option closes with hard-disabled market exits.
Manual close checks liquidity only; target auto still requires 2x recycle hold once, then reuses the shared bid1 executor. Add /options/guide doc and update hedge-plan refs. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -185,11 +185,13 @@ def test_format_quote_liquidity():
|
||||
def test_estimate_close_by_bids_full_depth():
|
||||
from lib.options.options_pricing_lib import estimate_close_by_bids
|
||||
|
||||
# 多档估算需显式 max_levels;默认只估买一
|
||||
out = estimate_close_by_bids(
|
||||
[{"px": 12.3, "sz": 2}, {"px": 12.1, "sz": 3}],
|
||||
4,
|
||||
ct_mult=0.01,
|
||||
premium_paid=0.4,
|
||||
max_levels=5,
|
||||
)
|
||||
assert out["covered_sheets"] == 4
|
||||
assert out["uncovered_sheets"] == 0
|
||||
@@ -199,6 +201,16 @@ def test_estimate_close_by_bids_full_depth():
|
||||
assert out["estimated_pnl_ratio_pct"] == 22.0
|
||||
assert [x["sheets"] for x in out["levels"]] == [2, 2]
|
||||
|
||||
bid1 = estimate_close_by_bids(
|
||||
[{"px": 12.3, "sz": 2}, {"px": 12.1, "sz": 3}],
|
||||
4,
|
||||
ct_mult=0.01,
|
||||
premium_paid=0.4,
|
||||
)
|
||||
assert bid1["covered_sheets"] == 2
|
||||
assert bid1["uncovered_sheets"] == 2
|
||||
assert [x["sheets"] for x in bid1["levels"]] == [2]
|
||||
|
||||
|
||||
def test_estimate_close_by_bids_partial_depth():
|
||||
from lib.options.options_pricing_lib import estimate_close_by_bids
|
||||
|
||||
Reference in New Issue
Block a user