Adding 3rd party moving average and other 'indicators'

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Adding 3rd party moving average and other 'indicators'

Anton
Hello

I'm currently trying to learn Flink. And so far am really impressed by it.

However I've still got a lot to learn. So apologies if this a terribly newbie question.

I have created a streaming example based on https://flink.apache.org/news/2015/02/09/streaming-example.html

Next I would like to apply a moving average, using TA-Lib. You can see an example here - https://github.com/ishanthilina/TA-Lib-Java-Examples/blob/master/src/main/java/SimpleMovingAverageExample.java

Can someone tell me what would be the best/most logical way to apply this?

I appreciate that a moving average can be done without using TA-Lib, but there are other functions in this library that I would like to use, plus it would give me experience with integrating external analysis libraries.

Thanks and regards
Anton
Reply | Threaded
Open this post in threaded view
|

Re: Adding 3rd party moving average and other 'indicators'

Maximilian Michels
Hi Anton,

I would suggest you simply put your moving average code in a
MapFunction where you can keep track of the current average using a
class field.

Cheers,
Max

On Fri, Jun 24, 2016 at 10:05 PM, Anton <[hidden email]> wrote:

> Hello
>
> I'm currently trying to learn Flink. And so far am really impressed by it.
>
> However I've still got a lot to learn. So apologies if this a terribly
> newbie question.
>
> I have created a streaming example based on
> https://flink.apache.org/news/2015/02/09/streaming-example.html.
>
> Next I would like to apply a moving average, using TA-Lib. You can see an
> example here -
> https://github.com/ishanthilina/TA-Lib-Java-Examples/blob/master/src/main/java/SimpleMovingAverageExample.java
>
> Can someone tell me what would be the best/most logical way to apply this?
>
> I appreciate that a moving average can be done without using TA-Lib, but
> there are other functions in this library that I would like to use, plus it
> would give me experience with integrating external analysis libraries.
>
> Thanks and regards
> Anton