Functions

Oscillators

12 names in this group.
Each comes with its signature and an example.

ta.rsi

Relative strength index (0–100, default 14)

signature
rsi(src: Source, length?: number): Series
example
ta.rsi(close, 14)

ta.stoch

Stochastic %K and %D (default 14, 3, 3)

signature
stoch(length?: number, smoothK?: number, smoothD?: number): { k: Series; d: Series }
example
const s = ta.stoch(14, 3, 3)

ta.macd

MACD (default 12, 26, 9)

signature
macd(src: Source, fast?: number, slow?: number, signal?: number): { macd: Series; signal: Series; hist: Series }
example
const m = ta.macd(close, 12, 26, 9)

ta.cci

Commodity channel index (default 20)

signature
cci(src: Source, length?: number): Series

ta.mfi

Money flow index (0–100, from hlc3 and volume)

signature
mfi(length?: number): Series

ta.roc

Rate of change vs length bars ago (%)

signature
roc(src: Source, length: number): Series

ta.mom

Momentum: change vs length bars ago

signature
mom(src: Source, length?: number): Series

ta.wpr

Williams %R (−100 to 0, default 14)

signature
wpr(length?: number): Series
example
ta.wpr(14)

ta.cmo

Chande momentum oscillator (−100 to 100, default 9)

signature
cmo(src: Source, length?: number): Series

ta.tsi

True strength index, −1 to 1 as in Pine (× 100 for the usual display); default 13, 25

signature
tsi(src: Source, short?: number, long?: number): Series

ta.cog

Center of gravity (default 10)

signature
cog(src: Source, length?: number): Series

ta.rci

Rank correlation index (−100 to 100, default 9); 100 = each value higher than the one before

signature
rci(src: Source, length?: number): Series

npm · GitHub