Technical indicators#
Market indicators: trend, momentum, bands, volume, and returns.
Trend#
Direction and trend-following: trend-tracking averages, slope fits, ADX, and channels.
Function |
Description |
|---|---|
Wilder's ADX with +DI and -DI (3 inputs -> 3 outputs). |
|
Wilder's ADXR, the mean of ADX now and ADX one window ago. |
|
Online Bayesian linear regression with a forgetting factor: the current slope and intercept, and a one-step-ahead predictive mean and standard deviation. |
|
Mulloy's Double EMA: 2*EMA - EMA(EMA). |
|
x[t] minus its rolling mean. |
|
Trend-following envelope: rolling max(high), rolling min(low), and midline. |
|
Wilder directional index, the pre-average input to ADX. |
|
Running OLS slope of the series against time over the whole history. |
|
Hull's responsive MA: WMA(2*WMA(n/2) - WMA(n), sqrt(n)). |
|
Adaptive MA whose smoothing constant responds to the efficiency ratio. |
|
MACD line, signal line, and histogram (3 outputs). |
|
Wilder negative directional indicator. |
|
Wilder smoothed negative directional movement. |
|
Wilder positive directional indicator. |
|
Wilder smoothed positive directional movement. |
|
Rolling-window Hurst exponent via Anis-Lloyd corrected rescaled-range analysis. |
|
Rolling OLS fit of y on x, returning slope, intercept, R-squared and the standard error of the fit. |
|
OLS fit y = a + b*t over a trailing window. derivative_order selects value/slope/zero. |
|
OLS fit y = a + b*t + c*t^2 over a trailing window. |
|
Linear regression of the input on time, projected one step ahead (TA-Lib TSF). |
|
Mulloy's Triple EMA: 3*EMA - 3*EMA(EMA) + EMA(EMA(EMA)). |
|
ROC of a triple-smoothed EMA. |
Momentum & oscillators#
Rate-of-change and overbought/oversold indicators.
Function |
Description |
|---|---|
Difference of fast and slow EMA of the Accumulation/Distribution line. |
|
Wilder's ADX with +DI and -DI (3 inputs -> 3 outputs). |
|
(close - open) / (high - low) per bar. No smoothing. |
|
Commodity Channel Index over typical price. |
|
MACD line, signal line, and histogram (3 outputs). |
|
Volume-weighted analogue of RSI on the typical price. |
|
x[t] - x[t-k], TA-Lib's MOM. Mathematically identical to Diff(k). |
|
Rate of change 100 * (x[t] / x[t-k] - 1), in percent (TA-Lib ROC). |
|
Relative Strength Index. Wilder's smoothing by default; Cutler's via method='cutler'. |
|
Stochastic oscillator %K and %D from high, low and close. |
|
Stochastic oscillator applied to the RSI, giving %K and %D. |
|
ROC of a triple-smoothed EMA. |
|
Three-period weighted oscillator (Williams, 1976). |
|
Inverse stochastic oscillator in [-100, 0]. |
Bands & channels#
Envelopes around price.
Function |
Description |
|---|---|
Mean +/- num_std rolling standard deviations. |
|
Trend-following envelope: rolling max(high), rolling min(low), and midline. |
|
Volatility-adapted envelope: EMA midline plus/minus a multiple of ATR. |
Volatility indicators#
True range, ATR, and normalized ATR for stops, sizing, and channels.
Function |
Description |
|---|---|
Wilder-smoothed average of TrueRange. |
|
ATR scaled to a percentage of the current close. |
|
Per-bar true range accounting for overnight gaps (Wilder, 1978). |
Volume#
Volume-based indicators.
Function |
Description |
|---|---|
Chaikin Accumulation/Distribution Line. |
|
Difference of fast and slow EMA of the Accumulation/Distribution line. |
|
Volume-weighted analogue of RSI on the typical price. |
|
On-Balance Volume: signed cumulative volume by close-direction (Granville, 1963). |
|
Rolling volume-weighted average price (typical-price weighted). |
Returns & changes#
Differences, returns, rates of change, and lags.
Function |
Description |
|---|---|
x[t] - x[t-k] (first difference at lag k). |
|
Second-order finite difference (discrete second derivative). |
|
Output is the input delayed by k samples. |
|
Log return log(x[t] / x[t-k]) at lag k. |
|
x[t] - x[t-k], TA-Lib's MOM. Mathematically identical to Diff(k). |
|
Simple return (x[t] - x[t-k]) / x[t-k] at lag k. |
|
Rate of change 100 * (x[t] / x[t-k] - 1), in percent (TA-Lib ROC). |
|
Rate of change x[t] / x[t-k] - 1, as a fraction (TA-Lib ROCP). Identical to Return. |
|
Rate of change ratio x[t] / x[t-k] (TA-Lib ROCR). |
Cycles & spectra#
Dominant cycle, phase, amplitude, and frequency from the analytic signal.
Function |
Description |
|---|---|
Instantaneous amplitude (envelope) of the dominant cycle, scaled to the input amplitude. |
|
Instantaneous frequency, in cycles per sample, via Ehlers' homodyne discriminator. |
|
Instantaneous phase, in degrees, of Ehlers' in-phase and quadrature components. |
|
Ehlers' sinewave indicator (sine, leadsine) from the phase of the dominant cycle. |
|
Dominant cycle period via Ehlers' homodyne discriminator. |
|
Ehlers' in-phase and quadrature components (TA-Lib HT_PHASOR), scaled to the input amplitude. |
|
Ehlers' trend mode, 1.0 while the series trends and 0.0 while it cycles. |