Event based user actions

I am in the process of building out an algo trading system using TimescaleDB.
We have a continuous aggregate that stores the OHLCV for candles.

The issue is that we want to trigger certain logic on the close of every candle within a bucket - for example, find out is the RSI exceeded 70 for any symbol in the 15 min period.

For this, we have written the logic in a python function but the problem is how to invoke that function? How do we know when the OHLC row for the last 15 min candle has been inserted into Timescale?

Does the product offer any events that can be triggered everytime a new row is added in a bucket?

Hey @Dheeraj_Saxena, here’s a simple example:

Remember that Timescaledb is just Postgres on asteroids, so the continuous aggregates is also a hypertable, so you can also insert a trigger :nerd_face:

Thanks so much @jonatasdp - really appreciate the help here!

1 Like