Skip to content
This repository has been archived by the owner on May 31, 2023. It is now read-only.

Calculate average of columns at the end of each day #41

Closed
Tyruiop opened this issue Jul 31, 2021 · 2 comments
Closed

Calculate average of columns at the end of each day #41

Tyruiop opened this issue Jul 31, 2021 · 2 comments
Assignees
Labels
compute compute related issues enhancement New feature or request

Comments

@Tyruiop
Copy link
Owner

Tyruiop commented Jul 31, 2021

Using a statement like

SELECT timeseries.contractSymbol, AVG(timeseries.delta) FROM timeseries LEFT JOIN live ON timeseries.contractsymbol = live.contractsymbol WHERE live.expiration > 1627721273 GROUP BY timeseries.contractSymbol;

at the end of each days, update the live table with the average value of (most) columns as we go, to enable search by average.

Add two averages: 20days & 100 days averages for each column, for now.

This will allow identifying drops & peaks in movements of each contract.

@Tyruiop Tyruiop added enhancement New feature or request compute compute related issues labels Jul 31, 2021
@Tyruiop Tyruiop self-assigned this Jul 31, 2021
@Tyruiop
Copy link
Owner Author

Tyruiop commented Jul 31, 2021

Store all these statistics in a json field maybe, instead of creating many columns?

@Tyruiop
Copy link
Owner Author

Tyruiop commented Aug 1, 2021

Done, one column per average (20d and 100d).

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
compute compute related issues enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant