You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a database table containing trade data with the following schema:
event_type text not null,
event_time timestamp with time zone not null,
symbol text not null,
trade_id bigint not null,
price double precision not null,
quantity double precision not null,
first_trade_id bigint not null,
last_trade_id bigint not null,
trade_time timestamp with time zone not null,
is_buyer_maker boolean not null
I'm looking to aggregate the trade data based on a specified accumulated traded volume instead of a fixed time interval. Specifically, I want to group trades such that each group represents a cumulative volume threshold and then calculate the open, high, low, and close prices for each group.
How can I achieve this using TimescaleDB SQL queries?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I have a database table containing trade data with the following schema:
I'm looking to aggregate the trade data based on a specified accumulated traded volume instead of a fixed time interval. Specifically, I want to group trades such that each group represents a cumulative volume threshold and then calculate the open, high, low, and close prices for each group.
How can I achieve this using TimescaleDB SQL queries?
Thank you for any help you can provide!
Beta Was this translation helpful? Give feedback.
All reactions