Skip to main content

Support & Resistance Calculator

Type: support_resistance • Category: flow • Tags: technical analysis, trading, support, resistance, pivot points, fibonacci, retracement, camarilla, woodie, donchian, psychological levels

Description

Calculate support and resistance levels using technical analysis methods

Parameters

NameTypeDescriptionRequiredDefault
rowsExprstringExpr -> list[dict] (each dict contains OHLC data)no
openstringOpen price columnno
closestringClose price columnno
highstringHigh price columnno
lowstringLow price columnno
methodsstringMethods to use for S/R calculationno["ta_extrema","fibonacci_retracement"]
lookback_periodnumberLookback period for fibonacci retracement and swing analysisno20
ordernumberExtrema sensitivity: number of bars on each side (argrelextrema order)no5
atr_multnumberClustering tolerance multiplier relative to ATRno1
top_nnumberMaximum number of support/resistance levels to returnno5
lookback_barsnumberIf >0, use only the most recent N bars for extrema clusteringno0
strict_sidebooleanIf true, keep supports <= current price and resistances >= current pricenofalse
max_distance_atrnumberIf >0, filter levels to within N * ATR of current priceno0
nearest_onlybooleanIf true, reduce to the single nearest support and resistancenofalse
fib_ext_ratiosstringComma-separated Fibonacci extension ratios (used by fibonacci_extensions)no"1.272,1.618,2.0,2.618"
channel_lengthnumberLookback length for price channels (Donchian)no20
swing_top_nnumberHow many recent swing highs/lows to includeno5
psych_stepnumberStep for psychological levels; 0 = autono0
psych_countnumberNumber of steps per side for psychological levelsno5

Help

Calculate key support and resistance levels for technical analysis.

Available Methods:

  • pivot_points: Classic pivot point calculation with S1-S3 and R1-R3 levels
  • pivot_woodie: Woodie pivot points
  • pivot_camarilla: Camarilla pivot points (S1-S4/R1-R4)
  • fibonacci_retracement: Fibonacci retracement levels (0.236, 0.382, 0.5, 0.618, 0.786)
  • fibonacci_extensions: Fibonacci extension targets (1.272, 1.618, 2.0, 2.618)
  • recent_levels: Recent swing highs/lows as support/resistance
  • swing_points: Output last swing highs and lows directly
  • price_channels: Donchian price channels (upper/lower/mid)
  • psychological_levels: Round-number levels around price

Input Data Format: Provide data expression that returns list of records with OHLC columns. Use the column selectors below to map your data fields.

How to Use:

1. Data Source:

  • Set rowsExpr to an expression that returns list of records (e.g., from previous workflow steps)
  • Example: data.fred_data or vars.my_ohlc_data

2. Column Mapping:

  • Select which columns contain Open, High, Low, Close data
  • The dropdowns will show available columns from your data

3. Analysis Methods:

  • Choose calculation methods (pivot points, fibonacci, recent levels)
  • Each method provides different types of support/resistance levels

4. Classic Pivot Points:

  • Uses last candle OHLC for calculation
  • Provides S1-S3 support and R1-R3 resistance levels

5. Fibonacci Retracement:

  • Calculates levels based on recent high-low range (using lookback_period)
  • Levels: 23.6%, 38.2%, 50%, 61.8%, 78.6% from recent high
  • Powerful tool for identifying potential reversal zones

3. Recent Swing Levels:

  • Finds local highs/lows in recent data
  • Based on swing analysis (local maxima/minima)
  • Shows where price has reversed recently

Parameters:

  • rowsExpr: Expression returning list of records with OHLC data
  • open/high/low/close: Column selectors for OHLC data (auto-populated from rowsExpr)
  • methods: Calculation methods (default: ["ta_extrema", "fibonacci_retracement"])
  • lookback_period: Lookback period for fibonacci retracement and swing analysis (default: 20)
  • fib_ext_ratios: Comma-separated extension ratios for Fibonacci extensions (default: 1.272,1.618,2.0,2.618)
  • channel_length: Period for price channels/Donchian (default: 20)
  • swing_top_n: How many recent swing highs/lows to include (default: 5)
  • psych_step: Step for psychological levels; 0 or empty = auto (default: auto)
  • psych_count: Number of steps per side around price for psychological levels (default: 5)

Output:

  • support_levels: Dict of support levels with level names as keys and values as level prices
  • resistance_levels: Dict of resistance levels with level names as keys and values as level prices
  • nearest_support/resistance: Closest level values to current price
  • price_position: Relative position between nearest S/R (0-1 scale)
  • current_price: Last close price for reference

Tips:

  • Combine multiple methods for stronger signals
  • Use longer timeframes for more reliable levels
  • Pivot points work best on daily/weekly charts
  • Moving averages work on all timeframes
  • Recent levels are timeframe-specific

Trading Applications:

  • Entry/exit signals at S/R levels
  • Stop loss placement below support/above resistance
  • Target setting at next S/R level
  • Trend identification using MA slopes