Volatility Strategy icon

Volatility Strategy

Execute volatility trading strategies using the indicatorts library

Overview

This node executes volatility-based trading strategies on financial OHLCV (Open, High, Low, Close, Volume) data using the indicatorts library. It supports three popular strategies: Acceleration Bands, Bollinger Bands, and Projection Oscillator. The node analyzes historical price data to generate trading signals such as BUY, SELL, or HOLD.

Typical use cases include:

  • Automating technical analysis for trading bots.
  • Backtesting volatility strategies on historical market data.
  • Generating actionable trade signals for portfolio management.

For example, a trader can input daily OHLCV data of a stock and select the Bollinger Bands strategy to receive buy/sell signals based on price volatility patterns.

Properties

Name Meaning
Strategy Selects the volatility strategy to apply:
- Acceleration Bands Strategy
- Bollinger Bands Strategy
- Projection Oscillator Strategy
OHLCV Data JSON string representing an array of OHLCV data points. Each element is expected to be an array with at least 4 values (open, high, low, close) and optionally volume.
Date Data Optional JSON string representing an array of dates corresponding to the OHLCV data points. If omitted or invalid, the node uses index-based dates counting backward from the current date.
AB Period Number specifying the period length for the Acceleration Bands calculation. (Shown only if Acceleration Bands strategy is selected)
AB Multiplier Multiplier factor used in the Acceleration Bands calculation. (Shown only if Acceleration Bands strategy is selected)
BB Period Number specifying the period length for the Bollinger Bands calculation. (Shown only if Bollinger Bands strategy is selected)
PO Period Number specifying the period length for the Projection Oscillator calculation. (Shown only if Projection Oscillator strategy is selected)
PO Smooth Smoothing period applied in the Projection Oscillator calculation. (Shown only if Projection Oscillator strategy is selected)
Options.Return Type Determines output format:
- Actions Only: returns just the list of actions (BUY/SELL/HOLD)
- With Metadata: returns actions plus additional metadata and analysis
Options.Include Gains Calculation Boolean flag to calculate and include gains based on the generated actions. Only available when "With Metadata" return type is selected.

Output

The node outputs an array of JSON objects, each containing:

  • strategy: The chosen strategy identifier.
  • parameters: The parameters used for the strategy calculation (periods, multipliers, smoothing).
  • actions: An array of strings representing the trading signals for each data point: "BUY", "SELL", or "HOLD".
  • actionValues: The raw action codes from the underlying library mapped to the above strings.
  • If "With Metadata" return type is selected:
    • metadata: Object including counts and percentages of each action type, total number of actions, input data length, and timestamp of calculation.
    • If gains calculation is enabled:
      • gains: Array of cumulative gain values calculated from the actions.
      • totalGain: Final gain value after applying all actions.
    • If gains calculation fails, gainsError contains the error message.

No binary data output is produced by this node.

Dependencies

  • Requires the indicatorts library for technical indicator calculations.
  • No external API keys or services are needed.
  • Input data must be provided as JSON strings representing arrays of OHLCV data and optionally dates.

Troubleshooting

  • Failed to parse OHLCV data: Ensure the OHLCV input is a valid JSON string representing a non-empty array of arrays with numeric values.
  • Unsupported strategy: Verify that the selected strategy is one of the supported options.
  • Date parsing warnings: If date data is invalid or missing, the node defaults to index-based dates counting backward from the current date.
  • Gains calculation errors: If enabled, gains calculation may fail due to inconsistent action sequences; check input data integrity.
  • Use "Continue On Fail" option to handle errors gracefully during batch processing.

Links and References

Discussion