Overview
This node detects support and resistance levels in financial market data using multiple technical analysis methods. It processes OHLCV (Open, High, Low, Close, Volume) data to identify key price levels that traders often use to make decisions.
Common scenarios where this node is beneficial include:
- Identifying pivot points to understand potential reversal or breakout levels.
- Detecting swing highs and lows to find dynamic support and resistance zones.
- Calculating Fibonacci retracement and extension levels for predicting price corrections and extensions.
Practical examples:
- A trader wants to automatically mark pivot points and swing highs/lows on their chart to plan entry and exit points.
- An analyst uses Fibonacci retracement levels to estimate potential pullback areas after a strong price move.
- A trading bot integrates this node to dynamically adjust stop-loss and take-profit levels based on detected support/resistance.
Properties
| Name | Meaning |
|---|---|
| Detection Methods | Select one or more methods to detect support/resistance: Pivot Points, Swing Highs and Lows, Fibonacci Retracement |
| OHLCV Data | JSON string containing an array of OHLCV data points. Each item should be an array with at least Open, High, Low, Close values. |
| Swing Period | Number specifying the period used to detect swing highs and lows (only shown if Swing Highs and Lows method is selected). |
| Fibonacci Start Price | Starting price for Fibonacci retracement calculation; 0 means use the lowest low from the data (only shown if Fibonacci Retracement method is selected). |
| Fibonacci End Price | Ending price for Fibonacci retracement calculation; 0 means use the highest high from the data (only shown if Fibonacci Retracement method is selected). |
| Options | Collection of additional options: • Return Type: "Values Only" or "With Metadata" • Include Current Levels: whether to include current support/resistance levels in output |
Output
The node outputs a JSON object containing the detection results grouped by the selected methods:
- pivotPoints: An array of objects for each data point with calculated pivot point levels (PP, R1-R3, S1-S3), plus the current/latest pivot point.
- swingHighsLows: Lists of detected swing highs (resistance) and swing lows (support) with their indices and prices, all combined levels sorted by index, the swing period used, and current/latest swing high/low levels.
- fibonacciRetracement: Contains start and end prices used, arrays of retracement and extension levels with their percentage labels and prices, and current price info including nearest retracement level and key support/resistance levels.
If the "Return Type" option is set to "With Metadata", additional metadata is included:
- Input data length
- Number of detection methods used
- Timestamp of calculation
Example output structure (simplified):
{
"detectionMethods": ["pivotPoints", "swingHighsLows"],
"results": {
"pivotPoints": {
"levels": [
{"index": 0, "pp": 100.1234, "r1": 101.2345, "s1": 99.0123, ...},
...
],
"current": {...}
},
"swingHighsLows": {
"swingHighs": [{"index": 10, "price": 105.5, "type": "resistance"}, ...],
"swingLows": [{"index": 15, "price": 95.2, "type": "support"}, ...],
"allLevels": [...],
"period": 5,
"current": {
"latestSwingHigh": {...},
"latestSwingLow": {...},
"nearestResistance": 105.5,
"nearestSupport": 95.2
}
}
},
"metadata": {
"inputLength": 100,
"methodsCount": 2,
"calculationTimestamp": "2024-06-01T12:00:00.000Z"
}
}
Dependencies
- Requires input OHLCV data as a JSON string representing an array of arrays with price data.
- Uses the
technicalindicatorslibrary internally for calculations like highest/lowest values and Fibonacci retracement. - No external API keys or credentials are required.
- Runs fully within n8n environment without external service calls.
Troubleshooting
- Failed to parse OHLCV data: The node expects a valid JSON string representing an array of OHLCV data. Ensure the input is correctly formatted JSON and contains non-empty array data.
- OHLCV data must be a non-empty array: Make sure the input data is not empty and is an array.
- If no detection methods are selected, the node will produce no results.
- For swing highs/lows detection, ensure the swing period is appropriate relative to the data length; too large a period may yield no swings.
- When using Fibonacci retracement, if start or end prices are set to zero, the node automatically uses the lowest low or highest high respectively. Providing explicit values overrides this behavior.