Fix semi moneyness reset and show Call/Put ladder by view.
Use dirty ref so refresh cannot overwrite unsaved params; ladder fetches books for the selected side. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -21,14 +21,15 @@ async def market_snapshot(_user: Annotated[str, Depends(require_user)]) -> dict:
|
||||
@router.get("/option-ladder")
|
||||
async def market_option_ladder(
|
||||
_user: Annotated[str, Depends(require_user)],
|
||||
wings: int = Query(default=4, ge=1, le=12),
|
||||
wings: int = Query(default=5, ge=1, le=12),
|
||||
side: str = Query(default="call", pattern="^(call|put)$"),
|
||||
) -> dict:
|
||||
"""半自动页 T 型报价:ATM 上下各 wings 档。"""
|
||||
"""半自动页单边报价列表:ATM 上下各 wings 档;side=call|put。"""
|
||||
gw = get_gateway()
|
||||
ladder = getattr(gw, "option_ladder", None)
|
||||
if not callable(ladder):
|
||||
raise HTTPException(status_code=501, detail="当前会话不支持 option-ladder")
|
||||
return ladder(wings=wings)
|
||||
return ladder(wings=wings, side=side)
|
||||
|
||||
|
||||
@router.post("/realign")
|
||||
|
||||
Reference in New Issue
Block a user