Functions
Oscillators
12 names in this group.
Each comes with its signature and an example.
ta.rsi
Relative strength index (0–100, default 14)
rsi(src: Source, length?: number): Seriesta.rsi(close, 14)ta.stoch
Stochastic %K and %D (default 14, 3, 3)
stoch(length?: number, smoothK?: number, smoothD?: number): { k: Series; d: Series }const s = ta.stoch(14, 3, 3)ta.macd
MACD (default 12, 26, 9)
macd(src: Source, fast?: number, slow?: number, signal?: number): { macd: Series; signal: Series; hist: Series }const m = ta.macd(close, 12, 26, 9)ta.cci
Commodity channel index (default 20)
cci(src: Source, length?: number): Seriesta.mfi
Money flow index (0–100, from hlc3 and volume)
mfi(length?: number): Seriesta.roc
Rate of change vs length bars ago (%)
roc(src: Source, length: number): Seriesta.mom
Momentum: change vs length bars ago
mom(src: Source, length?: number): Seriesta.wpr
Williams %R (−100 to 0, default 14)
wpr(length?: number): Seriesta.wpr(14)ta.cmo
Chande momentum oscillator (−100 to 100, default 9)
cmo(src: Source, length?: number): Seriesta.tsi
True strength index, −1 to 1 as in Pine (× 100 for the usual display); default 13, 25
tsi(src: Source, short?: number, long?: number): Seriesta.cog
Center of gravity (default 10)
cog(src: Source, length?: number): Seriesta.rci
Rank correlation index (−100 to 100, default 9); 100 = each value higher than the one before
rci(src: Source, length?: number): Series