Reference
Momentum
Guides and navigation are localized. Built-in reference descriptions and code examples are maintained in English.
| Name / Signature | Description | Returns |
|---|---|---|
| alerta.ta.macdmacd(source, fast, slow, signal) | Returns MACD line, Signal line and Histogram. | [macdLine, signalLine, histogram] |
| alerta.ta.rsirsi(source, length) | Calculates the RSI, an oscillator measuring the speed and change of price movements. | series float |
| alerta.ta.rocroc(source, length) | Calculates the Rate of Change (percent) over an N-bar period. | series float |
| alerta.ta.mommom(source, length) | Calculates the momentum (difference) over an N-bar period. | series float |
| alerta.ta.kstkst(source, roc1, roc2, roc3, roc4, sma1, sma2, sma3, sma4) | Weighted momentum oscillator built from four smoothed ROC components. | series float |
| alerta.ta.specialKta.specialK(source, length1, length2) | Martin J. Pring's Special K: twelve simple averages of rates of change, from a 10-bar to a 530-bar ROC, weighted 1-2-3-4 within the short, medium and long groups and summed, with a signal line that is a simple average of a simple average of it. Needs about 725 bars of history before its first value. | [specialK, signal] |
| alerta.ta.cmocmo(source, length) | Calculates the Chande Momentum Oscillator over an N-bar period. | series float |
| alerta.ta.stochrsistochrsi(source, length, rsiLength, k, d) | Calculates the Stochastic RSI oscillator. | [k, d] |
| alerta.ta.tsita.tsi(source, short_length, long_length) or tsi(source, longLength, shortLength) | Calculates the True Strength Index. Pine form `ta.tsi(source, short_length, long_length)`: EMA(EMA(change, long), short) / EMA(EMA(|change|, long), short), a ratio in [-1, 1]. The legacy bare form `tsi(source, longLength, shortLength)` (also `alerta.tsi`) takes the long length first and returns the same index times 100. | series float |
| alerta.ta.rvirvi(open, high, low, close, length) | Calculates the Relative Vigor Index and signal line. | [rviLine, signal] |
| alerta.ta.fisherfisher(source, length) | Applies the Fisher Transform to a source series. | series float |
| alerta.ta.cfocfo(source, length) | Calculates the Chande Forecast Oscillator. | series float |
| alerta.ta.stcstc(source, fastLength, slowLength, cycleLength) | Calculates the Schaff Trend Cycle oscillator. | series float |
| alerta.ta.vivi(high, low, close, length) | Calculates Vortex Indicator positive/negative lines. | [vip, vin] |
| alerta.ta.trixtrix(source, length) | Calculates the percent rate of change of a triple-smoothed EMA. | series float |
| alerta.ta.willrwilliamsr(high, low, close, length) | Measures overbought/oversold levels using the high/low range. | series float |
| alerta.ta.ultoscultosc(high, low, close, length1, length2, length3) | Calculates the Ultimate Oscillator using three timeframes. | series float |
| alerta.ta.stochstoch(close, high, low, length, k_smooth, d_smooth) | Calculates the Stochastic Oscillator. Pine's `ta.stoch(source, high, low, length)` returns ONE series — the raw %K, 100 × (source − lowest low) / (highest high − lowest low) — which scripts smooth themselves, e.g. `k = ta.sma(ta.stoch(close, high, low, 14), 3)`. AlertaScript's own `[k, d] = stoch(close, high, low, 14)` returns the smoothed pair (k_smooth / d_smooth, default 3). | [k, d] |
| alerta.ta.ccicci(source, length) | Calculates the CCI indicator. | series float |
| alerta.ta.kdjkdj(close, high, low, length, m1, m2) | Calculates the KDJ indicator. | [k, d, j] |
| alerta.ta.rcita.rci(source, length) → series float | Pine v6: Spearman rank correlation between `source` and the time index over `length` bars. Scaled to [-100, 100]. 100 = monotonically rising, -100 = monotonically falling. | series float |
| alerta.ta.wprta.wpr(length) → series float | Pine v6 official name for Williams %R. Oscillator showing current close relative to the high/low range over `length` bars. | series float |