Kevin Grüneberg

1 month agoHi there, is there a way to use LTTB (largest triangle three bucket) algorithm to downsample to a given resolution? Let’s say you are trying to fetch 25 years of stock data and you want to downsample it to a maximum of 500 quotes. LTTB is a great algorithm (compared to plain average).- j
javier ramirez

1 month agoI can give you a partial solution, not really LTTB. If you want to get a fixed number of samples, you can always precalculate the sampling factor. In your case, you want 500 samples and have 25 years. 25 years have ~25*8760 hours, so 219000 hours. We divide by 500 and we get that we need to sample by 438hours - Unfortunately the sample for the hour would be the average, so you don’t get the fancy properties of LTTB where you get the best value for visual representation and you always take a value present on the original dataset
Kevin Grüneberg

1 month agoYeah, unfortunately that would not work well for us.- j
javier ramirez

1 month agoI understand. Just wanted to tackle the half of the problem that you can solve only with questdb 🙂 Kevin Grüneberg

1 month agoIs it maybe possible to run custom code before returning results?- That way, we could at least reduce network traffic
- j
javier ramirez

1 month ago

Join thread in Slack

View count: 2