You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@flink.apache.org by Anton <ku...@gmail.com> on 2016/06/24 20:05:01 UTC

Adding 3rd party moving average and other 'indicators'

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

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

Posted by Maximilian Michels <mx...@apache.org>.
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 <ku...@gmail.com> 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