OPEN-SOURCE SCRIPT

Support & Resistance Zones [HexaTrades]

7 503

This indicator automatically finds the price levels where the market has turned around before the places where buyers stepped in (support) and where sellers took over (resistance) and draws them as clean rectangular zones on your chart.

Instead of a thin line, each level is drawn as a zone with real thickness, because support and resistance are never one exact price; they are areas where price reacts. The zones update live, extend forward as long as they are valid, and turn into light "ghost" boxes once price finally breaks through them, so you always keep the full picture of the market's history.

istantanea
Bitcoin 4h: the indicator marking support and resistance zones


How it works

- Finds swing points. A swing high is a candle whose high is higher than the 10 candles on each side of it (the "Swing Length" setting). A swing low is the same idea upside down. These are the exact spots where the market turned.

- Builds a zone from the candle. The zone covers the candle's wick from the extreme tip to the candle body. That wick is where orders actually pushed price back, so it becomes the zone.

- Keeps zone size sensible. Very small wicks get padded to a minimum height, and no zone can grow taller than a maximum height (both measured in ATR, so they adapt automatically to each market's volatility).

- Merges duplicate levels. If a new swing forms at a level that already has a zone, the two are combined into one box instead of stacking clutter on your chart.

- Watches for breaks. When a candle closes beyond a zone, the zone is "broken." what happens next is up to you (see below).


What happens after a zone breaks?

The indicator provides three different zone-management options.

Keep As Past Zone: The broken zone stops extending and remains visible as a faded historical zone. This makes it easier to review how price behaved around previous levels.

Flip Support/Resistance: A broken resistance zone becomes support, while a broken support zone becomes resistance.
This is useful for studying the common market concept of role reversal, where old resistance may act as new support and old support may act as new resistance.

Delete Zone: The zone is completely removed after it breaks. This option is useful for traders who prefer a cleaner chart showing only active zones.


Optional volume filter:
Volume-Confirmed Zones Only can be enabled to filter out lower-volume swing points.
When enabled, the volume of the swing candle must be higher than: Average Volume × Volume Multiplier

For example, with a Volume Multiplier of 1.2, the swing candle’s volume must be greater than 120% of its average volume.
The volume filter is automatically ignored when volume data is unavailable. Volume quality can vary between markets, exchanges and brokers.


Indicator settings

- Swing Length: Controls how significant a swing must be. Lower values create more zones, while higher values create fewer but potentially more significant zones.

- Maximum Zones: Limits the number of active zones displayed. When the limit is exceeded, the oldest active zone is removed.

- ATR Length: Sets the calculation period used to measure volatility.

- Minimum Zone Height: Sets the minimum zone thickness as a multiple of ATR.

- Maximum Zone Height: Prevents zones from becoming excessively wide.

- Merge Overlapping Zones: Combines overlapping or nearby active zones.

- Merge Distance: Controls the ATR-based distance used when deciding whether zones should be merged.

- Maximum Past Zones: Limits how many broken historical zones remain on the chart.

- Past Zone Transparency: Controls how clearly broken zones are displayed.


Alerts

- Built-in alerts
- Zone Touched — price entered a support or resistance zone.
- Resistance Broken — a candle broke above a resistance zone.
- Support Broken — a candle broke a support zone below.
- Set them up from TradingView's alert dialog: Create Alert → Condition → S/R Zones.


How to use it in trading

🔶Bounce trades: when price falls into a support zone and prints a rejection candle, that's a long setup with a stop just below the zone.

A blue support zone represents an area where buyers previously entered the market.

When price returns to support:
- Wait for price to enter or test the zone.
- Look for evidence that buyers are responding.
- Consider an entry only after confirmation.
- Place the stop beyond the opposite side of the zone, with an appropriate buffer.
- Use the next resistance zone as a possible target.

Possible bullish confirmation includes:
- A candle rejecting the lower part of the zone.
- A long lower wick followed by a bullish close.
- A bullish engulfing candle.
- Price closing back above the support zone.
- Increasing volume during the reaction.
- A higher low forming near the zone.

A support touch by itself is not a long signal. Price can move directly through the zone, especially during a strong downtrend.
Example image below:
istantanea


🔶Rejection from resistance

A pink resistance zone represents an area where sellers previously entered the market.

When price reaches resistance:
- Wait for price to test the zone.
- Look for signs of selling pressure.
- Consider an entry only after bearish confirmation.
- Place the stop beyond the upper edge of the zone, with a suitable buffer.
- Use the next support zone below as a possible target.

Possible bearish confirmation includes:
- A long upper wick inside the resistance zone.
- A bearish engulfing candle.
- Price entering the zone and closing back below it.
- A lower high forming near resistance.
- Increasing selling volume during the rejection.

A resistance touch alone is not a short signal. Strong bullish momentum can break through resistance without producing a meaningful reversal.

Example image:
istantanea


🔶Trading a breakout

A breakout occurs when price moves beyond an active zone.

- A break above resistance may indicate increasing bullish strength.
- A break below support may indicate increasing bearish strength.

For more conservative confirmation, select Close under Break Confirmation. In this mode, a resistance zone breaks only after a candle closes above it, while a support zone breaks only after a candle closes below it.

The Wick option reacts as soon as price trades beyond the zone. It responds faster but is more sensitive to temporary spikes and false breakouts.

Before considering a breakout trade, traders may look for:
- A strong candle closing beyond the zone.
- A candle body that closes clearly outside the zone.
- Higher-than-average volume.
- Momentum in the breakout direction.
- Alignment with the broader market trend.
- A successful retest of the broken zone.

istantanea


🔶Trading a role reversal

Support and resistance can sometimes exchange roles after a breakout.

-Broken resistance may later act as support.
- Broken support may later act as resistance.

Select Flip Support/Resistance under the When Broken setting to display this behaviour automatically.

For example, after price closes above a pink resistance zone, the indicator converts that area into a blue support zone. If price later returns to it, traders can watch for a bullish reaction.

Similarly, when price breaks below blue support, the indicator converts the zone into pink resistance. A later retest may provide an area to watch for bearish confirmation.

Role reversal is a commonly observed price-action concept, but it does not occur successfully after every breakout. Wait for confirmation instead of entering only because price has returned to a flipped zone.


🔶Using zones for targets and stops

Zones can also help organise trade management.

For a long setup:
- A stop may be placed below the support zone.
- The next resistance zone may be used as an initial target.
- A higher resistance zone may be considered as a secondary target if momentum remains strong.

For a short setup:
- A stop may be placed above the resistance zone.
- The next support zone may be used as an initial target.
- A lower support zone may be considered as a secondary target.

Avoid placing the stop exactly on the edge of a zone. Price may briefly move beyond the boundary before reacting. The appropriate buffer depends on the symbol, timeframe, volatility and the trader’s risk plan.

Always calculate the potential risk and reward before entering a trade. A visible zone does not automatically make a setup worth taking.

🔶 Using multiple timeframes

Higher-timeframe zones can provide broader market context, while lower timeframes can help refine entries.

A simple process is:
- Identify important support and resistance on a higher timeframe.
- Determine whether the broader structure is bullish, bearish or ranging.
- Move to the preferred trading timeframe.
- Wait for price to reach a relevant zone.
- Use candle structure, volume or momentum for confirmation.

Higher timeframes generally produce fewer but more widely watched zones. Lower timeframes produce more zones and may contain more market noise.


Support and Resistance Zones help traders identify and manage important price areas with less chart clutter. Its volatility-based sizing, zone merging, break confirmation, role reversal, and alerts make it suitable for different markets and timeframes. Use the zones as areas to watch—not automatic trade signals and always combine them with price confirmation, broader market structure and proper risk management.


We would love to hear your suggestions. If you have ideas for new features, indicators, analytics, or improvements, please share your feedback. Your input helps guide future updates and improve the indicator for all traders.

Wedge pattern detector indicator is for educational and analytical purposes only. It is not financial advice. Trading involves risk. Always use proper risk management and combine this indicator with your own analysis before taking any trade.

Declinazione di responsabilità

Le informazioni e le pubblicazioni non sono intese come, e non costituiscono, consulenza o raccomandazioni finanziarie, di investimento, di trading o di altro tipo fornite o approvate da TradingView. Per ulteriori informazioni, consultare i Termini di utilizzo.