---
title: "Indicator Expression Reference"
description: "Exact indicator functions, parameters, defaults, aliases and outputs available in strategy expressions."
---
<!-- Generated by generate-indicator-reference.mjs; edit canonical metadata, not this file. -->

The expression DSL provides **77 indicator functions**. Use the names, parameters
and output fields below when writing rules; the [indicator guide](/docs/strategies/indicators/)
explains how to choose and combine them.

A dash in the default column means the catalog does not specify a default;
execution context or a particular parameter combination may supply one.
Signatures show reference notation; the **Example expression** blocks are executable.
Parameter aliases name the same choice: an explicit canonical name takes precedence,
while repeated identical keys and competing aliases without that canonical choice are rejected.

<a href="/docs/strategies/indicator-reference.md" download>Download this reference as Markdown</a>.

## ICT

<details id="indicator-nwog" data-indicator="NWOG">
<summary><code>NWOG</code> — New Week Opening Gap (NWOG)</summary>

Gap between Friday close and Sunday/Monday open, a key ICT reference level.

**Signature**

```text signature
NWOG({lookback?: number = 1, interval: IntervalString}) -> {gapPercent: number, gapLow: number, gapHigh: number, gapMidpoint: number}[]
```

**Parameters**

| Parameter | Default | Aliases |
| --- | --- | --- |
| `lookback` | `1` | — |
| `interval` | `"D"` | — |

**Parameter notes**

- `lookback`: Number of weeks to return
- `interval`: Bar interval (e.g. '1m', '1h', 'D')

**Outputs**

| Field | Meaning |
| --- | --- |
| `gapPercent` | Gap size as a percentage of Friday close |
| `gapLow` | Lower edge of the opening gap |
| `gapHigh` | Upper edge of the opening gap |
| `gapMidpoint` | Midpoint of the opening gap |

**Example expression**

```js
NWOG().gapPercent
```

</details>

## Momentum

<details id="indicator-ac" data-indicator="AC">
<summary><code>AC</code> — Accelerator Oscillator (AC)</summary>

Measures the acceleration or deceleration of the driving force behind price movement.

**Signature**

```text signature
AC({shortPeriod?: number = 5, longPeriod?: number = 34, signalPeriod?: number = 5, interval: IntervalString}) -> number[]
```

**Parameters**

| Parameter | Default | Aliases |
| --- | --- | --- |
| `shortPeriod` | `5` | `fast` |
| `longPeriod` | `34` | `slow` |
| `signalPeriod` | `5` | — |
| `interval` | `"D"` | — |

**Parameter notes**

- `shortPeriod`: Short period for AO calculation
- `longPeriod`: Long period for AO calculation
- `signalPeriod`: Signal smoothing period
- `interval`: Bar interval (e.g. '1m', '1h', 'D')

**Output**

Returns a numeric series; use the function directly.

**Example expression**

```js
AC()
```

</details>

<details id="indicator-ao" data-indicator="AO">
<summary><code>AO</code> — Awesome Oscillator</summary>

Difference between 5-period and 34-period simple moving averages of the median price.

**Signature**

```text signature
AO({interval: IntervalString, shortPeriod?: number = 5, longPeriod?: number = 34}) -> number[]
```

**Parameters**

| Parameter | Default | Aliases |
| --- | --- | --- |
| `shortPeriod` | `5` | `fast` |
| `longPeriod` | `34` | `slow` |
| `interval` | `"D"` | — |

**Parameter notes**

- `shortPeriod`: Short period
- `longPeriod`: Long period
- `interval`: Bar interval (e.g. '1m', '1h', 'D')

**Output**

Returns a numeric series; use the function directly.

**Example expression**

```js
AO()
```

</details>

<details id="indicator-cg" data-indicator="CG">
<summary><code>CG</code> — Center of Gravity (CG)</summary>

Identifies turning points with minimal lag by weighting recent prices more heavily.

**Signature**

```text signature
CG({period?: number = 5, interval: IntervalString}) -> number[]
```

**Parameters**

| Parameter | Default | Aliases |
| --- | --- | --- |
| `period` | `5` | `length` |
| `interval` | `"D"` | — |

**Parameter notes**

- `period`: CG period
- `interval`: Bar interval (e.g. '1m', '1h', 'D')

**Output**

Returns a numeric series; use the function directly.

**Example expression**

```js
CG()
```

</details>

<details id="indicator-adosc" data-indicator="ADOSC">
<summary><code>ADOSC</code> — Chaikin Oscillator</summary>

Difference between fast and slow EMAs of the Accumulation/Distribution line.

**Signature**

```text signature
ADOSC({fastLength?: number = 3, slowLength?: number = 10, interval: IntervalString}) -> number[]
```

**Parameters**

| Parameter | Default | Aliases |
| --- | --- | --- |
| `fastLength` | `3` | `shortPeriod`, `fast` |
| `slowLength` | `10` | `longPeriod`, `slow` |
| `interval` | `"D"` | — |

**Parameter notes**

- `fastLength`: Fast EMA period
- `slowLength`: Slow EMA period
- `interval`: Bar interval (e.g. '1m', '1h', 'D')

**Output**

Returns a numeric series; use the function directly.

**Example expression**

```js
ADOSC()
```

</details>

<details id="indicator-cci" data-indicator="CCI">
<summary><code>CCI</code> — Commodity Channel Index (CCI)</summary>

Measures how far price deviates from its statistical mean.

**Signature**

```text signature
CCI({period?: number = 14, interval: IntervalString, source?: PriceSource}) -> number[]
```

**Parameters**

| Parameter | Default | Aliases |
| --- | --- | --- |
| `period` | `14` | `length` |
| `interval` | `"D"` | — |
| `source` | `"close"` | — |

**Parameter notes**

- `period`: Lookback period
- `interval`: Bar interval (e.g. '1m', '1h', 'D')
- `source`: Bar price source (e.g. 'close')

**Output**

Returns a numeric series; use the function directly.

**Example expression**

```js
CCI()
```

</details>

<details id="indicator-mom" data-indicator="MOM">
<summary><code>MOM</code> — Momentum (MOM)</summary>

Absolute difference between current price and price N periods ago.

**Signature**

```text signature
MOM({period?: number = 14, interval: IntervalString, source?: PriceSource}) -> number[]
```

**Parameters**

| Parameter | Default | Aliases |
| --- | --- | --- |
| `period` | `14` | `length` |
| `interval` | `"D"` | — |
| `source` | `"close"` | — |

**Parameter notes**

- `period`: Lookback period
- `interval`: Bar interval (e.g. '1m', '1h', 'D')
- `source`: Bar price source (e.g. 'close')

**Output**

Returns a numeric series; use the function directly.

**Example expression**

```js
MOM()
```

</details>

<details id="indicator-ppo" data-indicator="PPO">
<summary><code>PPO</code> — Percentage Price Oscillator (PPO)</summary>

Percentage difference between two EMAs, with a signal line and histogram.

**Signature**

```text signature
PPO({fastPeriod?: number = 12, slowPeriod?: number = 26, signalPeriod?: number = 9, interval: IntervalString}) -> {ppo: number, signal: number, histogram: number}[]
```

**Parameters**

| Parameter | Default | Aliases |
| --- | --- | --- |
| `fastPeriod` | `12` | `shortPeriod`, `fast` |
| `slowPeriod` | `26` | `longPeriod`, `slow` |
| `signalPeriod` | `9` | `signal` |
| `interval` | `"D"` | — |

**Parameter notes**

- `fastPeriod`: Fast EMA period
- `slowPeriod`: Slow EMA period
- `signalPeriod`: Signal EMA period
- `interval`: Bar interval (e.g. '1m', '1h', 'D')

**Outputs**

| Field | Meaning |
| --- | --- |
| `ppo` | PPO line value |
| `signal` | Signal line (EMA of PPO) |
| `histogram` | PPO minus signal line |

**Example expression**

```js
PPO().ppo
```

</details>

<details id="indicator-pvo" data-indicator="PVO">
<summary><code>PVO</code> — Percentage Volume Oscillator (PVO)</summary>

Percentage difference between two volume EMAs, with a signal line and histogram.

**Signature**

```text signature
PVO({fastPeriod?: number = 12, slowPeriod?: number = 26, signalPeriod?: number = 9, interval: IntervalString}) -> {pvo: number, signal: number, histogram: number}[]
```

**Parameters**

| Parameter | Default | Aliases |
| --- | --- | --- |
| `fastPeriod` | `12` | `shortPeriod`, `fast` |
| `slowPeriod` | `26` | `longPeriod`, `slow` |
| `signalPeriod` | `9` | `signal` |
| `interval` | `"D"` | — |

**Parameter notes**

- `fastPeriod`: Fast EMA period
- `slowPeriod`: Slow EMA period
- `signalPeriod`: Signal EMA period
- `interval`: Bar interval (e.g. '1m', '1h', 'D')

**Outputs**

| Field | Meaning |
| --- | --- |
| `pvo` | PVO line value |
| `signal` | Signal line (EMA of PVO) |
| `histogram` | PVO minus signal line |

**Example expression**

```js
PVO().pvo
```

</details>

<details id="indicator-rsi2" data-indicator="RSI2">
<summary><code>RSI2</code> — RSI 2-Period</summary>

2-period RSI for short-term mean-reversion signals. Equivalent to RSI with period 2.

