Trait trade_aggregation::AggregationRule
source · [−]pub trait AggregationRule<C> {
fn should_trigger(&mut self, trade: &Trade, candle: &C) -> bool;
}
Expand description
Defines under what conditions one aggregation period is finished
Required Methods
fn should_trigger(&mut self, trade: &Trade, candle: &C) -> bool
fn should_trigger(&mut self, trade: &Trade, candle: &C) -> bool
The main method defining when the aggregation is done
Arguments:
trade: The most recent taker trade (tick) information candle: Some generic Candle, allowing for information driven decision making
Returns:
if true, the aggregation period is finished and a Candle can be emitted else the aggregation needs to continue