feat: saxo connector
This commit is contained in:
@@ -86,6 +86,19 @@ def snapshot_now(symbol: str):
|
||||
return {"symbol": symbol.upper(), "rows_saved": len(rows)}
|
||||
|
||||
|
||||
@router.get("/quote/{symbol}")
|
||||
def quote(symbol: str, asset_type: str = Query("FxSpot")):
|
||||
"""Basic (non-options) price test — isolates whether NoDataAccess is options-specific
|
||||
or a broader account restriction, independently of the options-chain subscription."""
|
||||
from services.saxo_client import get_price_quote, SaxoNotConnected, SaxoApiError
|
||||
try:
|
||||
return get_price_quote(symbol, asset_type=asset_type)
|
||||
except SaxoNotConnected as e:
|
||||
raise HTTPException(status_code=401, detail=str(e))
|
||||
except (ValueError, SaxoApiError) as e:
|
||||
raise HTTPException(status_code=502, detail=str(e))
|
||||
|
||||
|
||||
@router.get("/history")
|
||||
def history(
|
||||
symbol: Optional[str] = Query(None),
|
||||
|
||||
Reference in New Issue
Block a user