**Signature**

```text signature
RSI2({interval: IntervalString}) -> number[]
```

**Parameters**

| Parameter | Default | Aliases |
| --- | --- | --- |
| `interval` | `"D"` | — |

**Parameter notes**

- `interval`: Bar interval (e.g. '1m', '1h', 'D')

**Output**

Returns a numeric series; use the function directly.

**Example expression**

```js
RSI2()
```

</details>

<details id="indicator-roc" data-indicator="ROC">
<summary><code>ROC</code> — Rate of Change (ROC)</summary>

Percentage change between current price and the price N periods ago.

**Signature**

```text signature
ROC({period?: number = 14, interval: IntervalString, source?: PriceSource}) -> number[]
```

**Parameters**

| Parameter | Default | Aliases |
| --- | --- | --- |
| `period` | `14` | `length` |
| `interval` | `"D"` | — |
| `source` | `"close"` | — |

**Parameter notes**

- `period`: Lookback period
- `interval`: Bar interval (e.g. '1m', '1h', 'D')
- `source`: Bar price source (e.g. 'close')

**Output**

Returns a numeric series; use the function directly.

**Example expression**

```js
ROC()
```

</details>

<details id="indicator-rsi" data-indicator="RSI">
<summary><code>RSI</code> — Relative Strength Index (RSI)</summary>

Momentum oscillator measuring the speed and magnitude of price changes (0-100).

**Signature**

```text signature
RSI({length?: number = 14, interval: IntervalString, source?: PriceSource}) -> number[]
```

**Parameters**

| Parameter | Default | Aliases |
| --- | --- | --- |
| `length` | `14` | — |
| `interval` | `"D"` | — |
| `source` | `"close"` | — |

**Parameter notes**

- `length`: Period length
- `interval`: Bar interval (e.g. '1m', '1h', 'D')
- `source`: Bar price source (e.g. 'close')

**Output**

Returns a numeric series; use the function directly.

**Example expression**

```js
RSI()
```

</details>

<details id="indicator-stoch" data-indicator="STOCH">
<summary><code>STOCH</code> — Stochastic Oscillator</summary>

Compares closing price to its range over a period.

**Signature**

```text signature
STOCH({kPeriod?: number = 5, kPeriodSlow?: number = 3, dPeriod?: number = 3, dSmoothingType?: string = 'sma', interval: IntervalString}) -> {slowK: number, slowD: number}[]
```

**Parameters**

| Parameter | Default | Aliases |
| --- | --- | --- |
| `kPeriod` | `5` | `kLength` |
| `kPeriodSlow` | `3` | `kSmoothing`, `kSmooth` |
| `dPeriod` | `3` | `dSmoothing`, `dSmooth` |
| `dSmoothingType` | `"sma"` | — |
| `interval` | `"D"` | — |

**Parameter notes**

- `kPeriod`: K period
- `kPeriodSlow`: K slow period
- `dPeriod`: D period
- `dSmoothingType`: %D smoothing algorithm (sma, ema, or wma)
- `interval`: Bar interval (e.g. '1m', '1h', 'D')

**Outputs**

| Field | Meaning |
| --- | --- |
| `slowK` | Slow %K line |
| `slowD` | Slow %D line (SMA of %K) |

**Example expression**

```js
STOCH().slowK
```

</details>

<details id="indicator-stochrsi" data-indicator="STOCHRSI">
<summary><code>STOCHRSI</code> — Stochastic RSI</summary>

Applies the Stochastic formula to RSI values for increased sensitivity.

**Signature**

```text signature
STOCHRSI({rsiPeriod?: number = 14, stochasticPeriod?: number = 14, dPeriod?: number = 3, dSmoothingType?: string = 'sma', interval: IntervalString}) -> {fastK: number, fastD: number}[]
```

**Parameters**

| Parameter | Default | Aliases |
| --- | --- | --- |
| `rsiPeriod` | `14` | — |
| `stochasticPeriod` | `14` | `stochPeriod` |
| `dPeriod` | `3` | — |
| `dSmoothingType` | `"sma"` | — |
| `interval` | `"D"` | — |

**Parameter notes**

- `rsiPeriod`: RSI calculation period
- `stochasticPeriod`: Stochastic lookback period
- `dPeriod`: D smoothing period
- `dSmoothingType`: %D smoothing algorithm (sma, ema, or wma)
- `interval`: Bar interval (e.g. '1m', '1h', 'D')

**Outputs**

| Field | Meaning |
| --- | --- |
| `fastK` | StochRSI %K line |
| `fastD` | StochRSI %D line (SMA of %K) |

**Example expression**

```js
STOCHRSI().fastK
```

</details>

<details id="indicator-tsi" data-indicator="TSI">
<summary><code>TSI</code> — True Strength Index (TSI)</summary>

Double-smoothed momentum oscillator that measures trend strength and direction.

**Signature**

```text signature
TSI({longPeriod?: number = 25, shortPeriod?: number = 13, interval: IntervalString}) -> number[]
```

**Parameters**

| Parameter | Default | Aliases |
| --- | --- | --- |
| `longPeriod` | `25` | `long` |
| `shortPeriod` | `13` | `short` |
| `interval` | `"D"` | — |

**Parameter notes**

- `longPeriod`: Long smoothing period
- `shortPeriod`: Short smoothing period
- `interval`: Bar interval (e.g. '1m', '1h', 'D')

**Output**

Returns a numeric series; use the function directly.

**Example expression**

```js
TSI()
```

</details>

<details id="indicator-uo" data-indicator="UO">
<summary><code>UO</code> — Ultimate Oscillator (UO)</summary>

Multi-period momentum oscillator that combines buying pressure across three lookbacks.

**Signature**

```text signature
UO({period1?: number = 7, period2?: number = 14, period3?: number = 28, interval: IntervalString}) -> number[]
```

**Parameters**

| Parameter | Default | Aliases |
| --- | --- | --- |
| `period1` | `7` | `short` |
| `period2` | `14` | `medium` |
| `period3` | `28` | `long` |
| `interval` | `"D"` | — |

**Parameter notes**

- `period1`: Short lookback period
- `period2`: Medium lookback period
- `period3`: Long lookback period
- `interval`: Bar interval (e.g. '1m', '1h', 'D')

**Output**

Returns a numeric series; use the function directly.

**Example expression**

```js
UO()
```

</details>

<details id="indicator-willr" data-indicator="WILLR">
<summary><code>WILLR</code> — Williams %R</summary>

Oscillator showing overbought/oversold levels (-100 to 0).

**Signature**

```text signature
WILLR({period?: number = 14, interval: IntervalString}) -> number[]
```

**Parameters**

| Parameter | Default | Aliases |
| --- | --- | --- |
| `period` | `14` | `length` |
| `interval` | `"D"` | — |

**Parameter notes**

- `period`: Lookback period
- `interval`: Bar interval (e.g. '1m', '1h', 'D')

**Output**

Returns a numeric series; use the function directly.

**Example expression**

```js
WILLR()
```

</details>

## Structure

<details id="indicator-consol" data-indicator="CONSOL">
<summary><code>CONSOL</code> — Consolidation Range</summary>

Identifies horizontal consolidation ranges where price has been trading sideways.

**Signature**

```text signature
CONSOL({lookback?: number = 200, interval?: IntervalString = '1h'}) -> {isConsolidating: number, rangeHigh: number, rangeLow: number}[]
```

**Parameters**

| Parameter | Default | Aliases |
| --- | --- | --- |
| `lookback` | `200` | — |
| `interval` | `"D"` | — |

**Parameter notes**

- `lookback`: Number of bars to analyze for consolidation
- `interval`: Bar interval (e.g. '1m', '1h', 'D')

**Outputs**

| Field | Meaning |
| --- | --- |
| `isConsolidating` | Whether price is in a consolidation range |
| `rangeHigh` | Upper bound of the consolidation range |
| `rangeLow` | Lower bound of the consolidation range |

**Example expression**

```js
CONSOL().isConsolidating
```

</details>

<details id="indicator-extents" data-indicator="EXTENTS">
<summary><code>EXTENTS</code> — Extents</summary>

Highest high and lowest low over a rolling window.

**Signature**

```text signature
EXTENTS({period?: number = 1, interval: IntervalString}) -> {highest: number, lowest: number}[]
```

**Parameters**

| Parameter | Default | Aliases |
| --- | --- | --- |
| `period` | `1` | — |
| `interval` | `"D"` | — |

**Parameter notes**

- `period`: Lookback period
- `interval`: Bar interval (e.g. '1m', '1h', 'D')

**Outputs**

| Field | Meaning |
| --- | --- |
| `highest` | Highest high in the window |
| `lowest` | Lowest low in the window |

**Example expression**

```js
EXTENTS().highest
```

</details>

<details id="indicator-ib" data-indicator="IB">
<summary><code>IB</code> — Initial Balance (IB)</summary>

High and low of the first hour of the trading session.

**Signature**

```text signature
IB({lookback?: number = 3}) -> {ibHigh: number, ibLow: number}[]
```

**Parameters**

| Parameter | Default | Aliases |
| --- | --- | --- |
| `lookback` | `3` | — |

**Parameter notes**

- `lookback`: Number of sessions to calculate IB for

**Outputs**

| Field | Meaning |
| --- | --- |
| `ibHigh` | Initial balance high |
| `ibLow` | Initial balance low |

