Anurag33Gaikwad commited on
Commit
642e10c
·
verified ·
1 Parent(s): a753fbd

Update app/schemas.py

Browse files
Files changed (1) hide show
  1. app/schemas.py +53 -47
app/schemas.py CHANGED
@@ -1,47 +1,53 @@
1
- from typing import List, Literal, Optional
2
- from pydantic import BaseModel, Field
3
-
4
- SignalType = Literal["BUY", "SELL", "HOLD", "STRONG BUY", "STRONG SELL"]
5
- VolatilityLevel = Literal["Low", "Medium", "High"]
6
-
7
- class Candle(BaseModel):
8
- date: str
9
- price: float
10
-
11
- class ForecastPoint(BaseModel):
12
- day: int
13
- price: float
14
- lower: float
15
- upper: float
16
-
17
- class PredictionResponse(BaseModel):
18
- ticker: str
19
- currentPrice: float
20
- targetPrice: float
21
- predictedChange: float
22
- signal: SignalType
23
- rsi: float
24
- macd: str
25
- volatility: VolatilityLevel
26
- historicalPrices: List[Candle]
27
- predictedPrice: float
28
- forecastData: List[ForecastPoint]
29
-
30
- class HistoryResponse(BaseModel):
31
- ticker: str
32
- historicalPrices: List[Candle]
33
-
34
- class ChartForecastPoint(BaseModel):
35
- date: str
36
- price: float
37
- lower: float
38
- upper: float
39
-
40
- class ChartForecastResponse(BaseModel):
41
- ticker: str
42
- points: List[ChartForecastPoint]
43
-
44
- class HealthResponse(BaseModel):
45
- status: str
46
- modelLoaded: bool
47
- version: str = Field(default="1.0.0")
 
 
 
 
 
 
 
1
+ from typing import List, Literal
2
+ from pydantic import BaseModel, Field
3
+
4
+ SignalType = Literal["BUY", "SELL", "HOLD", "STRONG BUY", "STRONG SELL"]
5
+ VolatilityLevel = Literal["Low", "Medium", "High"]
6
+
7
+
8
+ class Candle(BaseModel):
9
+ date: str
10
+ price: float
11
+
12
+
13
+ class ForecastPoint(BaseModel):
14
+ day: int
15
+ price: float
16
+ changePct: float
17
+
18
+
19
+ class PredictionResponse(BaseModel):
20
+ ticker: str
21
+ currentPrice: float
22
+ targetPrice: float
23
+ predictedChange: float
24
+ signal: SignalType
25
+ rsi: float
26
+ macd: str
27
+ volatility: VolatilityLevel
28
+ historicalPrices: List[Candle]
29
+ predictedPrice: float
30
+ forecastData: List[ForecastPoint]
31
+
32
+
33
+ class HistoryResponse(BaseModel):
34
+ ticker: str
35
+ historicalPrices: List[Candle]
36
+
37
+
38
+ class ChartForecastPoint(BaseModel):
39
+ date: str
40
+ price: float
41
+ lower: float
42
+ upper: float
43
+
44
+
45
+ class ChartForecastResponse(BaseModel):
46
+ ticker: str
47
+ points: List[ChartForecastPoint]
48
+
49
+
50
+ class HealthResponse(BaseModel):
51
+ status: str
52
+ modelLoaded: bool
53
+ version: str = Field(default="1.0.0")