Class AggregateFilter
java.lang.Object
com.motivewave.platform.sdk.common.AggregateFilter
- All Implemented Interfaces:
TickOperation
,Cloneable
Aggregates ticks and filters by volume of the aggregated ticks.
Aug 7, 2020 Adjusted this filter to account for ticks that include the exchange order id.
if this id is available (currently Rithmic live data only) it will be used to aggregate (ignoring the agg period).
NB: If the exchange order id is available it may cause the same tick to be emitted multiple times with an updated size.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionAggregateFilter
(boolean aggByOrder, long aggPeriod, float minSize, float maxSize, TickOperation op) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionclone()
boolean
void
Executes the operation on the given tickvoid
reset()
Resets the internal state for aggregating ticks.void
setCancelled
(boolean b) void
Sets the operation to execute on each aggregated/filtered tick.
-
Field Details
-
op
-
aggPeriod
protected long aggPeriod -
aggregate
protected boolean aggregate -
checkMax
protected boolean checkMax -
minSize
protected float minSize -
maxSize
protected float maxSize -
filterOp
-
aggTick
-
tickStart
protected long tickStart
-
-
Constructor Details
-
AggregateFilter
public AggregateFilter(boolean aggByOrder, long aggPeriod, float minSize, float maxSize, TickOperation op) Constructor. Creates an Aggregate Filter with the given criteria and tick operation.- Parameters:
aggByOrder
- If true, ticks will be aggregated using the aggressor order id (if available)aggPeriod
- period in milliseconds to allow the aggregation of ticks (0 for no aggregation)minSize
- minimum trade size for applying the tick operation (0 for no min size)maxSize
- maximum trade size for applying the tick operation (0 for no max size)op
- operation to perform for ticks that meet the min/max size requirement
-
-
Method Details
-
onTick
Description copied from interface:TickOperation
Executes the operation on the given tick- Specified by:
onTick
in interfaceTickOperation
- Parameters:
tick
- tick to process
-
setOperation
Sets the operation to execute on each aggregated/filtered tick.- Parameters:
op
- operation to execute
-
reset
public void reset()Resets the internal state for aggregating ticks. -
clone
-
setCancelled
public void setCancelled(boolean b) -
isCancelled
public boolean isCancelled()
-