**Example expression**

```js
IB().ibHigh
```

</details>

<details id="indicator-or" data-indicator="OR">
<summary><code>OR</code> — Opening Range (OR)</summary>

High and low of the opening range of the trading session.

**Signature**

```text signature
OR({duration?: number = 5}) -> {orHigh: number, orLow: number}[]
```

**Parameters**

| Parameter | Default | Aliases |
| --- | --- | --- |
| `duration` | `5` | `minutes` |

**Parameter notes**

- `duration`: Opening range duration in minutes from RTH open

**Outputs**

| Field | Meaning |
| --- | --- |
| `orHigh` | Opening range high |
| `orLow` | Opening range low |

**Example expression**

```js
OR().orHigh
```

</details>

<details id="indicator-fib_levels" data-indicator="FIB_LEVELS">
<summary><code>FIB_LEVELS</code> — Fibonacci Levels</summary>

Retracement and extension levels from the most recent completed anchor swing.

**Signature**

```text signature
FIB_LEVELS({lookback: number, source: string, anchorProvider: string}) -> {anchorStartPrice: number, anchorEndPrice: number, anchorStartBarsAgo: number, anchorEndBarsAgo: number, swingDirection: number, swingSize: number, anchorConfidence: number, retracement236: number, retracement382: number, retracement500: number, retracement618: number, retracement786: number, extension1272: number, extension1618: number, extension2000: number, extension2618: number}
```

**Parameters**

| Parameter | Default | Aliases |
| --- | --- | --- |
| `lookback` | `120` | — |
| `source` | `high-low` | — |
| `anchorProvider` | `swing` | — |
| `leftBars` | `1` | — |
| `rightBars` | `1` | — |
| `requireConfirmed` | `true` | — |
| `reversalPercent` | `5` | — |
| `atrPeriod` | — | — |
| `atrMultiplier` | — | — |
| `anchorStartBarsAgo` | — | — |
| `anchorEndBarsAgo` | — | — |
| `anchorStartPrice` | — | — |
| `anchorEndPrice` | — | — |
| `swingDirection` | — | — |
| `interval` | `"D"` | — |

**Parameter notes**

- `lookback`: Bars retained for anchor selection
- `source`: Pivot price source: high-low or close
- `anchorProvider`: Anchor provider: swing, manual, or zigzag
- `leftBars`: Swing provider left bars
- `rightBars`: Swing provider right bars
- `requireConfirmed`: Require confirmed pivots
- `reversalPercent`: ZigZag percentage reversal threshold
- `atrPeriod`: ZigZag ATR period
- `atrMultiplier`: ZigZag ATR multiplier
- `anchorStartBarsAgo`: Manual anchor start offset
- `anchorEndBarsAgo`: Manual anchor end offset
- `anchorStartPrice`: Manual anchor start price
- `anchorEndPrice`: Manual anchor end price
- `swingDirection`: Manual anchor direction, 1 for up and -1 for down
- `interval`: Bar interval (e.g. '1m', '1h', 'D')

**Outputs**

| Field | Meaning |
| --- | --- |
| `anchorStartPrice` | Anchor start price |
| `anchorEndPrice` | Anchor end price |
| `anchorStartBarsAgo` | Bars since anchor start |
| `anchorEndBarsAgo` | Bars since anchor end |
| `swingDirection` | Anchor direction, 1 for upward and -1 for downward |
| `swingSize` | Absolute anchor swing size |
| `anchorConfidence` | Minimum provider confidence across anchor pivots |
| `retracement236` | 23.6% retracement level |
| `retracement382` | 38.2% retracement level |
| `retracement500` | 50.0% retracement level |
| `retracement618` | 61.8% retracement level |
| `retracement786` | 78.6% retracement level |
| `extension1272` | 127.2% extension level |
| `extension1618` | 161.8% extension level |
| `extension2000` | 200.0% extension level |
| `extension2618` | 261.8% extension level |

**Example expression**

```js
FIB_LEVELS().anchorStartPrice
```

</details>

<details id="indicator-fib_pattern" data-indicator="FIB_PATTERN">
<summary><code>FIB_PATTERN</code> — Fibonacci Pattern</summary>

Fibonacci harmonic pattern completion signals from pivot providers.

**Signature**

```text signature
FIB_PATTERN({pattern: string, lookback: number, source: string, anchorProvider: string}) -> {matched: number, confidence: number, completionPrice: number, stopPrice: number, target1: number, target2: number, ageBars: number, patternDirection: number}
```

**Parameters**

| Parameter | Default | Aliases |
| --- | --- | --- |
| `pattern` | `abcd` | — |
| `lookback` | `200` | — |
| `source` | `high-low` | — |
| `anchorProvider` | `swing` | — |
| `leftBars` | `1` | — |
| `rightBars` | `1` | — |
| `requireConfirmed` | `true` | — |
| `reversalPercent` | `5` | — |
| `tolerance` | `0.08` | — |
| `maxAgeBars` | `20` | — |
| `xBarsAgo` | — | — |
| `aBarsAgo` | — | — |
| `bBarsAgo` | — | — |
| `cBarsAgo` | — | — |
| `dBarsAgo` | — | — |
| `xPrice` | — | — |
| `aPrice` | — | — |
| `bPrice` | — | — |
| `cPrice` | — | — |
| `dPrice` | — | — |
| `patternDirection` | — | — |
| `interval` | `"D"` | — |

**Parameter notes**

- `pattern`: Pattern: abcd, gartley, bat, or butterfly
- `lookback`: Bars retained for pivot selection
- `source`: Pivot price source: high-low or close
- `anchorProvider`: Pivot provider: swing, manual, or zigzag
- `leftBars`: Swing provider left bars
- `rightBars`: Swing provider right bars
- `requireConfirmed`: Require confirmed pivots
- `reversalPercent`: ZigZag percentage reversal threshold
- `tolerance`: Allowed fractional ratio error
- `maxAgeBars`: Maximum completion age before a match is stale
- `xBarsAgo`: Manual X pivot offset for XABCD patterns
- `aBarsAgo`: Manual A pivot offset
- `bBarsAgo`: Manual B pivot offset
- `cBarsAgo`: Manual C pivot offset
- `dBarsAgo`: Manual D pivot offset
- `xPrice`: Manual X pivot price
- `aPrice`: Manual A pivot price
- `bPrice`: Manual B pivot price
- `cPrice`: Manual C pivot price
- `dPrice`: Manual D pivot price
- `patternDirection`: Manual pattern direction, 1 for bullish and -1 for bearish
- `interval`: Bar interval (e.g. '1m', '1h', 'D')

**Outputs**

| Field | Meaning |
| --- | --- |
| `matched` | 1 when the selected pattern is matched |
| `confidence` | Ratio conformance score from 0 to 1 |
| `completionPrice` | Pattern completion price |
| `stopPrice` | Projected stop price |
| `target1` | First projected target |
| `target2` | Second projected target |
| `ageBars` | Bars since the completion pivot |
| `patternDirection` | 1 for bullish, -1 for bearish, 0 for unmatched |

**Example expression**

```js
FIB_PATTERN().matched
```

</details>

## Trend

<details id="indicator-apo" data-indicator="APO">
<summary><code>APO</code> — Absolute Price Oscillator (APO)</summary>

Difference between a fast and slow EMA of price.

**Signature**

```text signature
APO({fastLength?: number = 12, slowLength?: number = 26, interval: IntervalString}) -> number[]
```

**Parameters**

| Parameter | Default | Aliases |
| --- | --- | --- |
| `fastLength` | `12` | `shortPeriod`, `fast` |
| `slowLength` | `26` | `longPeriod`, `slow` |
| `interval` | `"D"` | — |

**Parameter notes**

- `fastLength`: Fast EMA period
- `slowLength`: Slow EMA period
- `interval`: Bar interval (e.g. '1m', '1h', 'D')

**Output**

Returns a numeric series; use the function directly.

**Example expression**

```js
APO()
```

</details>

<details id="indicator-aroon" data-indicator="AROON">
<summary><code>AROON</code> — Aroon Indicator</summary>

Identifies trend changes and strength via up/down lines and oscillator.

**Signature**

```text signature
AROON({period?: number = 14, interval: IntervalString}) -> {up: number, down: number, oscillator: number}[]
```

**Parameters**

| Parameter | Default | Aliases |
| --- | --- | --- |
| `period` | `14` | `length` |
| `interval` | `"D"` | — |

**Parameter notes**

- `period`: Lookback period
- `interval`: Bar interval (e.g. '1m', '1h', 'D')

**Outputs**

| Field | Meaning |
| --- | --- |
| `up` | Aroon Up — measures bars since highest high |
| `down` | Aroon Down — measures bars since lowest low |
| `oscillator` | Aroon Up minus Aroon Down |

**Example expression**

```js
AROON().up
```

</details>

<details id="indicator-adx" data-indicator="ADX">
<summary><code>ADX</code> — Average Directional Index (ADX)</summary>

Measures trend strength regardless of direction.

**Signature**

```text signature
ADX({period?: number = 14, interval: IntervalString}) -> number[]
```

**Parameters**

| Parameter | Default | Aliases |
| --- | --- | --- |
| `period` | `14` | `length` |
| `interval` | `"D"` | — |

**Parameter notes**

- `period`: Lookback period
- `interval`: Bar interval (e.g. '1m', '1h', 'D')

