pub struct TickBarAggregator { /* private fields */ }
Expand description
Provides a means of building tick bars aggregated from quote and trade ticks.
When received tick count reaches the step threshold of the bar specification, then a bar is created and sent to the handler.
Implementations§
source§impl TickBarAggregator
impl TickBarAggregator
sourcepub fn new(
instrument: &InstrumentAny,
bar_type: BarType,
handler: fn(_: Bar),
await_partial: bool,
) -> Self
pub fn new( instrument: &InstrumentAny, bar_type: BarType, handler: fn(_: Bar), await_partial: bool, ) -> Self
Creates a new TickBarAggregator
instance.
§Panics
This function panics:
- If
instrument.id
is not equal to thebar_type.instrument_id
. - If
bar_type.aggregation_source
is not equal toAggregationSource::Internal
.
Trait Implementations§
source§impl BarAggregator for TickBarAggregator
impl BarAggregator for TickBarAggregator
source§fn update(&mut self, price: Price, size: Quantity, ts_event: UnixNanos)
fn update(&mut self, price: Price, size: Quantity, ts_event: UnixNanos)
Apply the given update to the aggregator.
source§fn handle_quote_tick(&mut self, quote: QuoteTick)
fn handle_quote_tick(&mut self, quote: QuoteTick)
Updates the aggregator with the given quote.
source§fn handle_trade_tick(&mut self, trade: TradeTick)
fn handle_trade_tick(&mut self, trade: TradeTick)
Updates the aggregator with the given trade.
Auto Trait Implementations§
impl Freeze for TickBarAggregator
impl RefUnwindSafe for TickBarAggregator
impl Send for TickBarAggregator
impl Sync for TickBarAggregator
impl Unpin for TickBarAggregator
impl UnwindSafe for TickBarAggregator
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more