Skip to content
StatePath
Tool Atlasmarket.sr_levels

Tool

Support / Resistance Levels

market.sr_levels

MarketStructure

Inputs

pivotsEvent list

A stream of swing highs and lows (typically from a zigzag) whose repeated prices the tool clusters into support and resistance levels.

Outputs

Bundle (untagged)

A set of support and resistance levels, each with a price, a thin zone, a touch count, and a side (floor or ceiling). When breakout detection is on it also emits break and retest events as price closes through a level.

Support and resistance levels are the price floors and ceilings where the market has turned before. This tool finds those repeated turning prices from swing pivots, draws them as horizontal levels, and can also tell you when price finally breaks through one.

Support / Resistance Levels overview diagramsr.resistancesr.resistancesr.supportsr.support

How it works

It takes a stream of swing pivots, clusters nearby highs and lows that sit within equality_tolerance_pct of each other into a single level, and keeps a level only once it has been touched at least min_touches times. Each level is widened into a thin zone using zone_half_width_atr times the ATR so a near-miss still counts as a test. In breakout_mode the tool also watches price close through a level by breakout_threshold to flag a break, optionally requiring a volume surge and a retest of the broken level.

Modes

Percent breakoutpercent

A break is confirmed when price closes beyond the level by breakout_threshold measured as a percent of price, so the trigger scales the same way across cheap and expensive symbols.

Percent breakout diagram

When to use: Pick percent when you run one strategy across many instruments and want a break distance that does not need re-tuning per symbol.

ATR breakoutatr

A break is confirmed when price closes beyond the level by breakout_threshold multiples of the current ATR, so the trigger automatically widens in volatile conditions and tightens in quiet ones.

ATR breakout diagram

When to use: Pick ATR when you want the break distance to breathe with volatility instead of being a fixed amount.

Configuration

lookback_barsscalar

How many recent bars of pivots the tool scans when building levels. Larger remembers older floors and ceilings; smaller keeps only the freshest structure.

equality_tolerance_pctscalar

How close two pivot prices must be, as a percent, to be merged into one level. Larger fuses more pivots into fewer, broader levels; smaller keeps many tightly separated levels.

min_touchesscalar

How many times price must have reacted at a cluster before it is promoted to a real level. Larger keeps only well-tested, high-conviction levels; 2 is the usual minimum for a valid level.

zone_half_width_atrscalar

Half-thickness of each level zone expressed in ATR multiples, so a touch within this band still counts as hitting the level. Larger turns thin lines into forgiving zones.

max_levelsscalar

The hard cap on how many support and resistance levels to keep. When more qualify, the strongest (most-touched, most recent) survive so the chart stays readable.

breakout_modeenum

How the break distance is measured: percent uses a percent of price (portable across symbols), atr uses a multiple of the current ATR (scales with volatility).

Choices:percentatr
breakout_thresholdscalar

How far past a level price must close to count as a real break. The units depend on breakout_mode: percent of price, or ATR multiples. Larger demands a more decisive break and rejects shallow pokes.

volume_confirmation_ratioscalar

How much heavier than average the break bar's volume must be to confirm a breakout. 1.0 means at least average volume; larger demands a clear volume surge. 0 disables the volume check.

retest_window_barsscalar

After a break, how many bars to wait for price to come back and retest the broken level (old resistance becoming new support, or vice versa). 0 disables the retest requirement.

range_lookbackscalar

Window used to gauge the local trading range when ranking and de-duplicating levels, so closely spaced levels inside the same congestion are not all kept.

atr_periodscalar

Lookback used to compute the ATR that sizes the level zones and, in ATR breakout mode, the break distance. Larger smooths the volatility estimate; 14 is a common default.

Connects to

Reads from
Feeds into

Examples

  • Confluence: feed the levels into interpretor.sr_level and only take longs that bounce off a support level touched at least three times.
  • Breakout entry: in ATR breakout mode, fire a long when price closes above a resistance level by 0.25 ATR with above-average volume.
  • Risk placement: park a stop just beyond the nearest support zone instead of a fixed pip distance.

Common mistakes

  • Setting min_touches to 1, which promotes every single pivot to a 'level' and floods the chart with weak lines that price ignores.
  • Expecting a clean break the instant price pokes a level — without a sensible breakout_threshold a single wick through the line registers as a false breakout.

See also