consider using Kapacitor as a real-time 1m candle builder, but I’m not sure that is possible. I got started with the documentation and tried to write some TickScripts. I think that I can use stream node for this purpose something like this:
var data = stream
var max = data
var min = data
var open = data
var close = data
var sum = data
|join(min, sum, open, close)
.as(‘high’, ‘low’, ‘volume’, ‘open’, ‘close’)
And it looks like this works fine, but this is not real-time, because it builds a candle and pushes it one a minute. That’s great, but I want to push a candle on each streaming data. I can remove every(1m) from the script, but in this case align doesn’t work.
So, my question is…can I use Kapacitor to build a real-time candle? If yes, which approach should I use? Probably I can combine several nodes to get a result.