File size: 1,115 Bytes
1243c9b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
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")