Stage 07.4.3.3 — Paper Position & Execution Engineg
This commit is contained in:
32
app/src/trading/position/state.py
Normal file
32
app/src/trading/position/state.py
Normal file
@@ -0,0 +1,32 @@
|
||||
# app/src/trading/position/state.py
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from dataclasses import dataclass
|
||||
|
||||
|
||||
@dataclass(slots=True)
|
||||
class PositionState:
|
||||
# сторона позиции: NONE / LONG / SHORT
|
||||
side: str = "NONE"
|
||||
|
||||
# торговый инструмент
|
||||
symbol: str = ""
|
||||
|
||||
# цена входа
|
||||
entry_price: float | None = None
|
||||
|
||||
# размер позиции
|
||||
size: float | None = None
|
||||
|
||||
# плечо
|
||||
leverage: float | None = None
|
||||
|
||||
# нереализованный PnL
|
||||
unrealized_pnl_usd: float | None = None
|
||||
|
||||
# время открытия позиции
|
||||
opened_at: str | None = None
|
||||
|
||||
# время последнего обновления позиции
|
||||
updated_at: str | None = None
|
||||
Reference in New Issue
Block a user