**Output**

Returns a numeric series; use the function directly.

**Example expression**

```js
ADX()
```

</details>

<details id="indicator-bop" data-indicator="BOP">
<summary><code>BOP</code> — Balance of Power (BOP)</summary>

Compares the relative strength of buyers and sellers.

**Signature**

```text signature
BOP({interval: IntervalString}) -> number[]
```

**Parameters**

| Parameter | Default | Aliases |
| --- | --- | --- |
| `interval` | `"D"` | — |

**Parameter notes**

- `interval`: Bar interval (e.g. '1m', '1h', 'D')

**Output**

Returns a numeric series; use the function directly.

**Example expression**

```js
BOP()
```

</details>

<details id="indicator-cfo" data-indicator="CFO">
<summary><code>CFO</code> — Chande Forecast Oscillator (CFO)</summary>

Forecast oscillator from a linear regression projection.

**Signature**

```text signature
CFO({period?: number = 14, interval: IntervalString}) -> number[]
```

**Parameters**

| Parameter | Default | Aliases |
| --- | --- | --- |
| `period` | `14` | `length` |
| `interval` | `"D"` | — |

**Parameter notes**

- `period`: Lookback period
- `interval`: Bar interval (e.g. '1m', '1h', 'D')

**Output**

Returns a numeric series; use the function directly.

**Example expression**

```js
CFO()
```

</details>

<details id="indicator-dema" data-indicator="DEMA">
<summary><code>DEMA</code> — Double Exponential Moving Average (DEMA)</summary>

Reduces lag versus a single EMA.

**Signature**

```text signature
DEMA({length?: number = 20, interval: IntervalString, source?: PriceSource}) -> number[]
```

**Parameters**

| Parameter | Default | Aliases |
| --- | --- | --- |
| `length` | `20` | `period` |
| `interval` | `"D"` | — |
| `source` | `"close"` | — |

**Parameter notes**

- `length`: Lookback period
- `interval`: Bar interval (e.g. '1m', '1h', 'D')
- `source`: Bar price source (e.g. 'close')

**Output**

Returns a numeric series; use the function directly.

**Example expression**

```js
DEMA()
```

</details>

<details id="indicator-dmi" data-indicator="DMI">
<summary><code>DMI</code> — Directional Movement Index (DMI)</summary>

Identifies direction of price movement via +DI and -DI lines.

**Signature**

```text signature
DMI({period?: number = 14, interval: IntervalString}) -> {plusDi: number, minusDi: number}[]
```

**Parameters**

| Parameter | Default | Aliases |
| --- | --- | --- |
| `period` | `14` | `length` |
| `interval` | `"D"` | — |

**Parameter notes**

- `period`: Lookback period
- `interval`: Bar interval (e.g. '1m', '1h', 'D')

**Outputs**

| Field | Meaning |
| --- | --- |
| `plusDi` | Positive directional indicator (+DI) |
| `minusDi` | Negative directional indicator (-DI) |

**Example expression**

```js
DMI().plusDi
```

</details>

<details id="indicator-ichimoku" data-indicator="ICHIMOKU">
<summary><code>ICHIMOKU</code> — Ichimoku Cloud</summary>

Multi-component indicator providing support/resistance, trend direction, and momentum signals. Chart-only displacement is not a function argument. Senkou spans are raw/unshifted and chikouSpan=current close. At source offset n, forward plot displacement d uses senkouSpanA[n+d], senkouSpanB[n+d]; tenkanSen/kijunSen stay at n. Accepted positive integer periods satisfy 0 &lt; tenkanSenPeriod &lt;= kijunSenPeriod &lt;= senkouSpanBPeriod. Bundle warmup: senkouSpanBPeriod bars (largest period); indexed history availability is independent.

**Signature**

```text signature
ICHIMOKU({tenkanSenPeriod?: number = 9, kijunSenPeriod?: number = 26, senkouSpanBPeriod?: number = 52, interval: IntervalString}) -> {tenkanSen: number, kijunSen: number, senkouSpanA: number, senkouSpanB: number, chikouSpan: number}[]
```

**Parameters**

| Parameter | Default | Aliases |
| --- | --- | --- |
| `tenkanSenPeriod` | `9` | `tenkan` |
| `kijunSenPeriod` | `26` | `kijun` |
| `senkouSpanBPeriod` | `52` | `senkou_b` |
| `interval` | `"D"` | — |

**Parameter notes**

- `tenkanSenPeriod`: Tenkan-sen period
- `kijunSenPeriod`: Kijun-sen period
- `senkouSpanBPeriod`: Source-bar lookback; positive integer periods: 0 &lt; tenkanSenPeriod &lt;= kijunSenPeriod &lt;= senkouSpanBPeriod. Bundle warmup: senkouSpanBPeriod bars (largest period); indexed history availability is independent. Chart-only displacement is not a function argument. Senkou spans are raw/unshifted and chikouSpan=current close. At source offset n, forward displacement d uses senkouSpanA[n+d], senkouSpanB[n+d]; tenkanSen/kijunSen stay at n.
- `interval`: Bar interval (e.g. '1m', '1h', 'D')

**Outputs**

| Field | Meaning |
| --- | --- |
| `tenkanSen` | Conversion line: high/low midpoint over tenkanSenPeriod at the source bar |
| `kijunSen` | Base line: high/low midpoint over kijunSenPeriod at the source bar |
| `senkouSpanA` | Raw, unshifted Senkou Span A: midpoint of Tenkan and Kijun at the source bar |
| `senkouSpanB` | Raw, unshifted Senkou Span B: high/low midpoint over senkouSpanBPeriod at the source bar |
| `chikouSpan` | Current source-bar close; backward displacement is a charting convention only |

**Example expression**

```js
ICHIMOKU().tenkanSen
```

</details>

<details id="indicator-kama" data-indicator="KAMA">
<summary><code>KAMA</code> — Kaufman Adaptive Moving Average (KAMA)</summary>

Adaptive moving average that adjusts smoothing based on market efficiency.

**Signature**

```text signature
KAMA({length?: number = 20, interval: IntervalString, source?: PriceSource}) -> number[]
```

**Parameters**

| Parameter | Default | Aliases |
| --- | --- | --- |
| `length` | `20` | `period` |
| `interval` | `"D"` | — |
| `source` | `"close"` | — |

**Parameter notes**

- `length`: Lookback period
- `interval`: Bar interval (e.g. '1m', '1h', 'D')
- `source`: Bar price source (e.g. 'close')

**Output**

Returns a numeric series; use the function directly.

**Example expression**

```js
KAMA()
```

</details>

<details id="indicator-kdj" data-indicator="KDJ">
<summary><code>KDJ</code> — Random Index (KDJ)</summary>

Extended stochastic oscillator with an additional J line for overbought/oversold signals.

**Signature**

```text signature
KDJ({rsv?: number = 3, k?: number = 3, d?: number = 3, interval: IntervalString}) -> {k: number, d: number, j: number}[]
```

**Parameters**

| Parameter | Default | Aliases |
| --- | --- | --- |
| `rsv` | `3` | — |
| `k` | `3` | — |
| `d` | `3` | — |
| `interval` | `"D"` | — |

**Parameter notes**

- `rsv`: RSV period
- `k`: K period
- `d`: D period
- `interval`: Bar interval (e.g. '1m', '1h', 'D')

**Outputs**

| Field | Meaning |
| --- | --- |
| `k` | K line (smoothed RSV) |
| `d` | D line (smoothed K) |
| `j` | J line (3K - 2D divergence) |

**Example expression**

```js
KDJ().k
```

</details>

<details id="indicator-linreg" data-indicator="LINREG">
<summary><code>LINREG</code> — Linear Regression</summary>

Linear regression slope, projected value, and intercept over a rolling window.

**Signature**

```text signature
LINREG({period?: number = 14, interval: IntervalString, source?: PriceSource}) -> {slope: number, value: number, intercept: number}[]
```

**Parameters**

| Parameter | Default | Aliases |
| --- | --- | --- |
| `period` | `14` | `length` |
| `interval` | `"D"` | — |
| `source` | `"close"` | — |

**Parameter notes**

- `period`: Lookback period
- `interval`: Bar interval (e.g. '1m', '1h', 'D')
- `source`: Bar price source (e.g. 'close')

**Outputs**

| Field | Meaning |
| --- | --- |
| `slope` | Regression slope per bar |
| `value` | Projected regression value at current bar |
| `intercept` | Y-intercept of the regression line |

**Example expression**

```js
LINREG().slope
```

</details>

<details id="indicator-mi" data-indicator="MI">
<summary><code>MI</code> — Mass Index (MI)</summary>

Identifies trend reversals by measuring the narrowing and widening of the range between high and low prices.

**Signature**

```text signature
MI({period?: number = 25, interval: IntervalString}) -> number[]
```

**Parameters**

| Parameter | Default | Aliases |
| --- | --- | --- |
| `period` | `25` | `length` |
| `interval` | `"D"` | — |

**Parameter notes**

- `period`: Period length
- `interval`: Bar interval (e.g. '1m', '1h', 'D')

**Output**

Returns a numeric series; use the function directly.

**Example expression**

```js
MI()
```

</details>

<details id="indicator-ma" data-indicator="MA">
<summary><code>MA</code> — Moving Average (MA)</summary>

Generic moving average with selectable sub-type.

