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(&mut self, quote: QuoteTick) { ... }
    fn handle_trade(&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(&mut self, quote: QuoteTick)

Updates the aggregator with the given quote.

Source

fn handle_trade(&mut self, trade: TradeTick)

Updates the aggregator with the given trade.

Implementors§

Source§

impl<C, H> BarAggregator for TimeBarAggregator<C, H>
where C: Clock, H: FnMut(Bar),

Source§

impl<H> BarAggregator for TickBarAggregator<H>
where H: FnMut(Bar),

Source§

impl<H> BarAggregator for ValueBarAggregator<H>
where H: FnMut(Bar),

Source§

impl<H> BarAggregator for VolumeBarAggregator<H>
where H: FnMut(Bar),