pub struct FutureExecutor {
pub fills: Vec<RecordedFill>,
pub pending_order_lifecycle: Vec<PendingOrderLifecycleEvent>,
pub close_events: Vec<CloseEvent>,
pub cost_events: Vec<CostEvent>,
pub completed_positions: Vec<CompletedPosition>,
/* private fields */
}Expand description
Accounting adapter for quote-authoritative FutureQuoteV1 execution.
Fields§
§fills: Vec<RecordedFill>§pending_order_lifecycle: Vec<PendingOrderLifecycleEvent>§close_events: Vec<CloseEvent>§cost_events: Vec<CostEvent>§completed_positions: Vec<CompletedPosition>Implementations§
Source§impl FutureExecutor
impl FutureExecutor
pub fn new( initial_balance: f64, contract_sizes: HashMap<String, f64>, pnl_epsilon: f64, ) -> Self
pub fn with_currency_plan(self, currency_plan: Option<RunCurrencyPlan>) -> Self
Sourcepub fn with_costs(
self,
costs: HashMap<String, InstrumentCosts>,
point_sizes: HashMap<String, f64>,
) -> Self
pub fn with_costs( self, costs: HashMap<String, InstrumentCosts>, point_sizes: HashMap<String, f64>, ) -> Self
Attach per-symbol trading costs and the price point size used by point-denominated swap.
pub fn balance(&self) -> f64
pub fn realized_pnl(&self) -> f64
pub fn has_close(&self, position_id: &str) -> bool
pub fn pending_metadata( &self, position_id: &str, ) -> Option<(String, NaiveDateTime, NaiveDateTime)>
pub fn open_snapshots(&self) -> Vec<OpenPositionSnapshot>
Sourcepub fn finalize_pending_orders_at_end(&mut self, terminal_ts: NaiveDateTime)
pub fn finalize_pending_orders_at_end(&mut self, terminal_ts: NaiveDateTime)
Mark every still-pending order as unfilled at the deterministic end of the accepted quote stream. Pending snapshots remain available separately.
Trait Implementations§
Source§impl Clone for FutureExecutor
impl Clone for FutureExecutor
Auto Trait Implementations§
impl Freeze for FutureExecutor
impl RefUnwindSafe for FutureExecutor
impl Send for FutureExecutor
impl Sync for FutureExecutor
impl Unpin for FutureExecutor
impl UnsafeUnpin for FutureExecutor
impl UnwindSafe for FutureExecutor
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