Overview
This node calculates various momentum indicators from financial OHLCV (Open, High, Low, Close, Volume) data using the indicatorts and technicalindicators libraries. Momentum indicators are technical analysis tools that help traders assess the strength, speed, and potential reversal points of price movements in markets.
Common scenarios where this node is beneficial include:
- Automated trading strategies that require momentum signals to trigger buy or sell orders.
- Market analysis workflows to identify overbought or oversold conditions.
- Portfolio management systems that incorporate technical indicators for risk assessment.
- Backtesting trading algorithms with historical OHLCV data.
Practical examples:
- Calculating the Relative Strength Index (RSI) to detect when an asset is overbought or oversold.
- Using the Awesome Oscillator (AO) to measure market momentum based on median prices.
- Applying the Ichimoku Cloud indicator to define support/resistance levels and trend direction.
Properties
| Name | Meaning |
|---|---|
| Indicators | Select one or more momentum indicators to calculate. Options include: - Awesome Oscillator (AO) - Chaikin Oscillator - Ichimoku Cloud - Percentage Price Oscillator (PPO) - Percentage Volume Oscillator (PVO) - Price Rate of Change (ROC) - Relative Strength Index (RSI) - Stochastic Oscillator - Stochastic RSI - TRIX - Williams %R |
| OHLCV Data | JSON string containing an array of OHLCV data points. Each data point is expected to be an array with at least 5 elements representing [timestamp, open, high, low, close, volume]. Default is taken from input JSON's ohlcv field. |
| AO Fast Period | Fast period parameter for Awesome Oscillator calculation (default: 5). |
| AO Slow Period | Slow period parameter for Awesome Oscillator calculation (default: 34). |
| PPO Fast Period | Fast EMA period for Percentage Price Oscillator (default: 12). |
| PPO Signal Period | Signal line period for Percentage Price Oscillator (default: 9). |
| PPO Slow Period | Slow EMA period for Percentage Price Oscillator (default: 26). |
| PVO Fast Period | Fast EMA period for Percentage Volume Oscillator (default: 12). |
| PVO Signal Period | Signal line period for Percentage Volume Oscillator (default: 9). |
| PVO Slow Period | Slow EMA period for Percentage Volume Oscillator (default: 26). |
| ROC Period | Period for Price Rate of Change calculation (default: 14). |
| RSI Period | Period for Relative Strength Index calculation (default: 14). |
| Stochastic D Period | D period for Stochastic Oscillator calculation (default: 3). |
| Stochastic K Period | K period for Stochastic Oscillator calculation (default: 14). |
| Stochastic RSI RSI Period | RSI period for Stochastic RSI calculation (default: 14). |
| Stochastic RSI Stochastic Period | Stochastic period for Stochastic RSI calculation (default: 14). |
| Stochastic RSI K Period | K period for Stochastic RSI calculation (default: 3). |
| Stochastic RSI D Period | D period for Stochastic RSI calculation (default: 3). |
| TRIX Period | Period for TRIX calculation (default: 15). |
| Williams %R Period | Period for Williams %R calculation (default: 14). |
| Ichimoku Short Period | Short period for Ichimoku Cloud calculation (default: 9). |
| Ichimoku Medium Period | Medium period for Ichimoku Cloud calculation (default: 26). |
| Ichimoku Long Period | Long period for Ichimoku Cloud calculation (default: 52). |
| Ichimoku Close Period | Close period for Ichimoku Cloud calculation (default: 3). |
| Options.Return Type | Determines output format: - Values Only: returns only calculated values - With Metadata: returns values plus metadata including input length, number of indicators, and timestamp |
Output
The node outputs a JSON object with the following structure:
{
"indicators": [
{
"indicator": "relativeStrengthIndex",
"parameters": { "period": 14 },
"result": [ /* array of calculated RSI values */ ]
},
{
"indicator": "awesomeOscillator",
"parameters": { "fast": 5, "slow": 34 },
"result": [ /* array of AO values */ ]
}
// ... other selected indicators
],
"metadata": {
"inputLength": 100, // Number of OHLCV data points processed
"indicatorsCount": 2, // Number of indicators calculated
"calculationTimestamp": "2024-06-01T12:00:00.000Z" // ISO timestamp of calculation
}
}
- The
indicatorsarray contains objects for each requested indicator, specifying:indicator: the name of the indicator.parameters: the parameters used for calculation.result: an array of calculated values corresponding to the input data points.
- If the "Return Type" option is set to "Values Only", the
metadatafield is omitted. - The node does not output binary data.
Dependencies
- Requires the
indicatortslibrary for most momentum indicator calculations. - Uses the
technicalindicatorslibrary specifically for the Stochastic RSI indicator. - Input data must be provided as a JSON string representing OHLCV arrays.
- No external API keys or credentials are required.
- No special environment variables or n8n configurations needed beyond standard node setup.
Troubleshooting
- Failed to parse OHLCV data: This error occurs if the input OHLCV data string is not valid JSON or is malformed. Ensure the input is a correctly formatted JSON string representing an array of OHLCV arrays.
- OHLCV data must be a non-empty array: The node expects at least one OHLCV data point. Verify that the input data array is not empty.
- Unsupported indicator: If an invalid or unsupported indicator name is selected, the node will throw an error. Confirm that only supported indicators from the list are chosen.
- Empty results or unexpected output: Check that the OHLCV data includes all necessary fields (open, high, low, close, volume) and that periods for indicators are set appropriately relative to the data length.
- To handle errors gracefully, enable the node's "Continue On Fail" option to allow processing of subsequent items even if one fails.