pub struct PortfolioState {
pub open_positions: u32,
pub gross_exposure: f64,
pub new_notional: f64,
pub symbol_already_open: bool,
pub account_net_pnl: f64,
}Expand description
Aggregate account state at the moment of a pre-trade check, assembled by the framework from its per-symbol risk + position state.
Fields§
§open_positions: u32Number of symbols currently holding a non-flat position.
gross_exposure: f64Aggregate gross exposure already on the book (quote currency).
new_notional: f64Notional the proposed new entry would add (quote currency).
symbol_already_open: boolWhether the entry’s symbol already holds a position — if so the entry adds to an existing slot rather than consuming a new concurrency slot.
account_net_pnl: f64Account-wide net realised PnL (sum of every symbol’s session net PnL). Checked live so a fresh breach blocks immediately, independent of the latched halt.
Trait Implementations§
Source§impl Clone for PortfolioState
impl Clone for PortfolioState
Source§fn clone(&self) -> PortfolioState
fn clone(&self) -> PortfolioState
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for PortfolioState
Source§impl Debug for PortfolioState
impl Debug for PortfolioState
Source§impl PartialEq for PortfolioState
impl PartialEq for PortfolioState
Source§fn eq(&self, other: &PortfolioState) -> bool
fn eq(&self, other: &PortfolioState) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for PortfolioState
Auto Trait Implementations§
impl Freeze for PortfolioState
impl RefUnwindSafe for PortfolioState
impl Send for PortfolioState
impl Sync for PortfolioState
impl Unpin for PortfolioState
impl UnsafeUnpin for PortfolioState
impl UnwindSafe for PortfolioState
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more