This commit is contained in:
2026-03-10 18:24:14 +08:00
parent ab91804be1
commit 075932d6a6
17 changed files with 72668 additions and 0 deletions

33
internal_types/types.py Normal file
View File

@@ -0,0 +1,33 @@
from dataclasses import dataclass
from enum import Enum, auto
@dataclass(frozen=True)
class Quote:
timestamp: int
open: float
high: float
low: float
close: float
volume: int # todo: crypto volume is float
class SecurityType(Enum):
CRYPTO = auto()
EQUITY = auto()
FUTURE = auto()
OPTION = auto()
@dataclass(frozen=True)
class Instrument:
symbol: str
security_type: SecurityType
multiplier: int
@dataclass
class Position:
instr: Instrument
quantity: int # todo: crypto has fractional shares
price: float