Calculates the Chaikin Oscillator (CO) for the full window.
Steps:
shortPeriod
AD values using short model.Slice of highs.
Slice of lows.
Slice of closes.
Slice of volumes.
Short AD period length.
Previous AD seed (0.0 if none).
Model for the short AD average.
Model for the long AD average.
[oscillatorValue, lastAD].
Calculates the Chande Momentum Oscillator (CMO) for the full window.
Uses sums of positive/negative price differences to produce a value in [-100, 100]. Special cases:
Slice of prices (length >= 1).
CMO value in [-100, 100].
Calculates the Commodity Channel Index (CCI) for the full window.
Formula:
Slice of prices (length >= 1).
Central model (SMA, EMA, median, etc.).
Deviation model (StdDev, MAD, etc.).
Scale factor (normally 0.015).
CCI value (unitless).
Calculates the MACD line for the full window.
Short-period average is computed over the last shortPeriod
values, while
the long-period average uses the entire series, each with the respective model.
Slice of prices (length >= 1).
Length of the short period (must be < prices.length).
Model for short average.
Model for long average (over full series).
MACD value (short - long).
Calculates the McGinley Dynamic CCI for the full window.
Uses the McGinley Dynamic of the last price as the center and scales by the chosen deviation model. Returns both the CCI and the computed McGinley value.
Slice of prices (length >= 1).
Previous McGinley value (use 0.0 if none).
Deviation model (StdDev, MAD, etc.).
Scale factor (normally 0.015).
[cci, mcginleyDynamic].
Calculates the McGinley Dynamic MACD for the full window.
Returns a tuple:
Slice of prices (length >= 1).
Short period length (must be < prices.length).
Previous short McGinley (0.0 if none).
Previous long McGinley (0.0 if none).
[macd, shortMcginley, longMcginley].
Calculates the Money Flow Index (MFI) for the full window.
Notes:
Slice of prices (length >= 1).
Slice of volumes (same length as prices).
MFI value in [0, 100].
Calculates the On-Balance Volume (OBV) update.
Adds/subtracts current volume if price up/down vs previous price, and accumulates with previous OBV.
Current price.
Previous price.
Current volume.
Previous OBV seed (use 0 if none).
Updated OBV value.
Calculates the Percentage Price Oscillator (PPO) for the full window (%).
Uses chosen central model for both short (applied to the trailing short slice) and long (applied to the full window), then scales the difference by long.
Slice of prices (length >= 1).
Length of the short period (must be <= prices.length).
Central model for both averages.
PPO percentage.
Calculates the Rate of Change (RoC) between two prices.
Current price.
Previous price.
Percentage change: ((current - previous)/previous) * 100.
Calculates the Relative Strength Index (RSI).
Computes average gains and losses from consecutive price differences and forms the RSI using the selected central model to smooth/aggregate:
Special cases:
Slice of prices (length >= 1).
Central model used to aggregate gains/losses.
RSI value in [0, 100].
Calculates the MACD signal line for the full window.
Applies the chosen central model to the provided MACD values.
Slice of MACD values (length >= 1).
Central model (SMA, EMA, median, etc.).
Signal value.
Calculates the Slowest Stochastic as a smoothing of Slow Stochastic values.
Uses the provided central model to aggregate the given slow stochastics.
Slice of Slow Stochastic values (length >= 1).
Central model (SMA, EMA, median, etc.).
Slowest stochastic value.
Calculates the Slow Stochastic as a smoothing of Stochastic Oscillator values.
Uses the provided central model to aggregate the given stochastics.
Slice of Stochastic Oscillator values (length >= 1).
Central model (SMA, EMA, median, etc.).
Smoothed stochastic value.
Single-value momentum indicators. These compute a single value from a full window (the entire array passed in).