nautilus_data::aggregation

Trait BarAggregator

source
pub trait BarAggregator {
    // Required methods
    fn bar_type(&self) -> BarType;
    fn update(&mut self, price: Price, size: Quantity, ts_event: UnixNanos);

    // Provided methods
    fn handle_quote_tick(&mut self, quote: QuoteTick) { ... }
    fn handle_trade_tick(&mut self, trade: TradeTick) { ... }
}

Required Methods§

source

fn bar_type(&self) -> BarType

The [BarType] to be aggregated.

source

fn update(&mut self, price: Price, size: Quantity, ts_event: UnixNanos)

Updates theaggregator with the given price and size.

Provided Methods§

source

fn handle_quote_tick(&mut self, quote: QuoteTick)

Updates the aggregator with the given quote.

source

fn handle_trade_tick(&mut self, trade: TradeTick)

Updates the aggregator with the given trade.

Implementors§