Trait trade_aggregation::AggregationRule

source ·
pub trait AggregationRule<C, T: TakerTrade> {
    // Required method
    fn should_trigger(&mut self, trade: &T, candle: &C) -> bool;
}
Expand description

Defines under what conditions one aggregation period is finished Is generic over the type of candle being produced C, as well as the type of input trade T

Required Methods§

source

fn should_trigger(&mut self, trade: &T, 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

Implementors§

source§

impl<C, T> AggregationRule<C, T> for AlignedTimeRule
where C: ModularCandle<T>, T: TakerTrade,

source§

impl<C, T> AggregationRule<C, T> for RelativePriceRule
where C: ModularCandle<T>, T: TakerTrade,

source§

impl<C, T> AggregationRule<C, T> for TickRule
where C: ModularCandle<T>, T: TakerTrade,

source§

impl<C, T> AggregationRule<C, T> for TimeRule
where C: ModularCandle<T>, T: TakerTrade,

source§

impl<C, T> AggregationRule<C, T> for VolumeRule
where C: ModularCandle<T>, T: TakerTrade,