**Signature**

```text signature
MA({length?: number = 20, type?: 'sma'|'ema'|..., interval: IntervalString, source?: PriceSource}) -> number[]
```

**Parameters**

| Parameter | Default | Aliases |
| --- | --- | --- |
| `length` | `20` | `period` |
| `type` | — | — |
| `interval` | `"D"` | — |
| `source` | `"close"` | — |

**Parameter notes**

- `length`: Lookback period
- `type`: Moving-average sub-type
- `interval`: Bar interval (e.g. '1m', '1h', 'D')
- `source`: Bar price source (e.g. 'close')

**Output**

Returns a numeric series; use the function directly.

**Example expression**

```js
MA()
```

</details>

<details id="indicator-sma" data-indicator="SMA">
<summary><code>SMA</code> — Simple Moving Average (SMA)</summary>

Arithmetic mean over the last N bars.

**Signature**

```text signature
SMA({length?: number = 20, interval: IntervalString, source?: PriceSource}) -> number[]
```

**Parameters**

| Parameter | Default | Aliases |
| --- | --- | --- |
| `length` | `20` | `period` |
| `interval` | `"D"` | — |
| `source` | `"close"` | — |

**Parameter notes**

- `length`: Lookback period
- `interval`: Bar interval (e.g. '1m', '1h', 'D')
- `source`: Bar price source (e.g. 'close')

**Output**

Returns a numeric series; use the function directly.

**Example expression**

```js
SMA()
```

</details>

<details id="indicator-ema" data-indicator="EMA">
<summary><code>EMA</code> — Exponential Moving Average (EMA)</summary>

Exponentially weighted moving average.

**Signature**

```text signature
EMA({length?: number = 20, interval: IntervalString, source?: PriceSource}) -> number[]
```

**Parameters**

| Parameter | Default | Aliases |
| --- | --- | --- |
| `length` | `20` | `period` |
| `interval` | `"D"` | — |
| `source` | `"close"` | — |

**Parameter notes**

- `length`: Lookback period
- `interval`: Bar interval (e.g. '1m', '1h', 'D')
- `source`: Bar price source (e.g. 'close')

**Output**

Returns a numeric series; use the function directly.

**Example expression**

```js
EMA()
```

</details>

<details id="indicator-macd" data-indicator="MACD">
<summary><code>MACD</code> — Moving Average Convergence Divergence (MACD)</summary>

Trend-following momentum indicator showing the relationship between two moving averages.

**Signature**

```text signature
MACD({shortPeriod?: number = 12, longPeriod?: number = 26, signalPeriod?: number = 9, interval: IntervalString}) -> {macd: number, signal: number, histogram: number}[]
```

**Parameters**

| Parameter | Default | Aliases |
| --- | --- | --- |
| `shortPeriod` | `12` | `fastLength`, `fast` |
| `longPeriod` | `26` | `slowLength`, `slow` |
| `signalPeriod` | `9` | `signalLength`, `signal` |
| `interval` | `"D"` | — |

**Parameter notes**

- `shortPeriod`: Short EMA period
- `longPeriod`: Long EMA period
- `signalPeriod`: Signal EMA period
- `interval`: Bar interval (e.g. '1m', '1h', 'D')

**Outputs**

| Field | Meaning |
| --- | --- |
| `macd` | MACD line (fast EMA minus slow EMA) |
| `signal` | Signal line (EMA of MACD) |
| `histogram` | MACD minus signal line |

**Example expression**

```js
MACD().macd
```

</details>

<details id="indicator-sar" data-indicator="SAR">
<summary><code>SAR</code> — Parabolic SAR</summary>

Trailing stop-and-reverse indicator for trend detection.

**Signature**

```text signature
SAR({interval: IntervalString, initialAccelerationFactor?: number = 0.02, maxAccelerationFactor?: number = 0.2}) -> number[]
```

**Parameters**

| Parameter | Default | Aliases |
| --- | --- | --- |
| `initialAccelerationFactor` | `0.02` | `afStep`, `step` |
| `maxAccelerationFactor` | `0.2` | `afMax`, `max` |
| `interval` | `"D"` | — |

**Parameter notes**

- `initialAccelerationFactor`: Initial acceleration factor
- `maxAccelerationFactor`: Maximum acceleration factor
- `interval`: Bar interval (e.g. '1m', '1h', 'D')

**Output**

Returns a numeric series; use the function directly.

**Example expression**

```js
SAR()
```

</details>

<details id="indicator-qstick" data-indicator="QSTICK">
<summary><code>QSTICK</code> — Qstick</summary>

Moving average of the difference between open and close prices to quantify buying/selling pressure.

**Signature**

```text signature
QSTICK({period?: number = 8, interval: IntervalString}) -> number[]
```

**Parameters**

| Parameter | Default | Aliases |
| --- | --- | --- |
| `period` | `8` | `length` |
| `interval` | `"D"` | — |

**Parameter notes**

- `period`: Period length
- `interval`: Bar interval (e.g. '1m', '1h', 'D')

**Output**

Returns a numeric series; use the function directly.

**Example expression**

```js
QSTICK()
```

</details>

<details id="indicator-rma" data-indicator="RMA">
<summary><code>RMA</code> — Rolling Moving Average (RMA)</summary>

Wilder's smoothed moving average.

**Signature**

```text signature
RMA({period?: number = 14, interval: IntervalString, source?: PriceSource}) -> number[]
```

**Parameters**

| Parameter | Default | Aliases |
| --- | --- | --- |
| `period` | `14` | `length` |
| `interval` | `"D"` | — |
| `source` | `"close"` | — |

**Parameter notes**

- `period`: Lookback period
- `interval`: Bar interval (e.g. '1m', '1h', 'D')
- `source`: Bar price source (e.g. 'close')

**Output**

Returns a numeric series; use the function directly.

**Example expression**

```js
RMA()
```

</details>

<details id="indicator-since_change" data-indicator="SINCE_CHANGE">
<summary><code>SINCE_CHANGE</code> — Since Change</summary>

Counts the number of bars since the last significant price change exceeding a threshold.

**Signature**

```text signature
SINCE_CHANGE({threshold?: number = 0.5, interval: IntervalString}) -> number[]
```

**Parameters**

| Parameter | Default | Aliases |
| --- | --- | --- |
| `threshold` | `0.5` | — |
| `interval` | `"D"` | — |

**Parameter notes**

- `threshold`: Percentage threshold for significant change
- `interval`: Bar interval (e.g. '1m', '1h', 'D')

**Output**

Returns a numeric series; use the function directly.

**Example expression**

```js
SINCE_CHANGE()
```

</details>

<details id="indicator-typprice" data-indicator="TYPPRICE">
<summary><code>TYPPRICE</code> — Typical Price</summary>

Average of the high, low, and close prices for each bar.

**Signature**

```text signature
TYPPRICE({interval: IntervalString}) -> number[]
```

**Parameters**

| Parameter | Default | Aliases |
| --- | --- | --- |
| `interval` | `"D"` | — |

**Parameter notes**

- `interval`: Bar interval (e.g. '1m', '1h', 'D')

**Output**

Returns a numeric series; use the function directly.

**Example expression**

```js
TYPPRICE()
```

</details>

<details id="indicator-vortex" data-indicator="VORTEX">
<summary><code>VORTEX</code> — Vortex Indicator</summary>

Identifies the start of a new trend or the continuation of an existing trend via +VI and -VI lines.

**Signature**

```text signature
VORTEX({period?: number = 14, interval: IntervalString}) -> {plus: number, minus: number}[]
```

**Parameters**

| Parameter | Default | Aliases |
| --- | --- | --- |
| `period` | `14` | `length` |
| `interval` | `"D"` | — |

**Parameter notes**

- `period`: Lookback period
- `interval`: Bar interval (e.g. '1m', '1h', 'D')

**Outputs**

| Field | Meaning |
| --- | --- |
| `plus` | Positive vortex indicator (+VI) |
| `minus` | Negative vortex indicator (-VI) |

**Example expression**

```js
VORTEX().plus
```

</details>

<details id="indicator-wma" data-indicator="WMA">
<summary><code>WMA</code> — Weighted Moving Average (WMA)</summary>

Linearly weighted moving average emphasising recent prices.

**Signature**

```text signature
WMA({length?: number = 20, interval: IntervalString, source?: PriceSource}) -> number[]
```

**Parameters**

| Parameter | Default | Aliases |
| --- | --- | --- |
| `length` | `20` | `period` |
| `interval` | `"D"` | — |
| `source` | `"close"` | — |

**Parameter notes**

- `length`: Lookback period
- `interval`: Bar interval (e.g. '1m', '1h', 'D')
- `source`: Bar price source (e.g. 'close')

**Output**

Returns a numeric series; use the function directly.

**Example expression**

```js
WMA()
```

</details>

<details id="indicator-wsma" data-indicator="WSMA">
<summary><code>WSMA</code> — Wilder's Smoothed Moving Average (WSMA)</summary>

Wilder's smoothing method used internally by RSI and ATR, with a smoothing factor of 1/period.

**Signature**

```text signature
WSMA({period?: number = 14, interval: IntervalString, source?: PriceSource}) -> number[]
```

**Parameters**

| Parameter | Default | Aliases |
| --- | --- | --- |
| `period` | `14` | `length` |
| `interval` | `"D"` | — |
| `source` | `"close"` | — |

