pub struct PositionEvent {
pub symbol: String,
pub side: Side,
pub qty: f64,
pub entry_price: f64,
pub current_price: f64,
pub pnl_unrealized: f64,
pub position_id: Option<String>,
pub session_id: Option<String>,
pub atr_pct: Option<f64>,
}Expand description
A snapshot of an open position pushed by the execution side.
Shape is the minimum needed for downstream guidance. Add fields here when a consumer (guidance engine / memory store) actually reads them.
Fields§
§symbol: StringTrading pair / instrument (e.g. “BTC-USD”).
side: SideDirection: Buy = long, Sell = short.
qty: f64Position size in base units (always positive; direction is in side).
entry_price: f64Average fill price the position was opened at.
current_price: f64Mark / last price used to compute pnl_unrealized.
pnl_unrealized: f64Unrealized P&L in quote currency (signed).
position_id: Option<String>Optional client position id for correlation across repeated pushes.
session_id: Option<String>Optional JanusAI session id (groups positions under one run).
atr_pct: Option<f64>Optional volatility hint: recent ATR expressed as a percentage of
current_price (e.g. 1.5 = ATR is 1.5% of price). When present,
guidance widens the stop-loss to sit outside normal ATR-sized
noise. Producers that don’t track ATR simply omit it.
Implementations§
Trait Implementations§
Source§impl Clone for PositionEvent
impl Clone for PositionEvent
Source§fn clone(&self) -> PositionEvent
fn clone(&self) -> PositionEvent
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more