Support Resistance Detector
Detect support and resistance levels using pivot points and swing highs/lows
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 levels to anticipate price corrections or extensions.
Practical examples:
- A trader wants to automatically mark pivot points on a chart to plan entry and exit points.
- An analyst needs to detect recent swing highs and lows to set stop-loss or take-profit orders.
- A strategy developer uses Fibonacci retracement levels to define target prices after a trend move.
Properties
| Name | Meaning |
|---|---|
| Detection Methods | Choose 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 length for detecting swing highs and lows (only used if Swing Highs and Lows method is selected) |
| Fibonacci Start Price | Starting price for Fibonacci retracement calculation; 0 means use the lowest low from data (only used if Fibonacci Retracement method is selected) |
| Fibonacci End Price | Ending price for Fibonacci retracement calculation; 0 means use the highest high from data (only used if Fibonacci Retracement method is selected) |
| Options > Return Type | Choose output format: "Values Only" returns just calculated levels; "With Metadata" includes additional info like parameters and timestamps |
| Options > Include Current Levels | Boolean to decide whether to include current/latest support/resistance levels in the output |
Output
The node outputs a JSON object containing results for each selected detection method:
- pivotPoints: An array of objects with calculated pivot point levels (PP, R1-R3, S1-S3) for each data index, plus the current/latest pivot point.
- swingHighsLows: Arrays of detected swing highs (resistance) and swing lows (support), all combined levels sorted by index, and current/latest swing high/low with nearest resistance/support prices.
- fibonacciRetracement: Fibonacci retracement and extension levels with their price values, start/end prices used, current price, nearest retracement level, and key support/resistance levels based on common Fibonacci percentages.
If the "Return Type" option is set to "With Metadata", the output also includes metadata such as input data length, number of methods used, and timestamp of calculation.
Example output structure (simplified):
{
"pivotPoints": {
"levels": [ /* array of pivot point objects per index */ ],
"current": { /* latest pivot point object */ }
},
"swingHighsLows": {
"swingHighs": [ /* array of swing high points */ ],
"swingLows": [ /* array of swing low points */ ],
"allLevels": [ /* combined and sorted levels */ ],
"period": 5,
"current": {
"latestSwingHigh": { /* last swing high */ },
"latestSwingLow": { /* last swing low */ },
"nearestResistance": 123.45,
"nearestSupport": 120.00
}
},
"fibonacciRetracement": {
"startPrice": 100,
"endPrice": 150,
"levels": [ /* all fib levels with price and type */ ],
"retracementLevels": [ /* only retracement levels */ ],
"extensionLevels": [ /* only extension levels */ ],
"current": {
"currentPrice": 140,
"nearestRetracementLevel": { /* closest retracement level to current price */ },
"keyLevels": {
"support23_6": 110,
"resistance38_2": 115,
"support50_0": 120,
"resistance61_8": 125
}
}
},
"metadata": {
"inputLength": 100,
"methodsCount": 2,
"calculationTimestamp": "2024-06-01T12:00:00.000Z"
}
}
The node does not output binary data.
Dependencies
- Requires valid OHLCV data input 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 services are required.
- No special environment variables or n8n credentials needed.
Troubleshooting
- Failed to parse OHLCV data: The input OHLCV JSON string is invalid or malformed. Ensure the input is a properly formatted JSON array.
- OHLCV data must be a non-empty array: The parsed OHLCV data is empty or not an array. Provide valid historical price data.
- If no detection methods are selected, the node will produce empty results.
- Incorrect swing period or Fibonacci start/end prices may lead to unexpected or empty results.
- Large datasets might increase processing time; consider limiting input size.