OPEN-SOURCE SCRIPT

Support & Resistance

9 940
s&r mtf is a support and resistance indicator designed to display clean zones directly on the chart.

the script automatically detects support zones from pivot lows and resistance zones from pivot highs. each zone is displayed with a rectangle, a dotted center line, and an optional label.

the goal is to help the trader identify important areas where price may react, reject, break, or come back for a retest.

the mtf version allows zones from a higher timeframe to be displayed on a lower timeframe. for example, daily zones can be displayed on an h1, 30 minute, or 15 minute chart.

this script is not an automatic buy or sell system. it is designed to read market structure, prepare decision zones, and avoid trading without context.

main features

automatic support zones
automatic resistance zones
chart mode or mtf mode
display higher timeframe zones on the current chart
support only below price
resistance only above price
left zone extension
right zone extension
merge zones that touch
merge zones that are too close according to the minimum distance setting
keep the lowest support when zones merge
keep the highest resistance when zones merge
strong candle break filter
optional candle close confirmation
doji filter
atr strength filter
force percentage inside the label
support break alerts
resistance break alerts
clean display with rectangles, center lines, and labels

how the script works

the script creates a resistance zone when a pivot high is confirmed.

the script creates a support zone when a pivot low is confirmed.

a resistance is valid only when it is above the current price.

a support is valid only when it is below the current price.

if two support zones touch or are too close, they are merged and the lowest support is kept.

if two resistance zones touch or are too close, they are merged and the highest resistance is kept.

if price breaks a zone with the selected break conditions, the zone can be removed and an alert can be triggered.

chart mode

chart mode uses the current chart timeframe.

example:
if the chart is on 30 minutes, the zones are calculated from the 30 minute chart pivots.

this mode is useful for reading the exact timeframe you are trading.

mtf mode

mtf mode calculates zones from a higher timeframe and displays them on the current chart.

example:
you are on an h1 chart.
you enable mtf mode.
you choose the daily timeframe.
the script displays daily zones directly on the h1 chart.

this helps keep major market zones visible while trading intraday.

mtf use case example

if you trade on 30 minutes, you can display daily zones.

this helps avoid buying directly under a daily resistance or selling directly above a daily support.

mtf zones are often more important than small lower timeframe zones because they come from a wider market structure.

beginner tutorial

step 1: enable the module

enable the support and resistance module.

if the mode is set to chart, the script uses the current chart timeframe.

if the mode is set to mtf, the script uses the timeframe selected in the mtf settings.

step 2: choose the mode

use chart if you want zones from the current timeframe.

use mtf if you want to see zones from a higher timeframe.

simple example:
for scalping on 10 minutes, display h1 or daily zones.
for trading on h1, display daily zones.
for trading on h4, display daily or weekly zones.

step 3: watch support zones

support zones are located below price.

a support can be used as an area of interest to look for a bullish reaction.

a beginner can wait for a wick rejection, a bullish close, or a reclaim above the zone before looking for a possible long setup.

step 4: watch resistance zones

resistance zones are located above price.

a resistance can be used as an area of interest to look for a bearish reaction.

a beginner can wait for rejection, a bearish close, or a failed breakout before looking for a possible short setup.

step 5: do not trade a zone alone

a zone is not an automatic signal.

you should wait for confirmation.

possible confirmations:
price reaction
wick rejection
clean close
volume
trend alignment
confirmed breakout
zone retest

step 6: use the merge logic

if several zones touch or are too close, the script groups them together.

this helps avoid a chart filled with useless overlapping zones.

for supports, the lowest level is kept.

for resistances, the highest level is kept.

step 7: use the minimum distance setting

minimum distance helps prevent zones from being created too close to each other.

if you lower the distance, the script accepts more zones.

if you increase the distance, the chart becomes cleaner and more selective.

even if the minimum distance is low, two zones that really touch should remain merged.

input explanation

enable s/r module

turns the support and resistance module on or off.

zone source mode

selects the source of the zones.

chart uses the current timeframe.

mtf uses the selected higher timeframe.

mtf zone timeframe

selects the timeframe used to calculate mtf zones.

example:
daily to display daily zones on h1 or 30 minute charts.
weekly to display weekly zones on h4 or daily charts.

pivot length

controls pivot sensitivity.

a lower value creates more zones and reacts faster.

a higher value creates fewer zones but makes them more selective.

number of visible zones

sets the maximum number of visible zones.

a lower value gives a cleaner chart.

a higher value shows more historical structure.

show s/r labels

shows or hides zone labels.

labels can display the zone type, percentage distance, and force value.

show only 2 active zones

keeps only the latest active resistance and the latest active support.

this is useful for a very clean chart.

minimum distance between zones

sets the minimum space between zones.

the higher the value, the fewer close zones will remain.

the lower the value, the more close zones the script accepts.

zone left extension

extends zones to the left.

this helps show the visual origin of a zone.

zone right extension

extends zones to the right.

this projects the zones into the future.

confirm breaks only on candle close

when enabled, a break is confirmed only after the candle closes.

this reduces false breaks during a live candle.

break equals full body outside zone plus strong candle

when enabled, the script requires the full candle body to close outside the zone with enough strength.

this makes break detection stricter.

max doji body to range

defines when a candle is considered a doji.

a doji is a candle with a small body.

doji candles can be ignored to avoid weak break signals.

min strength body to range

defines the minimum body size compared to the full candle range.

a higher value requires a stronger candle.

min strength body greater or equal atr multiplier

defines the minimum body strength compared to atr.

the higher the value, the stronger the break candle must be.

show force percent

shows the zone penetration force inside the label.

cap force percent

limits the displayed force value to avoid very large numbers.

max cap percent

sets the maximum displayed value when the force cap is enabled.

alert break resistance

enables the alert when a resistance zone is broken.

alert break support

enables the alert when a support zone is broken.

bullish use case example

price comes back to a support zone.

the support remains below price.

the market shows a bullish reaction.

a rejection candle appears.

the trader can then watch for a possible long setup, especially if the general trend is bullish.

bearish use case example

price comes back to a resistance zone.

the resistance remains above price.

the market shows rejection.

a bearish candle appears.

the trader can then watch for a possible short setup, especially if the general trend is bearish.

mtf example

you trade on h1.

you enable mtf mode.

you choose daily.

daily zones appear on the h1 chart.

if price reaches a daily resistance, the trader avoids buying too late.

if price returns to a daily support, the trader watches for a possible reaction.

beginner tips

do not trade every zone automatically.

always wait for price reaction.

avoid buying directly below resistance.

avoid selling directly above support.

use mtf zones as major decision areas.

always use a stop loss.

use proper position sizing.

combine the zones with trend, volume, candlesticks, and market structure.

important note

this script does not guarantee results.

supports can break.

resistances can break.

the best use of this tool is to treat it as a map of important market zones, combined with strict risk management and personal confirmation before each trade.

免责声明

这些信息和出版物并非旨在提供,也不构成TradingView提供或认可的任何形式的财务、投资、交易或其他类型的建议或推荐。请阅读使用条款了解更多信息。