**Parameter notes**

- `period`: Period length
- `interval`: Bar interval (e.g. '1m', '1h', 'D')
- `source`: Bar price source (e.g. 'close')

**Output**

Returns a numeric series; use the function directly.

**Example expression**

```js
WSMA()
```

</details>

## Volatility

<details id="indicator-accel_bands" data-indicator="ACCEL_BANDS">
<summary><code>ACCEL_BANDS</code> — Acceleration Bands</summary>

Envelope bands that adapt to volatility using a standard deviation multiplier.

**Signature**

```text signature
ACCEL_BANDS({period?: number = 20, interval: IntervalString}) -> {upper: number, lower: number}[]
```

**Parameters**

| Parameter | Default | Aliases |
| --- | --- | --- |
| `period` | `20` | `length` |
| `interval` | `"D"` | — |

**Parameter notes**

- `period`: Period length
- `interval`: Bar interval (e.g. '1m', '1h', 'D')

**Outputs**

| Field | Meaning |
| --- | --- |
| `upper` | Upper acceleration band |
| `lower` | Lower acceleration band |

**Example expression**

```js
ACCEL_BANDS().upper
```

</details>

<details id="indicator-atr" data-indicator="ATR">
<summary><code>ATR</code> — Average True Range (ATR)</summary>

Measures market volatility by decomposing the range of an asset price.

**Signature**

```text signature
ATR({period?: number = 14, interval: IntervalString, normalized?: boolean = false}) -> number[]
```

**Parameters**

| Parameter | Default | Aliases |
| --- | --- | --- |
| `period` | `14` | `length` |
| `interval` | `"D"` | — |
| `normalized` | `false` | — |

**Parameter notes**

- `period`: Lookback period
- `interval`: Bar interval (e.g. '1m', '1h', 'D')
- `normalized`: Return ATR normalized to price (100 * ATR / close)

**Output**

Returns a numeric series; use the function directly.

**Example expression**

```js
ATR()
```

</details>

<details id="indicator-natr" data-indicator="NATR">
<summary><code>NATR</code> — Normalized Average True Range (NATR)</summary>

ATR expressed as a percentage of the closing price for cross-instrument comparison.

**Signature**

```text signature
NATR({period?: number = 14, interval: IntervalString, normalized?: boolean = true}) -> number[]
```

**Parameters**

| Parameter | Default | Aliases |
| --- | --- | --- |
| `period` | `14` | `length` |
| `interval` | `"D"` | — |
| `normalized` | `true` | — |

**Parameter notes**

- `period`: Lookback period
- `interval`: Bar interval (e.g. '1m', '1h', 'D')
- `normalized`: Return ATR normalized to price (100 * ATR / close)

**Output**

Returns a numeric series; use the function directly.

**Example expression**

```js
NATR()
```

</details>

<details id="indicator-bbands" data-indicator="BBANDS">
<summary><code>BBANDS</code> — Bollinger Bands</summary>

Volatility bands placed above and below a moving average.

**Signature**

```text signature
BBANDS({period?: number = 20, stdDev?: number = 2, interval: IntervalString, source?: PriceSource}) -> {upper: number, middle: number, lower: number}[]
```

**Parameters**

| Parameter | Default | Aliases |
| --- | --- | --- |
| `period` | `20` | `length` |
| `stdDev` | `2` | — |
| `interval` | `"D"` | — |
| `source` | `"close"` | — |

**Parameter notes**

- `period`: SMA period
- `stdDev`: Standard deviation multiplier
- `interval`: Bar interval (e.g. '1m', '1h', 'D')
- `source`: Bar price source (e.g. 'close')

**Outputs**

| Field | Meaning |
| --- | --- |
| `upper` | Upper Bollinger Band |
| `middle` | Middle band (SMA) |
| `lower` | Lower Bollinger Band |

**Example expression**

```js
BBANDS().upper
```

</details>

<details id="indicator-bbw" data-indicator="BBW">
<summary><code>BBW</code> — Bollinger Bands Width (BBW)</summary>

Width of Bollinger Bands as a ratio, useful for identifying squeezes.

**Signature**

```text signature
BBW({period?: number = 20, stdDev?: number = 2, interval: IntervalString}) -> number[]
```

**Parameters**

| Parameter | Default | Aliases |
| --- | --- | --- |
| `period` | `20` | `length` |
| `stdDev` | `2` | — |
| `interval` | `"D"` | — |

**Parameter notes**

- `period`: Period length
- `stdDev`: Standard deviation multiplier
- `interval`: Bar interval (e.g. '1m', '1h', 'D')

**Output**

Returns a numeric series; use the function directly.

**Example expression**

```js
BBW()
```

</details>

<details id="indicator-bbpctb" data-indicator="BBPCTB">
<summary><code>BBPCTB</code> — Bollinger Percent B</summary>

Shows where price is relative to the Bollinger Bands (0 = lower band, 1 = upper band).

**Signature**

```text signature
BBPCTB({period?: number = 20, stdDev?: number = 2, interval: IntervalString}) -> number[]
```

**Parameters**

| Parameter | Default | Aliases |
| --- | --- | --- |
| `period` | `20` | `length` |
| `stdDev` | `2` | — |
| `interval` | `"D"` | — |

**Parameter notes**

- `period`: Period length
- `stdDev`: Standard deviation multiplier
- `interval`: Bar interval (e.g. '1m', '1h', 'D')

**Output**

Returns a numeric series; use the function directly.

**Example expression**

```js
BBPCTB()
```

</details>

<details id="indicator-chandelier" data-indicator="CHANDELIER">
<summary><code>CHANDELIER</code> — Chandelier Exit</summary>

ATR-based trailing stop that hangs from the highest high or lowest low.

**Signature**

```text signature
CHANDELIER({interval: IntervalString, period?: number = 22, multiplier?: number = 3}) -> {longExit: number, shortExit: number}[]
```

**Parameters**

| Parameter | Default | Aliases |
| --- | --- | --- |
| `period` | `22` | `length` |
| `multiplier` | `3` | `factor` |
| `interval` | `"D"` | — |

**Parameter notes**

- `period`: ATR and high/low lookback length
- `multiplier`: ATR multiplier
- `interval`: Bar interval (e.g. '1m', '1h', 'D')

**Outputs**

| Field | Meaning |
| --- | --- |
| `longExit` | Long exit stop level |
| `shortExit` | Short exit stop level |

**Example expression**

```js
CHANDELIER().longExit
```

</details>

<details id="indicator-donchian" data-indicator="DONCHIAN">
<summary><code>DONCHIAN</code> — Donchian Channel (DC)</summary>

Channels formed by the highest high and lowest low over a lookback period.

**Signature**

```text signature
DONCHIAN({interval: IntervalString, period?: number = 20}) -> {upper: number, middle: number, lower: number}[]
```

**Parameters**

| Parameter | Default | Aliases |
| --- | --- | --- |
| `period` | `20` | `length` |
| `interval` | `"D"` | — |

**Parameter notes**

- `period`: Period length
- `interval`: Bar interval (e.g. '1m', '1h', 'D')

**Outputs**

| Field | Meaning |
| --- | --- |
| `upper` | Highest high over the period |
| `middle` | Midpoint of upper and lower channels |
| `lower` | Lowest low over the period |

**Example expression**

```js
DONCHIAN().upper
```

</details>

<details id="indicator-kc" data-indicator="KC">
<summary><code>KC</code> — Keltner Channel (KC)</summary>

Volatility-based envelope set above and below an EMA using ATR.

**Signature**

```text signature
KC({emaPeriod?: number = 20, atrPeriod?: number = 10, multiplier?: number = 2, interval: IntervalString}) -> {upper: number, middle: number, lower: number}[]
```

**Parameters**

| Parameter | Default | Aliases |
| --- | --- | --- |
| `emaPeriod` | `20` | — |
| `atrPeriod` | `10` | — |
| `multiplier` | `2` | `factor` |
| `interval` | `"D"` | — |

**Parameter notes**

- `emaPeriod`: EMA period for the middle band
- `atrPeriod`: ATR period for channel width
- `multiplier`: ATR multiplier for upper/lower bands
- `interval`: Bar interval (e.g. '1m', '1h', 'D')

**Outputs**

| Field | Meaning |
| --- | --- |
| `upper` | Upper Keltner channel |
| `middle` | Middle band (EMA) |
| `lower` | Lower Keltner channel |

**Example expression**

```js
KC().upper
```

</details>

<details id="indicator-mad" data-indicator="MAD">
<summary><code>MAD</code> — Mean Absolute Deviation (MAD)</summary>

Average absolute deviation of price from its mean over a rolling window.

**Signature**

```text signature
MAD({period?: number = 14, interval: IntervalString, source?: PriceSource}) -> number[]
```

**Parameters**

| Parameter | Default | Aliases |
| --- | --- | --- |
| `period` | `14` | `length` |
| `interval` | `"D"` | — |
| `source` | `"close"` | — |

**Parameter notes**

- `period`: Lookback period
- `interval`: Bar interval (e.g. '1m', '1h', 'D')
- `source`: Bar price source (e.g. 'close')

**Output**

Returns a numeric series; use the function directly.

**Example expression**

```js
MAD()
```

</details>

<details id="indicator-mstd" data-indicator="MSTD">
<summary><code>MSTD</code> — Moving Standard Deviation (MSTD)</summary>

