first commit
This commit is contained in:
27
app/schemas/sr_level.py
Normal file
27
app/schemas/sr_level.py
Normal file
@@ -0,0 +1,27 @@
|
||||
"""Pydantic schemas for S/R level endpoints."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from datetime import datetime
|
||||
from typing import Literal
|
||||
|
||||
from pydantic import BaseModel, Field
|
||||
|
||||
|
||||
class SRLevelResult(BaseModel):
|
||||
"""A single support/resistance level."""
|
||||
|
||||
id: int
|
||||
price_level: float
|
||||
type: Literal["support", "resistance"]
|
||||
strength: int = Field(ge=0, le=100)
|
||||
detection_method: Literal["volume_profile", "pivot_point", "merged"]
|
||||
created_at: datetime
|
||||
|
||||
|
||||
class SRLevelResponse(BaseModel):
|
||||
"""Envelope-ready S/R levels response."""
|
||||
|
||||
symbol: str
|
||||
levels: list[SRLevelResult]
|
||||
count: int
|
||||
Reference in New Issue
Block a user