-
Notifications
You must be signed in to change notification settings - Fork 50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create OHLC aggregate and accompanying accessors #496
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Didn't really have any feedback aside what came up at all hands this morning.
Added tests for extreme values in both the timestamp and price columns. Also required |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good
bors r+ |
Build succeeded: |
596: Introduce Candlestick Aggregate r=rtwalker a=rtwalker Use new Candlestick struct to handle volume data. Introduces aggregate: * `toolkit_experimental.candlestick_agg(ts, price, volume)` and function: * `toolkit_experimental.candlestick(ts, open, high, low, close, volume)` Both new aggregates support the following accessors (in addition to being re-aggregated via `rollup`): * `open` * `high` * `low` * `close` * `open_time` * `high_time` * `low_time` * `close_time` * `volume` * `vwap` (Volume Weighted Average Price) VWAP calculated from the candlestick function uses typical price = (high + low + close) / 3 The original `toolkit_experimental.ohlc(ts, price)` aggregate should still work the same, but will be superseded by this new functionality. Closes #496 Co-authored-by: Ryan Walker <rwalker@timescale.com> Co-authored-by: Eric Gillespie <epg@timescale.com>
Begins to address #445.
Introduces OHLC aggregate called as
toolkit_experimental.ohlc(timestamp, price)
.The following accessors are provided for use with the
OpenHighLowClose
aggregate:open
,high
,low
,close
along with the timestamp-returning versions:
open_at
,high_at
,low_at
,close_at
Additionally, there is a new
toolkit_experimental.rollup()
aggregate that takesOpenHighLowClose
aggregates as input.In the event that multiple rows contain the highest or lowest value, only the earliest occurrence is retained. Similarly, should multiple rows contain the opening or closing timestamp, this implementation only updates the open/close points with a new value when the new timestamp is strictly earlier/later than current timestamp.
Additional work on #445 remains to address handling volume (and possibly creating technical indicators).