pub struct Portfolio { /* private fields */ }
Implementations§
Source§impl Portfolio
impl Portfolio
pub fn new( msgbus: Rc<RefCell<MessageBus>>, cache: Rc<RefCell<Cache>>, clock: Rc<RefCell<dyn Clock>>, ) -> Self
pub fn reset(&mut self)
pub fn is_initialized(&self) -> bool
pub fn balances_locked(&self, venue: &Venue) -> HashMap<Currency, Money>
pub fn margins_init(&self, venue: &Venue) -> HashMap<InstrumentId, Money>
pub fn margins_maint(&self, venue: &Venue) -> HashMap<InstrumentId, Money>
pub fn unrealized_pnls(&mut self, venue: &Venue) -> HashMap<Currency, Money>
pub fn realized_pnls(&mut self, venue: &Venue) -> HashMap<Currency, Money>
pub fn net_exposures(&self, venue: &Venue) -> Option<HashMap<Currency, Money>>
pub fn unrealized_pnl(&mut self, instrument_id: &InstrumentId) -> Option<Money>
pub fn realized_pnl(&mut self, instrument_id: &InstrumentId) -> Option<Money>
pub fn net_exposure(&self, instrument_id: &InstrumentId) -> Option<Money>
pub fn net_position(&self, instrument_id: &InstrumentId) -> Decimal
pub fn is_net_long(&self, instrument_id: &InstrumentId) -> bool
pub fn is_net_short(&self, instrument_id: &InstrumentId) -> bool
pub fn is_flat(&self, instrument_id: &InstrumentId) -> bool
pub fn is_completely_flat(&self) -> bool
pub fn initialize_orders(&mut self)
pub fn initialize_positions(&mut self)
pub fn update_quote_tick(&mut self, quote: &QuoteTick)
pub fn update_account(&mut self, event: &AccountState)
pub fn update_order(&mut self, event: &OrderEventAny)
pub fn update_position(&mut self, event: &PositionEvent)
Auto Trait Implementations§
impl Freeze for Portfolio
impl !RefUnwindSafe for Portfolio
impl !Send for Portfolio
impl !Sync for Portfolio
impl Unpin for Portfolio
impl !UnwindSafe for Portfolio
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more