Bollinger bands
This example computes Bollinger bands using a custom-provided function packaged as a jar using the Joule SDK.
Use case configuration
File: app-bollingerbands-influxdb.env
SOURCEFILE=conf/sources/stockQuoteStream.yaml
ENGINEFILE=conf/usecases/slidingEventWindowBollingerBandsAnalytics.yaml
PUBLISHFILE=conf/publishers/influxdbBollingerBands.yamlPipeline configuration
This pipeline will compute the Bolinger Bands for the CVCO symbol over a sliding window of 5 events.
processing unit:
pipeline:
- filter:
expression: "symbol == 'CVCO'"
- user defined function:
bollinger bands:
parameters:
deviations: 2
fields: [ ask ]
event history: 5
emit:
select: "symbol,
ask_upper_BollingerBand,
ask_middle_BollingerBand,
ask_lower_BollingerBand"Function Implementation
This function uses the same implementation pattern as the EMA function.
For Joule to load and initialised the component the analytics class needs to be defined within the plugins.properties file under the META-INF/services directory
Example
Last updated
Was this helpful?