pub struct BarAggregator { /* private fields */ }Expand description
Bar aggregator for managing state and creating bars from trade data
Implementations§
Source§impl BarAggregator
impl BarAggregator
Sourcepub fn new(
instrument_id: InstrumentId,
bar_type: BarType,
bar_cache: Arc<RwLock<BarCache>>,
clock: Clock,
) -> Result<Self>
pub fn new( instrument_id: InstrumentId, bar_type: BarType, bar_cache: Arc<RwLock<BarCache>>, clock: Clock, ) -> Result<Self>
Create a new bar aggregator
Sourcepub fn process_trade(&mut self, trade: &MarketTrade) -> Option<Bar>
pub fn process_trade(&mut self, trade: &MarketTrade) -> Option<Bar>
Process a trade and potentially create a new bar
Trait Implementations§
Auto Trait Implementations§
impl Freeze for BarAggregator
impl !RefUnwindSafe for BarAggregator
impl Send for BarAggregator
impl Sync for BarAggregator
impl Unpin for BarAggregator
impl !UnwindSafe for BarAggregator
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