pub struct ExecutionService {
pub last_command: Option<ExecutionCommand>,
}Fields§
§last_command: Option<ExecutionCommand>Implementations§
Source§impl ExecutionService
impl ExecutionService
pub fn execute<E: ExchangeFacade<Error = ExchangeError>>( &mut self, exchange: &E, store: &PortfolioStateStore, price_source: &impl PriceSource, command: ExecutionCommand, ) -> Result<ExecutionOutcome, ExecutionError>
pub fn plan_target_exposure<E: ExchangeFacade<Error = ExchangeError>>( &self, exchange: &E, store: &PortfolioStateStore, price_source: &impl PriceSource, instrument: &Instrument, target: Exposure, ) -> Result<ExecutionPlan, ExecutionError>
pub fn submit_target_exposure<E: ExchangeFacade<Error = ExchangeError>>( &mut self, exchange: &E, store: &PortfolioStateStore, price_source: &impl PriceSource, instrument: &Instrument, target: Exposure, ) -> Result<(), ExecutionError>
Sourcepub fn close_symbol<E: ExchangeFacade<Error = ExchangeError>>(
&mut self,
exchange: &E,
store: &PortfolioStateStore,
instrument: &Instrument,
) -> Result<CloseSymbolResult, ExecutionError>
pub fn close_symbol<E: ExchangeFacade<Error = ExchangeError>>( &mut self, exchange: &E, store: &PortfolioStateStore, instrument: &Instrument, ) -> Result<CloseSymbolResult, ExecutionError>
Submits a close order for the current authoritative position snapshot.
Example:
- current signed qty =
-0.3 - generated close side =
Buy - generated close qty =
0.3
pub fn close_all<E: ExchangeFacade<Error = ExchangeError>>( &mut self, exchange: &E, store: &PortfolioStateStore, batch_id: BatchId, ) -> CloseAllBatchResult
Trait Implementations§
Source§impl Debug for ExecutionService
impl Debug for ExecutionService
Source§impl Default for ExecutionService
impl Default for ExecutionService
Source§fn default() -> ExecutionService
fn default() -> ExecutionService
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for ExecutionService
impl RefUnwindSafe for ExecutionService
impl Send for ExecutionService
impl Sync for ExecutionService
impl Unpin for ExecutionService
impl UnsafeUnpin for ExecutionService
impl UnwindSafe for ExecutionService
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