Skip to content
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

Rename Toolkit {open,high,low,close}_at accessors as {open,high,low,close}_time #1557

Merged
merged 5 commits into from
Sep 9, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
rename ohlc time accessors
  • Loading branch information
rtwalker committed Sep 7, 2022
commit 8952e0c0f3d571f1d049a4b1d27ffadbab1f4a05
4 changes: 2 additions & 2 deletions api/ohlc.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ import Experimental from 'versionContent/_partials/_experimental.mdx';
Produces an `OpenHighLowClose` aggregate which stores the opening, high, low,
and closing prices alongside the times at which they each occurred. This
aggregate can either be later re-aggregated using `rollup` or passed directly to
any of the following hyperfunctions: `open`, `high`, `low`, `close`, `open_at`,
`high_at`, `low_at`, or `close_at`.
any of the following hyperfunctions: `open`, `high`, `low`, `close`, `open_time`,
`high_time`, `low_time`, or `close_time`.

```sql
ohlc(
Expand Down
38 changes: 19 additions & 19 deletions api/open-high-low-close-at.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
api_name: open_at() | high_at() | low_at() | close_at()
api_name: open_time() | high_time() | low_time() | close_time()
excerpt: Get the timestamp corresponding to OHLC points in financial analysis
topics: [hyperfunctions]
tags: [hyperfunctions, finance]
Expand All @@ -22,34 +22,34 @@ hyperfunction_subfamily: OpenHighLowClose
hyperfunction_type: accessor
---

# `open_at`, `high_at`, `low_at`, `close_at` <tag type="toolkit" content="Toolkit" /><tag type="experimental-toolkit" content="Experimental" />
# `open_time`, `high_time`, `low_time`, `close_time` <tag type="toolkit" content="Toolkit" /><tag type="experimental-toolkit" content="Experimental" />

import Experimental from 'versionContent/_partials/_experimental.mdx';

This group of functions each returns the timestamp of the OHLC component for
which it is named. For example, the `high_at()` hyperfunction returns the
which it is named. For example, the `high_time()` hyperfunction returns the
timestamp of the highest price during the aggregated time period.

```sql
open_at(
open_time(
ohlc OpenHighLowClose
) RETURNS TIMESTAMPTZ
```

```sql
high_at(
high_time(
ohlc OpenHighLowClose
) RETURNS TIMESTAMPTZ
```

```sql
low_at(
low_time(
ohlc OpenHighLowClose
) RETURNS TIMESTAMPTZ
```

```sql
close_at(
close_time(
ohlc OpenHighLowClose
) RETURNS TIMESTAMPTZ
```
Expand All @@ -66,19 +66,19 @@ close_at(

|Column|Type|Description|
|-|-|-|
|`open_at`|`TIMESTAMPTZ`|The time at which the opening price occurred|
|`open_time`|`TIMESTAMPTZ`|The time at which the opening price occurred|

|Column|Type|Description|
|-|-|-|
|`high_at`|`TIMESTAMPTZ`|The first time at which the high price occurred|
|`high_time`|`TIMESTAMPTZ`|The first time at which the high price occurred|

|Column|Type|Description|
|-|-|-|
|`low_at`|`TIMESTAMPTZ`|The first time at which the low price occurred|
|`low_time`|`TIMESTAMPTZ`|The first time at which the low price occurred|

|Column|Type|Description|
|-|-|-|
|`close_at`|`TIMESTAMPTZ`|The time at which closing price occurred|
|`close_time`|`TIMESTAMPTZ`|The time at which closing price occurred|

## Sample usage

Expand All @@ -87,13 +87,13 @@ Query your continuous aggregate on stock trade data:
```sql
SELECT ts,
symbol,
toolkit_experimental.open_at(ohlc),
toolkit_experimental.open_time(ohlc),
toolkit_experimental.open(ohlc),
toolkit_experimental.high_at(ohlc),
toolkit_experimental.high_time(ohlc),
toolkit_experimental.high(ohlc),
toolkit_experimental.low_at(ohlc),
toolkit_experimental.low_time(ohlc),
toolkit_experimental.low(ohlc),
toolkit_experimental.close_at(ohlc)
toolkit_experimental.close_time(ohlc)
toolkit_experimental.close(ohlc)
FROM ohlc
;
Expand All @@ -112,13 +112,13 @@ WITH ohlc AS (
)
SELECT minute_bucket,
symbol,
toolkit_experimental.open_at(ohlc),
toolkit_experimental.open_time(ohlc),
toolkit_experimental.open(ohlc),
toolkit_experimental.high_at(ohlc),
toolkit_experimental.high_time(ohlc),
toolkit_experimental.high(ohlc),
toolkit_experimental.low_at(ohlc),
toolkit_experimental.low_time(ohlc),
toolkit_experimental.low(ohlc),
toolkit_experimental.close_at(ohlc)
toolkit_experimental.close_time(ohlc)
toolkit_experimental.close(ohlc)
FROM ohlc
;
Expand Down
4 changes: 2 additions & 2 deletions api/page-index/page-index.js
Original file line number Diff line number Diff line change
Expand Up @@ -434,8 +434,8 @@ module.exports = [
href: "open-high-low-close",
},
{
title: "open-at, high_at, low_at, close_at",
href: "open-high-low-close-at",
title: "open_time, high_time, low_time, close_time",
href: "open-high-low-close-time",
},
{
title: "rollup",
Expand Down