feat: option lab
This commit is contained in:
@@ -248,3 +248,19 @@ def saxo_iv_snapshot(symbol: str):
|
||||
def saxo_iv_history(symbol: str, days: int = Query(90, ge=1, le=730)):
|
||||
from services.saxo_iv_engine import get_saxo_iv_history
|
||||
return get_saxo_iv_history(symbol, days)
|
||||
|
||||
|
||||
@router.get("/pricing-check")
|
||||
def saxo_pricing_check(
|
||||
ticker: str = Query(...),
|
||||
date_a: str = Query(..., description="YYYY-MM-DD"),
|
||||
date_b: str = Query(..., description="YYYY-MM-DD"),
|
||||
target_dte: Optional[int] = Query(None, ge=1, le=365, description="Overrides the default (expiry closest to date_b)"),
|
||||
):
|
||||
"""Options Lab — was this option well priced between two dates? Picks the strike closest
|
||||
to the underlying's actual outcome at date_b (hindsight), and by default the expiry
|
||||
closest to date_b too (same hindsight principle, overridable via target_dte), reprices
|
||||
it at both dates from real Saxo history, and decomposes the price move into
|
||||
Delta/Theta/Vega contributions — see services.pricing_check.analyze_option_pricing."""
|
||||
from services.pricing_check import analyze_option_pricing
|
||||
return analyze_option_pricing(ticker, date_a, date_b, target_dte)
|
||||
|
||||
Reference in New Issue
Block a user