Rolling standard deviation of price, commonly used as a volatility measure.

**Signature**

```text signature
MSTD({period?: number = 20, interval: IntervalString, source?: PriceSource}) -> number[]
```

**Parameters**

| Parameter | Default | Aliases |
| --- | --- | --- |
| `period` | `20` | `length` |
| `interval` | `"D"` | — |
| `source` | `"close"` | — |

**Parameter notes**

- `period`: Period length
- `interval`: Bar interval (e.g. '1m', '1h', 'D')
- `source`: Bar price source (e.g. 'close')

**Output**

Returns a numeric series; use the function directly.

**Example expression**

```js
MSTD()
```

</details>

<details id="indicator-po" data-indicator="PO">
<summary><code>PO</code> — Projection Oscillator (PO)</summary>

Measures where the current price sits within the projection band range.

**Signature**

```text signature
PO({period?: number = 14, interval: IntervalString}) -> number[]
```

**Parameters**

| Parameter | Default | Aliases |
| --- | --- | --- |
| `period` | `14` | `length` |
| `interval` | `"D"` | — |

**Parameter notes**

- `period`: Lookback period
- `interval`: Bar interval (e.g. '1m', '1h', 'D')

**Output**

Returns a numeric series; use the function directly.

**Example expression**

```js
PO()
```

</details>

<details id="indicator-supertrend" data-indicator="SUPERTREND">
<summary><code>SUPERTREND</code> — SuperTrend</summary>

ATR-based trend-following stop and reverse indicator.

**Signature**

```text signature
SUPERTREND({atrPeriod?: number = 10, multiplier?: number = 3, interval: IntervalString}) -> {value: number, direction: number}[]
```

**Parameters**

| Parameter | Default | Aliases |
| --- | --- | --- |
| `atrPeriod` | `10` | — |
| `multiplier` | `3` | `factor` |
| `interval` | `"D"` | — |

**Parameter notes**

- `atrPeriod`: ATR lookback period
- `multiplier`: ATR multiplier
- `interval`: Bar interval (e.g. '1m', '1h', 'D')

**Outputs**

| Field | Meaning |
| --- | --- |
| `value` | SuperTrend stop level |
| `direction` | Trend direction (1 = up, -1 = down) |

**Example expression**

```js
SUPERTREND().value
```

</details>

<details id="indicator-tr" data-indicator="TR">
<summary><code>TR</code> — True Range (TR)</summary>

Maximum of (high-low), abs(high-prevClose), abs(low-prevClose) for each bar.

**Signature**

```text signature
TR({interval: IntervalString}) -> number[]
```

**Parameters**

| Parameter | Default | Aliases |
| --- | --- | --- |
| `interval` | `"D"` | — |

**Parameter notes**

- `interval`: Bar interval (e.g. '1m', '1h', 'D')

**Output**

Returns a numeric series; use the function directly.

**Example expression**

```js
TR()
```

</details>

<details id="indicator-ui" data-indicator="UI">
<summary><code>UI</code> — Ulcer Index (UI)</summary>

Measures downside volatility by tracking the depth and duration of drawdowns.

**Signature**

```text signature
UI({period?: number = 14, interval: IntervalString}) -> number[]
```

**Parameters**

| Parameter | Default | Aliases |
| --- | --- | --- |
| `period` | `14` | `length` |
| `interval` | `"D"` | — |

**Parameter notes**

- `period`: Lookback period
- `interval`: Bar interval (e.g. '1m', '1h', 'D')

**Output**

Returns a numeric series; use the function directly.

**Example expression**

```js
UI()
```

</details>

## Volume

<details id="indicator-ad" data-indicator="AD">
<summary><code>AD</code> — Accumulation/Distribution (A/D)</summary>

Cumulative indicator using volume and price to assess whether an asset is being accumulated or distributed.

**Signature**

```text signature
AD({interval: IntervalString}) -> number[]
```

**Parameters**

| Parameter | Default | Aliases |
| --- | --- | --- |
| `interval` | `"D"` | — |

**Parameter notes**

- `interval`: Bar interval (e.g. '1m', '1h', 'D')

**Output**

Returns a numeric series; use the function directly.

**Example expression**

```js
AD()
```

</details>

<details id="indicator-cmf" data-indicator="CMF">
<summary><code>CMF</code> — Chaikin Money Flow (CMF)</summary>

Volume-weighted average of accumulation/distribution over a period.

**Signature**

```text signature
CMF({period?: number = 21, interval: IntervalString}) -> number[]
```

**Parameters**

| Parameter | Default | Aliases |
| --- | --- | --- |
| `period` | `21` | — |
| `interval` | `"D"` | — |

**Parameter notes**

- `period`: Period length
- `interval`: Bar interval (e.g. '1m', '1h', 'D')

**Output**

Returns a numeric series; use the function directly.

**Example expression**

```js
CMF()
```

</details>

<details id="indicator-emv" data-indicator="EMV">
<summary><code>EMV</code> — Ease of Movement (EMV)</summary>

Relates price change to volume, showing how easily price moves.

**Signature**

```text signature
EMV({interval: IntervalString}) -> number[]
```

**Parameters**

| Parameter | Default | Aliases |
| --- | --- | --- |
| `period` | `14` | `length` |
| `volumeDivisor` | — | — |
| `interval` | `"D"` | — |

**Parameter notes**

- `period`: Lookback period
- `volumeDivisor`: Volume scaling divisor
- `interval`: Bar interval (e.g. '1m', '1h', 'D')

**Output**

Returns a numeric series; use the function directly.

**Example expression**

```js
EMV()
```

</details>

<details id="indicator-fi" data-indicator="FI">
<summary><code>FI</code> — Force Index (FI)</summary>

Combines price change and volume to measure the force behind price movements.

**Signature**

```text signature
FI({period?: number = 13, interval: IntervalString}) -> number[]
```

**Parameters**

| Parameter | Default | Aliases |
| --- | --- | --- |
| `period` | `13` | `length` |
| `interval` | `"D"` | — |

**Parameter notes**

- `period`: Period length
- `interval`: Bar interval (e.g. '1m', '1h', 'D')

**Output**

Returns a numeric series; use the function directly.

**Example expression**

```js
FI()
```

</details>

<details id="indicator-mfi" data-indicator="MFI">
<summary><code>MFI</code> — Money Flow Index (MFI)</summary>

Volume-weighted RSI measuring buying and selling pressure (0-100).

**Signature**

```text signature
MFI({period?: number = 14, interval: IntervalString}) -> number[]
```

**Parameters**

| Parameter | Default | Aliases |
| --- | --- | --- |
| `period` | `14` | `length` |
| `interval` | `"D"` | — |

**Parameter notes**

- `period`: Lookback period
- `interval`: Bar interval (e.g. '1m', '1h', 'D')

**Output**

Returns a numeric series; use the function directly.

**Example expression**

```js
MFI()
```

</details>

<details id="indicator-nvi" data-indicator="NVI">
<summary><code>NVI</code> — Negative Volume Index (NVI)</summary>

Cumulative index that changes only on days when volume decreases from the prior day.

**Signature**

```text signature
NVI({interval: IntervalString}) -> number[]
```

**Parameters**

| Parameter | Default | Aliases |
| --- | --- | --- |
| `interval` | `"D"` | — |

**Parameter notes**

- `interval`: Bar interval (e.g. '1m', '1h', 'D')

**Output**

Returns a numeric series; use the function directly.

**Example expression**

```js
NVI()
```

</details>

<details id="indicator-obv" data-indicator="OBV">
<summary><code>OBV</code> — On-Balance Volume (OBV)</summary>

Cumulative volume-based indicator that adds or subtracts volume based on price direction.

**Signature**

```text signature
OBV({interval: IntervalString}) -> number[]
```

**Parameters**

| Parameter | Default | Aliases |
| --- | --- | --- |
| `interval` | `"D"` | — |

**Parameter notes**

- `interval`: Bar interval (e.g. '1m', '1h', 'D')

**Output**

Returns a numeric series; use the function directly.

**Example expression**

```js
OBV()
```

</details>

<details id="indicator-pvi" data-indicator="PVI">
<summary><code>PVI</code> — Positive Volume Index (PVI)</summary>

Cumulative index that changes only on days when volume increases from the prior day.

**Signature**

```text signature
PVI({interval: IntervalString}) -> number[]
```

**Parameters**

| Parameter | Default | Aliases |
| --- | --- | --- |
| `interval` | `"D"` | — |

**Parameter notes**

- `interval`: Bar interval (e.g. '1m', '1h', 'D')

**Output**

Returns a numeric series; use the function directly.

**Example expression**

```js
PVI()
```

</details>

<details id="indicator-vol_anomaly" data-indicator="VOL_ANOMALY">
<summary><code>VOL_ANOMALY</code> — Volume Anomaly</summary>

Detects bars where volume significantly deviates from the recent average.

**Signature**

```text signature
VOL_ANOMALY({length?: number = 20, lookback?: number = 5, interval?: IntervalString = '5'}) -> number[]
```

**Parameters**

| Parameter | Default | Aliases |
| --- | --- | --- |
| `length` | `20` | `period` |
| `lookback` | `5` | — |
| `interval` | `"D"` | — |

**Parameter notes**

- `length`: Comparison length for anomaly detection
- `lookback`: Number of bars to analyze
- `interval`: Bar interval (e.g. '1m', '1h', 'D')

