File tree Expand file tree Collapse file tree 1 file changed +57
-0
lines changed
Expand file tree Collapse file tree 1 file changed +57
-0
lines changed Original file line number Diff line number Diff line change 1+ from pydantic import BaseModel
2+ from datetime import datetime
3+ from typing import Optional
4+
5+
6+ # ----------------------------
7+ # MODEL OUTPUT (Signal)
8+ # ----------------------------
9+
10+ class TradeSignal (BaseModel ):
11+ """
12+ Output of the ML system.
13+ This is NOT a trade.
14+ """
15+ symbol : str
16+
17+ p_up : float
18+ expected_return : float
19+ uncertainty : float
20+
21+ model_version : Optional [str ] = None
22+ timestamp : datetime
23+
24+
25+ # ----------------------------
26+ # EXECUTED TRADE (Paper Only)
27+ # ----------------------------
28+
29+ class ExecutedTrade (BaseModel ):
30+ """
31+ Result of execution logic.
32+ Generated only after passing risk & confidence checks.
33+ """
34+ symbol : str
35+ side : str # BUY or SELL
36+
37+ quantity : int
38+ execution_price : float
39+
40+ signal_p_up : float
41+ signal_uncertainty : float
42+
43+ timestamp : datetime
44+
45+
46+ # ----------------------------
47+ # PORTFOLIO SNAPSHOT (Optional)
48+ # ----------------------------
49+
50+ class PortfolioSnapshot (BaseModel ):
51+ """
52+ Lightweight portfolio state for analytics & audits.
53+ """
54+ cash : float
55+ positions : dict [str , int ]
56+ total_value : float
57+ timestamp : datetime
You can’t perform that action at this time.
0 commit comments