Trend Indicators icon

Trend Indicators

Calculate trend indicators using the indicatorts library

Overview

This node calculates various trend indicators based on OHLCV (Open, High, Low, Close, Volume) financial data. It supports a wide range of technical analysis indicators commonly used in trading and market analysis to identify trends, momentum, volatility, and potential reversals.

Typical use cases include:

  • Enhancing trading strategies by adding calculated indicators like Moving Averages, MACD, ADX, etc.
  • Analyzing historical price data to detect trend strength or changes.
  • Generating signals for automated trading bots or alerts.
  • Visualizing indicator values alongside price charts.

For example, a user can input OHLCV data from a cryptocurrency exchange and calculate the Simple Moving Average (SMA) and Moving Average Convergence Divergence (MACD) to help decide entry or exit points.

Properties

Name Meaning
Indicators Select one or more trend indicators to calculate. Options include: Absolute Price Oscillator, Aroon, Average Directional Index, Balance of Power, Chande Forecast Oscillator, Community Channel Index, DEMA, EMA, Mass Index, MACD, Moving Max, Moving Min, Moving Sum, Parabolic SAR, Qstick, Random Index (KDJ), Rolling Moving Average, SMA, Since, TRIMA, TRIX, TEMA, Typical Price, VWMA, Vortex. Default is Simple Moving Average.
OHLCV Data JSON string containing an array of OHLCV data points. Each data point should be an array with at least 5 elements representing Open, High, Low, Close, and Volume values.
APO Fast Period Fast EMA period for Absolute Price Oscillator calculation (default 12). Shown only if APO indicator selected.
APO Slow Period Slow EMA period for Absolute Price Oscillator calculation (default 26). Shown only if APO indicator selected.
ADX Period Period length for Average Directional Index calculation (default 14). Shown only if ADX indicator selected.
Aroon Period Period length for Aroon indicator calculation (default 14). Shown only if Aroon indicator selected.
CCI Period Period length for Community Channel Index calculation (default 20). Shown only if CCI indicator selected.
DEMA Period Period length for Double Exponential Moving Average calculation (default 20). Shown only if DEMA indicator selected.
EMA Period Period length for Exponential Moving Average calculation (default 20). Shown only if EMA indicator selected.
Mass Index EMA Period EMA period for Mass Index calculation (default 9). Shown only if Mass Index indicator selected.
Mass Index Period Period length for Mass Index calculation (default 25). Shown only if Mass Index indicator selected.
MACD Fast Period Fast period for MACD calculation (default 12). Shown only if MACD indicator selected.
MACD Slow Period Slow period for MACD calculation (default 26). Shown only if MACD indicator selected.
MACD Signal Period Signal period for MACD calculation (default 9). Shown only if MACD indicator selected.
Moving Max Period Period length for Moving Max calculation (default 20). Shown only if Moving Max indicator selected.
Moving Min Period Period length for Moving Min calculation (default 20). Shown only if Moving Min indicator selected.
Moving Sum Period Period length for Moving Sum calculation (default 20). Shown only if Moving Sum indicator selected.
PSAR Step Step value for Parabolic SAR calculation (default 0.02). Shown only if Parabolic SAR indicator selected.
PSAR Max Maximum value for Parabolic SAR calculation (default 0.2). Shown only if Parabolic SAR indicator selected.
Qstick Period Period length for Qstick calculation (default 10). Shown only if Qstick indicator selected.
KDJ R Period R period for Random Index (KDJ) calculation (default 9). Shown only if Random Index indicator selected.
KDJ K Period K period for Random Index (KDJ) calculation (default 3). Shown only if Random Index indicator selected.
KDJ D Period D period for Random Index (KDJ) calculation (default 3). Shown only if Random Index indicator selected.
RMA Period Period length for Rolling Moving Average calculation (default 14). Shown only if Rolling Moving Average indicator selected.
SMA Period Period length for Simple Moving Average calculation (default 20). Shown only if SMA indicator selected.
TRIMA Period Period length for Triangular Moving Average calculation (default 20). Shown only if TRIMA indicator selected.
TRIX Period Period length for Triple Exponential Average calculation (default 15). Shown only if TRIX indicator selected.
TEMA Period Period length for Triple Exponential Moving Average calculation (default 20). Shown only if TEMA indicator selected.
VWMA Period Period length for Volume Weighted Moving Average calculation (default 20). Shown only if VWMA indicator selected.
Vortex Period Period length for Vortex indicator calculation (default 14). Shown only if Vortex indicator selected.
Options > Return Type Choose output format: "Values Only" returns just the calculated indicator values; "With Metadata" includes additional metadata such as input length, number of indicators calculated, and timestamp. Default is "Values Only".

Output

The node outputs a JSON object per input item with the following structure:

  • Each selected indicator is a key with an object value containing:
    • parameters: The parameters used for that indicator's calculation (e.g., periods).
    • result: The array of calculated indicator values or objects depending on the indicator.

If the "Return Type" option is set to "With Metadata", an additional metadata field is included with:

  • inputLength: Number of OHLCV data points processed.
  • indicatorsCount: Number of indicators calculated.
  • calculationTimestamp: ISO timestamp when the calculation was performed.

No binary data output is produced by this node.

Example output snippet (simplified):

{
  "simpleMovingAverage": {
    "parameters": { "period": 20 },
    "result": [ ...array of SMA values... ]
  },
  "movingAverageConvergenceDivergence": {
    "parameters": { "fast": 12, "slow": 26, "signal": 9 },
    "result": [ ...array of MACD objects... ]
  },
  "metadata": {
    "inputLength": 100,
    "indicatorsCount": 2,
    "calculationTimestamp": "2024-06-01T12:00:00.000Z"
  }
}

Dependencies

  • This node depends on two external JavaScript libraries for indicator calculations:

    • indicatorts library: Provides many of the trend indicator functions.
    • technicalindicators library: Used specifically for the Average Directional Index (ADX).
  • No external API keys or services are required.

  • Input OHLCV data must be provided as a JSON string in the expected format.

Troubleshooting

  • Failed to parse OHLCV data: If the input OHLCV JSON string is invalid or not an array, the node will throw an error. Ensure the input is a valid JSON string representing a non-empty array of arrays with OHLCV values.
  • Unsupported indicator: If an indicator name outside the supported list is specified, the node will throw an error. Verify the indicator names match the available options.
  • Empty or missing OHLCV data: The node requires non-empty OHLCV data to compute indicators. Providing empty data will cause errors.
  • Incorrect parameter values: Using invalid periods or parameters (e.g., negative numbers) may lead to unexpected results or errors. Use sensible positive integers or floats as indicated.
  • Continue On Fail: If enabled, the node will continue processing other items even if one fails, returning error messages in the output JSON.

Links and References

Discussion