**Output**

Returns a numeric series; use the function directly.

**Example expression**

```js
VOL_ANOMALY()
```

</details>

<details id="indicator-vpt" data-indicator="VPT">
<summary><code>VPT</code> — Volume Price Trend (VPT)</summary>

Cumulative volume indicator weighted by the percentage change in price.

**Signature**

```text signature
VPT({interval: IntervalString}) -> number[]
```

**Parameters**

| Parameter | Default | Aliases |
| --- | --- | --- |
| `interval` | `"D"` | — |

**Parameter notes**

- `interval`: Bar interval (e.g. '1m', '1h', 'D')

**Output**

Returns a numeric series; use the function directly.

**Example expression**

```js
VPT()
```

</details>

<details id="indicator-vwap" data-indicator="VWAP">
<summary><code>VWAP</code> — Session Volume Weighted Average Price (VWAP)</summary>

Average price weighted by volume, commonly used as an intraday benchmark. An optional interval selects the source bars; omitted, VWAP uses the strategy interval.

**Signature**

```text signature
VWAP({lookback?: number = 1, interval?: IntervalString}) -> {upper: number, vwap: number, lower: number}[]
```

**Parameters**

| Parameter | Default | Aliases |
| --- | --- | --- |
| `lookback` | `1` | — |
| `interval` | — | — |

**Parameter notes**

- `lookback`: Number of sessions to look back for VWAP calculation
- `interval`: Optional source bar interval (e.g. '15m', '1h', 'D'); defaults to the strategy interval

**Outputs**

| Field | Meaning |
| --- | --- |
| `upper` | Upper VWAP band |
| `vwap` | Volume-weighted average price |
| `lower` | Lower VWAP band |

**Example expression**

```js
VWAP().upper
```

</details>

<details id="indicator-vwma" data-indicator="VWMA">
<summary><code>VWMA</code> — Volume Weighted Moving Average (VWMA)</summary>

Moving average weighted by volume, giving more weight to periods with higher volume.

**Signature**

```text signature
VWMA({period?: number = 20, interval: IntervalString, source?: PriceSource}) -> number[]
```

**Parameters**

| Parameter | Default | Aliases |
| --- | --- | --- |
| `period` | `20` | `length` |
| `interval` | `"D"` | — |
| `source` | `"close"` | — |

**Parameter notes**

- `period`: Period length
- `interval`: Bar interval (e.g. '1m', '1h', 'D')
- `source`: Bar price source (e.g. 'close')

**Output**

Returns a numeric series; use the function directly.

**Example expression**

```js
VWMA()
```

</details>

## Volume Profile

<details id="indicator-svp" data-indicator="SVP">
<summary><code>SVP</code> — Session Volume Profile (SVP)</summary>

Distribution of volume at each calendar-aligned profile period, with point of control and value area.

**Signature**

```text signature
SVP({interval?: IntervalString = 'D', eth?: boolean = true, lookback?: number = 1, dataInterval?: IntervalString = '30', valueArea?: number = 0.68, ticksPerRow?: number = 8, tickSize?: number}) -> VolumeProfileOutput[]
```

**Parameters**

| Parameter | Default | Aliases |
| --- | --- | --- |
| `eth` | `true` | — |
| `interval` | `"D"` | — |
| `lookback` | `1` | — |
| `dataInterval` | `"30"` | — |
| `valueArea` | `0.68` | — |
| `ticksPerRow` | `8` | `ticks_per_row` |
| `tickSize` | — | `tick_size` |

**Parameter notes**

- `eth`: Include ETH input; false selects regular-session candles
- `interval`: Calendar-aligned profile period: 'D', 'W', 'M', or 'Y'
- `lookback`: Number of separate profile periods retained, including the developing period
- `dataInterval`: Bar interval used to build the profile within each period (e.g. '30')
- `valueArea`: Value area percentage
- `ticksPerRow`: Positive integer number of instrument ticks grouped into each fixed profile row
- `tickSize`: Positive minimum price increment; defaults to the instrument contract increment

**Outputs**

| Field | Meaning |
| --- | --- |
| `poc` | Point of control (price level with highest volume) |
| `vah` | Value area high |
| `val` | Value area low |
| `totalVolume` | Total volume in the profile |
| `hvn` | Highest-volume node in the profile |
| `lvn` | Lowest-volume node in the profile |
| `nearestHvnAbove` | Nearest high-volume node above price |
| `nearestHvnBelow` | Nearest high-volume node below price |
| `nearestLvnAbove` | Nearest low-volume node above price |
| `nearestLvnBelow` | Nearest low-volume node below price |
| `distributionCount` | Number of meaningful distributions |
| `balanceScore` | Balanced/D-shape score |
| `trendScore` | Trend/elongation score |
| `doubleDistributionScore` | Double-distribution score |
| `profileShape` | Numeric profile shape class: 0 unknown, 1 balanced/D, 2 P, 3 b, 4 double distribution, 5 trend |

**Example expression**

```js
SVP().poc
```

</details>

<details id="indicator-vp" data-indicator="VP">
<summary><code>VP</code> — Volume Profile (VP)</summary>

Rolling non-session volume profile over a fixed lookback window of bars.

**Signature**

```text signature
VP({lookback?: number = 20, interval?: IntervalString = '30', valueArea?: number = 0.68, ticksPerRow?: number = 8, tickSize?: number}) -> VolumeProfileOutput[]
```

**Parameters**

| Parameter | Default | Aliases |
| --- | --- | --- |
| `lookback` | `20` | — |
| `interval` | `"30"` | — |
| `valueArea` | `0.68` | — |
| `ticksPerRow` | `8` | `ticks_per_row` |
| `tickSize` | — | `tick_size` |

**Parameter notes**

- `lookback`: Number of trailing bars to include
- `interval`: Bar interval used to build the rolling profile
- `valueArea`: Value area percentage
- `ticksPerRow`: Positive integer number of instrument ticks grouped into each fixed profile row
- `tickSize`: Positive minimum price increment; defaults to the instrument contract increment

**Outputs**

| Field | Meaning |
| --- | --- |
| `poc` | Point of control (price level with highest volume) |
| `vah` | Value area high |
| `val` | Value area low |
| `totalVolume` | Total volume in the profile |
| `hvn` | Highest-volume node in the profile |
| `lvn` | Lowest-volume node in the profile |
| `nearestHvnAbove` | Nearest high-volume node above price |
| `nearestHvnBelow` | Nearest high-volume node below price |
| `nearestLvnAbove` | Nearest low-volume node above price |
| `nearestLvnBelow` | Nearest low-volume node below price |
| `distributionCount` | Number of meaningful distributions |
| `balanceScore` | Balanced/D-shape score |
| `trendScore` | Trend/elongation score |
| `doubleDistributionScore` | Double-distribution score |
| `profileShape` | Numeric profile shape class: 0 unknown, 1 balanced/D, 2 P, 3 b, 4 double distribution, 5 trend |

**Example expression**

```js
VP().poc
```

</details>

<details id="indicator-avp" data-indicator="AVP">
<summary><code>AVP</code> — Anchored Volume Profile (AVP)</summary>

Volume profile anchored by a typed barsAgo anchor.

**Signature**

```text signature
AVP({anchor: {type: 'barsAgo', value: number, interval?: IntervalString}, dataInterval?: IntervalString = '30', valueArea?: number = 0.68, ticksPerRow?: number = 8, tickSize?: number}) -> VolumeProfileOutput[]
```

**Parameters**

| Parameter | Default | Aliases |
| --- | --- | --- |
| `anchor` | — | — |
| `barsAgo` | — | — |
| `dataInterval` | `"30"` | — |
| `valueArea` | `0.68` | — |
| `ticksPerRow` | `8` | `ticks_per_row` |
| `tickSize` | — | `tick_size` |
| `interval` | `"D"` | — |

**Parameter notes**

- `anchor`: Typed anchor object; currently supports {type: 'barsAgo', value: number}
- `barsAgo`: Flat runtime bars-ago anchor value
- `dataInterval`: Bar interval used to build the profile
- `valueArea`: Value area percentage
- `ticksPerRow`: Positive integer number of instrument ticks grouped into each fixed profile row
- `tickSize`: Positive minimum price increment; defaults to the instrument contract increment
- `interval`: Bar interval (e.g. '1m', '1h', 'D')

**Outputs**

| Field | Meaning |
| --- | --- |
| `poc` | Point of control (price level with highest volume) |
| `vah` | Value area high |
| `val` | Value area low |
| `totalVolume` | Total volume in the profile |
| `hvn` | Highest-volume node in the profile |
| `lvn` | Lowest-volume node in the profile |
| `nearestHvnAbove` | Nearest high-volume node above price |
| `nearestHvnBelow` | Nearest high-volume node below price |
| `nearestLvnAbove` | Nearest low-volume node above price |
| `nearestLvnBelow` | Nearest low-volume node below price |
| `distributionCount` | Number of meaningful distributions |
| `balanceScore` | Balanced/D-shape score |
| `trendScore` | Trend/elongation score |
| `doubleDistributionScore` | Double-distribution score |
| `profileShape` | Numeric profile shape class: 0 unknown, 1 balanced/D, 2 P, 3 b, 4 double distribution, 5 trend |

**Example expression**

```js
AVP().poc
```

</details>
