fix(hedge): filter options-chain by min hours and strike interval for option-primary
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -139,6 +139,14 @@ class TestOptionPrimary(unittest.TestCase):
|
||||
self.assertTrue(out["option_primary"])
|
||||
self.assertEqual(len(out["scenarios"]), 2)
|
||||
|
||||
def test_hours_to_expiry_from_ms(self):
|
||||
from lib.hedge_plan.hedge_plan_option_primary_lib import hours_to_expiry_from_ms
|
||||
|
||||
now = 1_700_000_000_000.0
|
||||
# +40h in ms
|
||||
h = hours_to_expiry_from_ms(now + 40 * 3600 * 1000, now_ms=now)
|
||||
self.assertAlmostEqual(h, 40.0, places=3)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
|
||||
Reference in New Issue
Block a user