pub struct PositionOutcome {Show 16 fields
pub symbol: String,
pub side: Side,
pub qty: f64,
pub entry_price: f64,
pub exit_price: f64,
pub pnl_realized: f64,
pub realized_ratio: f64,
pub result: OutcomeResult,
pub rr_ratio: Option<f64>,
pub strategy: Option<String>,
pub position_id: Option<String>,
pub session_id: Option<String>,
pub peak_pnl_ratio: Option<f64>,
pub samples: u64,
pub last_guidance: Option<GuidanceAction>,
pub time_in_position_secs: Option<f64>,
}Expand description
A closed-trade record joining a PositionClose with the guidance
history accumulated in PositionState while the position was open.
This is the “outcome” Janus captures so the guidance engine can be
evaluated and tuned. Downstream, the JanusAI service compacts these into
janus_memories (fks repo). Fields sourced from the tracker are None
when the position was never tracked (no position_id, or no snapshots
arrived before the close).
Fields§
§symbol: String§side: Side§qty: f64§entry_price: f64§exit_price: f64§pnl_realized: f64§realized_ratio: f64Realized P&L as a ratio of entry notional.
result: OutcomeResultWin / loss / breakeven from the sign of realized_ratio.
rr_ratio: Option<f64>Realized risk-reward ratio, when the producer reported one.
strategy: Option<String>Strategy that opened the position, when reported. Affinity recording is skipped when this is absent.
position_id: Option<String>§session_id: Option<String>§peak_pnl_ratio: Option<f64>Highest unrealized-P&L ratio seen while the position was open.
samples: u64Number of open snapshots observed (0 if the position was untracked).
last_guidance: Option<GuidanceAction>The last guidance action Janus advised for this position.
time_in_position_secs: Option<f64>Seconds the position was reported open.
Implementations§
Source§impl PositionOutcome
impl PositionOutcome
Sourcepub fn from_close(close: &PositionClose, state: Option<&PositionState>) -> Self
pub fn from_close(close: &PositionClose, state: Option<&PositionState>) -> Self
Build an outcome from a close event joined with the position’s
accumulated PositionState (when it was tracked).
Trait Implementations§
Source§impl Clone for PositionOutcome
impl Clone for PositionOutcome
Source§fn clone(&self) -> PositionOutcome
fn clone(&self) -> PositionOutcome
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more