Volatility Indicators icon

Volatility Indicators

Calculate volatility indicators using the indicatorts library

Overview

This node calculates various volatility indicators based on OHLCV (Open, High, Low, Close, Volume) data using the indicatorts and technicalindicators libraries. It supports multiple well-known volatility metrics such as Average True Range, Bollinger Bands, Chandelier Exit, and others. This node is useful for traders, analysts, or automated trading systems that need to assess market volatility and price channel behavior to make informed decisions.

Typical use cases include:

  • Measuring market volatility to adjust risk management strategies.
  • Identifying price channels and potential breakout points.
  • Generating trailing stop levels based on volatility.
  • Analyzing downside risk and price dispersion.

For example, a user can input historical OHLCV data from a stock or cryptocurrency and calculate the Average True Range to understand recent volatility or generate Bollinger Bands to identify overbought or oversold conditions.

Properties

Name Meaning
Indicators Select one or more volatility indicators to calculate. Options include: Acceleration Bands (AB), Average True Range (ATR), Bollinger Bands (BB), Bollinger Bands Width (BBW), Chandelier Exit (CE), Donchian Channel (DC), Keltner Channel (KC), Moving Standard Deviation (MSTD), Projection Oscillator (PO), Standard Deviation (SD), True Range (TR), Ulcer Index (UI). Default is Average True Range.
OHLCV Data JSON string containing an array of OHLCV data points. Each data point is expected to be an array where index 1 = high, 2 = low, 3 = close prices. Default expression uses $json.ohlcv.
Acceleration Bands Period Number specifying the period length for Acceleration Bands calculation (default 20). Shown only if AB indicator selected.
Acceleration Bands Multiplier Multiplier used in Acceleration Bands calculation (default 4). Shown only if AB indicator selected.
ATR Period Number specifying the period length for Average True Range calculation (default 14). Shown only if ATR indicator selected.
Bollinger Bands Period Number specifying the period length for Bollinger Bands and Bollinger Bands Width calculations (default 20). Shown only if BB or BBW indicators selected.
Chandelier Exit Period Number specifying the period length for Chandelier Exit calculation (default 22). Shown only if CE indicator selected.
Donchian Channel Period Number specifying the period length for Donchian Channel calculation (default 20). Shown only if DC indicator selected.
Keltner Channel Period Number specifying the period length for Keltner Channel calculation (default 20). Shown only if KC indicator selected.
Moving Standard Deviation Period Number specifying the period length for Moving Standard Deviation calculation (default 20). Shown only if MSTD indicator selected.
Projection Oscillator Period Number specifying the period length for Projection Oscillator calculation (default 14). Shown only if PO indicator selected.
Projection Oscillator Smooth Number specifying the smoothing period for Projection Oscillator calculation (default 3). Shown only if PO indicator selected.
Standard Deviation Period Number specifying the period length for Standard Deviation calculation (default 20). Shown only if SD indicator selected.
Ulcer Index Period Number specifying the period length for Ulcer Index calculation (default 14). Shown only if UI indicator selected.
Options > Return Type Choose between returning only calculated values ("Values Only") or values with additional metadata ("With Metadata"). Default is "Values Only".

Output

The output is a JSON object containing the results of each requested indicator keyed by the indicator name. For each indicator, the output includes:

  • parameters: The parameters used for the calculation (e.g., period, multiplier).
  • result: The array of calculated values for the indicator.

If the "With Metadata" return type option 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.

Example output structure:

{
  "accelerationBands": {
    "parameters": { "period": 20, "multiplier": 4 },
    "result": [ /* array of calculated values */ ]
  },
  "averageTrueRange": {
    "parameters": { "period": 14 },
    "result": [ /* array of calculated values */ ]
  },
  "metadata": {
    "inputLength": 100,
    "indicatorsCount": 2,
    "calculationTimestamp": "2024-06-01T12:00:00.000Z"
  }
}

The node does not output binary data.

Dependencies

  • Requires the indicatorts library for most volatility indicator calculations.
  • Uses the technicalindicators library specifically for Standard Deviation calculation.
  • Input data must be provided as a JSON string representing an array of OHLCV data points.
  • No external API keys or services are required.
  • Properly formatted OHLCV data is essential for correct operation.

Troubleshooting

  • Failed to parse OHLCV data: This error occurs if the input OHLCV JSON string is invalid or cannot be parsed. Ensure the input is a valid JSON string representing an array.
  • OHLCV data must be a non-empty array: The node expects at least one OHLCV data point. Verify that the input array is not empty.
  • Unsupported indicator: If an indicator is selected that is not implemented, this error will be thrown. Confirm that only supported indicators are chosen.
  • Empty or malformed OHLCV arrays: The node extracts high, low, and close prices from specific indices in each OHLCV entry. Make sure each entry is an array with at least 4 elements where index 1 = high, 2 = low, 3 = close.
  • If the node fails but "Continue On Fail" is enabled, it will output an error message in the JSON instead of stopping execution.

Links and References

Discussion