first commit

This commit is contained in:
dekun
2026-08-01 10:33:19 +08:00
commit d9a34d4f20
72 changed files with 5499 additions and 0 deletions
+14
View File
@@ -0,0 +1,14 @@
"""杠杆口径 v1:杠杆 = 标的指数 ÷ 期权卖一(ask)。"""
from __future__ import annotations
LEVERAGE_FORMULA_VERSION = "1.0"
def option_leverage(index_px: float, ask: float | None) -> float | None:
"""index_px / askask 无效时返回 None。"""
if index_px is None or index_px <= 0:
return None
if ask is None or ask <= 0:
return None
return float(index_px) / float(ask)