Skip to content

Commit

Permalink
Merge #496
Browse files Browse the repository at this point in the history
496: Create OHLC aggregate and accompanying accessors r=rtwalker a=rtwalker

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 takes `OpenHighLowClose` 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).

Co-authored-by: Ryan Walker <rwalker@timescale.com>
  • Loading branch information
bors[bot] and rtwalker authored Aug 16, 2022
2 parents 24ddb69 + cdc3697 commit d897639
Show file tree
Hide file tree
Showing 2 changed files with 668 additions and 0 deletions.
1 change: 1 addition & 0 deletions extension/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ pub mod time_vector;
pub mod frequency;
pub mod saturation;
pub mod countminsketch;
pub mod ohlc;

mod palloc;
mod aggregate_utils;
Expand Down
Loading

0 comments on commit d897639

Please sign in to comment.