Volume Indicators icon

Volume Indicators

Calculate volume indicators using the indicatorts library

Overview

This node calculates various volume-based technical indicators from financial OHLCV (Open, High, Low, Close, Volume) data. It supports multiple popular volume indicators used in trading and market analysis to assess buying/selling pressure, price trends, and volume distribution.

Common scenarios for this node include:

  • Enhancing trading strategies by adding volume indicators as features.
  • Analyzing market momentum and volume flow to confirm price movements.
  • Visualizing volume-related metrics alongside price charts.
  • Automating technical analysis workflows that require volume indicator calculations.

Practical example: Given a JSON array of OHLCV data from a stock or cryptocurrency, the node can compute On Balance Volume (OBV), Chaikin Money Flow (CMF), and Volume Weighted Average Price (VWAP) simultaneously, returning their values for further processing or decision-making.

Properties

Name Meaning
Indicators Select one or more volume indicators to calculate:
- Accumulation Distribution (AD)
- Chaikin Money Flow (CMF)
- Ease of Movement (EMV)
- Force Index (FI)
- Money Flow Index (MFI)
- Negative Volume Index (NVI)
- On Balance Volume (OBV)
- Volume Price Trend (VPT)
- Volume Profile (VP)
- Volume Weighted Average Price (VWAP)
OHLCV Data JSON string containing an array of OHLCV data points. Each element is expected to be an array with at least 5 elements representing [timestamp, high, low, close, volume].
CMF Period Number specifying the period length for Chaikin Money Flow calculation (shown only if CMF selected). Default: 20
EMV Period Number specifying the period length for Ease of Movement calculation (shown only if EMV selected). Default: 14
Force Index Period Number specifying the period length for Force Index calculation (shown only if FI selected). Default: 13
MFI Period Number specifying the period length for Money Flow Index calculation (shown only if MFI selected). Default: 14
NVI Period Number specifying the period length for Negative Volume Index calculation (shown only if NVI selected). Default: 1
NVI Start Value Starting value for Negative Volume Index calculation (shown only if NVI selected). Default: 1000
VWAP Period Number specifying the period length for Volume Weighted Average Price calculation (shown only if VWAP selected). Default: 14
Volume Profile Number of Bars Number of price bars to use for Volume Profile calculation (shown only if VP selected). Default: 10
Options Collection of additional options:
- Return Type: Choose between "Values Only" (just calculated values) or "With Metadata" (values plus metadata like input length, count of indicators, and timestamp). Default: Values Only

Output

The node outputs an array with one item per input. Each output item contains a json object structured as follows:

  • indicators: An array where each element corresponds to a requested indicator and includes:
    • indicator: The indicator's name (e.g., "onBalanceVolume").
    • parameters: The parameters used for calculation (e.g., period lengths).
    • result: The computed indicator values, typically an array of numbers.

If the "Return Type" option is set to "With Metadata", the output also includes a metadata object with:

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

The node does not output binary data.

Dependencies

  • Uses the external libraries indicatorts and technicalindicators for calculating volume indicators.
  • Requires valid OHLCV data input as a JSON string.
  • No external API keys or services are needed.
  • No special environment variables or n8n credentials required.

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 array of arrays with correct numeric values.
  • OHLCV data must be a non-empty array: The node expects at least one OHLCV data point. Provide a non-empty array.
  • Unsupported indicator: If an unrecognized indicator name is provided, the node will throw an error. Verify the selected indicators are among the supported list.
  • Empty or missing volume data: Some indicators rely on volume values; missing or zero volumes may lead to incorrect results or errors.
  • To handle errors gracefully, enable "Continue On Fail" in the node settings to allow processing of subsequent items even if one fails.

Links and References

Discussion