Momentum Indicators icon

Momentum Indicators

Calculate momentum indicators using the indicatorts library

Overview

This node calculates various momentum indicators from financial OHLCV (Open, High, Low, Close, Volume) data using the indicatorts and technicalindicators libraries. Momentum indicators are technical analysis tools that help traders assess the strength, speed, and potential reversal points of price movements in markets.

Common scenarios for this node include:

  • Analyzing stock, forex, or cryptocurrency price data to identify trends and momentum shifts.
  • Generating trading signals based on overbought/oversold conditions.
  • Enhancing automated trading strategies by incorporating multiple momentum indicators.
  • Visualizing indicator values alongside price charts for better decision-making.

Practical examples:

  • Calculating the Relative Strength Index (RSI) to detect when an asset is overbought or oversold.
  • Using the Ichimoku Cloud to identify support/resistance zones and trend direction.
  • Applying the Awesome Oscillator to measure market momentum using median prices.
  • Combining Stochastic RSI to find precise entry/exit points in volatile markets.

Properties

Name Meaning
Indicators Select one or more momentum indicators to calculate. Options include: Awesome Oscillator (AO), Chaikin Oscillator, Ichimoku Cloud, PPO, PVO, ROC, RSI, Stochastic Oscillator, Stochastic RSI, TRIX, Williams %R. Default is Relative Strength Index.
OHLCV Data JSON string containing an array of OHLCV data points. Each data point should be an array with at least 5 elements representing [timestamp, open, high, low, close, volume]. The node extracts price and volume arrays from this input.
AO Fast Period Fast period parameter for Awesome Oscillator calculation (default: 5).
AO Slow Period Slow period parameter for Awesome Oscillator calculation (default: 34).
PPO Fast Period Fast EMA period for Percentage Price Oscillator (default: 12).
PPO Signal Period Signal EMA period for Percentage Price Oscillator (default: 9).
PPO Slow Period Slow EMA period for Percentage Price Oscillator (default: 26).
PVO Fast Period Fast EMA period for Percentage Volume Oscillator (default: 12).
PVO Signal Period Signal EMA period for Percentage Volume Oscillator (default: 9).
PVO Slow Period Slow EMA period for Percentage Volume Oscillator (default: 26).
ROC Period Period for Price Rate of Change calculation (default: 14).
RSI Period Period for Relative Strength Index calculation (default: 14).
Stochastic D Period D period for Stochastic Oscillator calculation (default: 3).
Stochastic K Period K period for Stochastic Oscillator calculation (default: 14).
Stochastic RSI RSI Period RSI period used inside Stochastic RSI calculation (default: 14).
Stochastic RSI Stochastic Period Stochastic period used inside Stochastic RSI calculation (default: 14).
Stochastic RSI K Period K period for Stochastic RSI calculation (default: 3).
Stochastic RSI D Period D period for Stochastic RSI calculation (default: 3).
TRIX Period Period for TRIX (Triple Exponential Average) calculation (default: 15).
Williams %R Period Period for Williams %R calculation (default: 14).
Ichimoku Short Period Short period for Ichimoku Cloud calculation (default: 9).
Ichimoku Medium Period Medium period for Ichimoku Cloud calculation (default: 26).
Ichimoku Long Period Long period for Ichimoku Cloud calculation (default: 52).
Ichimoku Close Period Close period for Ichimoku Cloud calculation (default: 3).
Options.Return Type Determines output format: "Values Only" returns just calculated values; "With Metadata" includes additional metadata such as input length, number of indicators, and timestamp. Default is "Values Only".

Output

The node outputs a JSON object per input item containing the results of the selected momentum indicators. The structure is:

{
  "indicatorName": {
    "parameters": { /* parameters used for calculation */ },
    "result": [ /* array of calculated indicator values or objects */ ]
  },
  "metadata": { /* optional, present if Return Type is 'With Metadata' */
    "inputLength": 123,
    "indicatorsCount": 2,
    "calculationTimestamp": "2024-06-xxTxx:xx:xx.xxxZ"
  }
}
  • Each indicator key contains the parameters used and the resulting array of values.
  • If "With Metadata" option is selected, additional metadata about the calculation is included.
  • The result arrays correspond to the indicator's computed values aligned with the input OHLCV data.
  • No binary data output is produced by this node.

Dependencies

  • Requires the indicatorts library for most momentum indicator calculations.
  • Uses the technicalindicators library specifically for the Stochastic RSI indicator.
  • Input data must be provided as a JSON string representing OHLCV arrays.
  • No external API keys or credentials are required.
  • No special environment variables or n8n configurations needed beyond standard node setup.

Troubleshooting

  • Failed to parse OHLCV data: This error occurs if the input OHLCV JSON string is invalid or malformed. Ensure the input is a valid JSON string representing an array of arrays with correct OHLCV format.
  • OHLCV data must be a non-empty array: The node expects at least one OHLCV data point. Provide sufficient historical data for meaningful indicator calculation.
  • Unsupported indicator: If an unrecognized indicator value is passed, the node will throw an error. Verify that only supported indicators from the list are selected.
  • Empty or missing fields in OHLCV data: Missing price or volume values can cause calculation errors. Confirm that each OHLCV entry has valid numeric values.
  • Continue On Fail behavior: If enabled, the node will output error messages in the JSON field instead of stopping execution, allowing workflows to handle errors gracefully.

Links and References

Discussion