StockPred-Backend / app /schemas.py
Anurag33Gaikwad's picture
Upload 15 files
1243c9b verified
Raw
History Blame
1.12 kB
from typing import List, Literal, Optional
from pydantic import BaseModel, Field
SignalType = Literal["BUY", "SELL", "HOLD", "STRONG BUY", "STRONG SELL"]
VolatilityLevel = Literal["Low", "Medium", "High"]
class Candle(BaseModel):
date: str
price: float
class ForecastPoint(BaseModel):
day: int
price: float
lower: float
upper: float
class PredictionResponse(BaseModel):
ticker: str
currentPrice: float
targetPrice: float
predictedChange: float
signal: SignalType
rsi: float
macd: str
volatility: VolatilityLevel
historicalPrices: List[Candle]
predictedPrice: float
forecastData: List[ForecastPoint]
class HistoryResponse(BaseModel):
ticker: str
historicalPrices: List[Candle]
class ChartForecastPoint(BaseModel):
date: str
price: float
lower: float
upper: float
class ChartForecastResponse(BaseModel):
ticker: str
points: List[ChartForecastPoint]
class HealthResponse(BaseModel):
status: str
modelLoaded: bool
version: str = Field(default="1.0.0")