Skip to main content

OrderExecutor

Trait OrderExecutor 

Source
pub trait OrderExecutor: Send + Sync {
    // Required methods
    fn place_order<'life0, 'life1, 'async_trait>(
        &'life0 self,
        params: &'life1 PlaybookOrderParams,
    ) -> Pin<Box<dyn Future<Output = Result<String, ExecutionError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn cancel_order<'life0, 'life1, 'async_trait>(
        &'life0 self,
        order_id: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<(), ExecutionError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn is_filled<'life0, 'life1, 'async_trait>(
        &'life0 self,
        order_id: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<bool, ExecutionError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn close_position<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        position_id: &'life1 str,
        reason: &'life2 str,
    ) -> Pin<Box<dyn Future<Output = Result<String, ExecutionError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
}
Expand description

Trait abstracting order execution for playbooks.

Implementations include paper trading (instant fill) and live exchange execution.

Required Methods§

Source

fn place_order<'life0, 'life1, 'async_trait>( &'life0 self, params: &'life1 PlaybookOrderParams, ) -> Pin<Box<dyn Future<Output = Result<String, ExecutionError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

fn cancel_order<'life0, 'life1, 'async_trait>( &'life0 self, order_id: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<(), ExecutionError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

fn is_filled<'life0, 'life1, 'async_trait>( &'life0 self, order_id: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<bool, ExecutionError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

fn close_position<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, position_id: &'life1 str, reason: &'life2 str, ) -> Pin<Box<dyn Future<Output = Result<String, ExecutionError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Implementors§