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 such as On Balance Volume, Chaikin Money Flow, Money Flow Index, and others. The node is useful for traders and analysts who want to enrich their datasets with volume-related insights to better understand market trends, buying/selling pressure, and price movements.

Typical use cases include:

  • Enhancing trading strategies by adding volume indicators to price data.
  • Performing technical analysis to identify potential buy or sell signals.
  • Visualizing volume trends alongside price charts in dashboards.

For example, a user can input historical OHLCV data of a stock and calculate the On Balance Volume and Chaikin Money Flow indicators to analyze the strength behind price movements.

Properties

Name Meaning
Indicators Select one or more volume indicators to calculate. Options: 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). Default is On Balance Volume.
OHLCV Data JSON string representing an array of OHLCV data points. Each element should be an array containing timestamp, open, high, low, close, and volume values. Default expression uses $json.ohlcv.
CMF Period Number specifying the period length for Chaikin Money Flow calculation. Shown only if CMF indicator is selected. Default: 20.
EMV Period Number specifying the period length for Ease of Movement calculation. Shown only if EMV indicator is selected. Default: 14.
Force Index Period Number specifying the period length for Force Index calculation. Shown only if FI indicator is selected. Default: 13.
MFI Period Number specifying the period length for Money Flow Index calculation. Shown only if MFI indicator is selected. Default: 14.
NVI Period Number specifying the period length for Negative Volume Index calculation. Shown only if NVI indicator is selected. Default: 1.
NVI Start Value Starting value for Negative Volume Index calculation. Shown only if NVI indicator is selected. Default: 1000.
VWAP Period Number specifying the period length for Volume Weighted Average Price calculation. Shown only if VWAP indicator is selected. Default: 14.
Volume Profile Number of Bars Number of price bars used for Volume Profile calculation. Shown only if VP indicator is selected. Default: 10.
Options > Return Type Choose output format: "Values Only" returns just the calculated indicator values; "With Metadata" includes additional metadata like input length, number of indicators, and calculation timestamp. Default: Values Only.

Output

The node outputs an array of JSON objects, each corresponding to an input item. Each JSON object contains keys named after the selected indicators. Each indicator key holds an object with:

  • parameters: The parameters used for that indicator's calculation (e.g., period).
  • result: The array of calculated indicator values or data structures.

If the "With Metadata" return type is selected, 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 (formatted for clarity):

{
  "onBalanceVolume": {
    "parameters": {},
    "result": [ ...array of OBV values... ]
  },
  "chaikinMoneyFlow": {
    "parameters": { "period": 20 },
    "result": [ ...array of CMF values... ]
  },
  "metadata": {
    "inputLength": 100,
    "indicatorsCount": 2,
    "calculationTimestamp": "2024-06-01T12:00:00.000Z"
  }
}

Dependencies

  • Requires valid OHLCV data input as a JSON string.
  • Uses two external JavaScript libraries for calculations:
    • A library providing volume indicator functions (referred to as indicatorts).
    • A technical indicators library for Volume Profile calculation.
  • No external API keys or services are required.
  • No special environment variables or n8n credentials needed.

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 OHLCV structure.
  • OHLCV data must be a non-empty array: The node expects at least one OHLCV data point. Verify that the input data is not empty.
  • Unsupported indicator: If an unrecognized indicator name is provided, the node will throw an error. Confirm that only supported indicators from the list are selected.
  • 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 the "Continue On Fail" option in the node settings.

Links and References

Discussion