Merge pull request #402 from influxdata/flux/kaufman-functions

Flux Kaufman functions
pull/410/head
Scott Anderson 2019-08-23 12:46:23 -06:00 committed by GitHub
commit 9de80fab8d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 94 additions and 0 deletions

View File

@ -0,0 +1,52 @@
---
title: kaufmansAMA() function
description: >
The `kaufmansAMA()` function calculates the Kaufman's Adaptive Moving Average (KAMA)
using values in an input table.
menu:
v2_0_ref:
name: kaufmansAMA
parent: built-in-aggregates
weight: 501
related:
- /v2.0/reference/flux/functions/built-in/transformations/aggregates/kaufmanser/
- https://docs.influxdata.com/influxdb/v1.7/query_language/functions/#kaufmans-adaptive-moving-average, InfluxQL KAUFMANS_ADAPTIVE_MOVING_AVERAGE()
---
The `kaufmansAMA()` function calculates the Kaufman's Adaptive Moving Average (KAMA)
using values in an input table.
_**Function type:** Aggregate_
```js
kaufmansAMA(
n: 10,
columns: ["_value"]
)
```
Kaufman's Adaptive Moving Average is a trend-following indicator designed to account
for market noise or volatility.
## Parameters
### n
The period or number of points to use in the calculation.
_**Data type: Integer**_
### column
The column to operate on.
Defaults to `"_value"`.
_**Data type: String**_
## Examples
```js
from(bucket: "telegraf/autogen"):
|> range(start: -7d)
|> kaufmansAMA(
n: 10,
column: "_value"
)
```

View File

@ -0,0 +1,42 @@
---
title: kaufmansER() function
description: >
The `kaufmansER()` function calculates the Kaufman's Efficiency Ratio (KER) using
values in an input table.
menu:
v2_0_ref:
name: kaufmansER
parent: built-in-aggregates
weight: 501
related:
- /v2.0/reference/flux/functions/built-in/transformations/aggregates/kaufmansama/
- https://docs.influxdata.com/influxdb/v1.7/query_language/functions/#kaufmans-efficiency-ratio, InfluxQL KAUFMANS_EFFICIENCY_RATIO()
---
The `kaufmansER()` function calculates the Kaufman's Efficiency Ratio (KER) using
values in an input table.
The function operates on the `_value` column.
_**Function type:** Aggregate_
```js
kaufmansER(n: 10)
```
Kaufman's Efficiency Ratio indicator divides the absolute value of the
Chande Momentum Oscillator by 100 to return a value between 0 and 1.
Higher values represent a more efficient or trending market.
## Parameters
### n
The period or number of points to use in the calculation.
_**Data type: Integer**_
## Examples
```js
from(bucket: "example-bucket")
|> range(start: -7d)
|> kaufmansER(n: 10)
```