Gate opens when ATM-spot offset exceeds configurable max (default 3).
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -74,3 +74,12 @@ def test_eligible_skips_short_ttm() -> None:
|
||||
def test_option_leverage() -> None:
|
||||
assert abs((option_leverage(1850, 18.5) or 0) - 100) < 1e-9
|
||||
assert option_leverage(1850, 0) is None
|
||||
|
||||
|
||||
def test_atm_allows_open_offset() -> None:
|
||||
from app.strategy.selection import atm_allows_open, atm_open_offset
|
||||
|
||||
assert atm_open_offset(1850, 1852.5) == 2.5
|
||||
assert atm_allows_open(1850, 1852.5, max_offset=3) is True
|
||||
assert atm_allows_open(1850, 1854, max_offset=3) is False
|
||||
assert atm_allows_open(1850, 1860, max_offset=3) is False
|
||||
|
||||
Reference in New Issue
Block a user