compute.*

compute.*

The class form’s indicator helpers. Each takes current-first arrays such as bars.close and returns the value for the current bar only (a number, or an object of numbers).

compute.sma / ema / rma / wma / hma / dema / tema (series, { period })

Moving average at the current bar. series is a current-first array such as bars.close.

Returnsnumber

const ema = compute.ema(bars.close, { period: 20 });
compute.rsi(series, { period })

RSI at the current bar, 0 to 100.

Returnsnumber

compute.atr(high, low, close, { period })

Average True Range at the current bar.

Returnsnumber

compute.macd(series, { fast, slow, signal })

MACD values at the current bar.

Returns{ macd, signal, histogram }

compute.bbands(series, { period, mult })

Bollinger Bands at the current bar.

Returns{ upper, middle, lower }

compute.highest / lowest / sum (series, { period })

Rolling window values.

Returnsnumber

compute.crosses.over / under (a, b, aPrev, bPrev)

True when a crossed b between the previous bar and this one. Keep the previous values yourself.

Returnsboolean