Crptopastor support & Resistance Pro

Standard support and resistance indicators often clutter the chart with dozens of single-price lines, leaving the trader to guess which ones are truly significant. This script solves that problem using a proprietary clustering algorithm. Instead of just marking individual pivots, it analyzes pivot density to identify areas of historical price confluence. These areas are then drawn as dynamic zones, giving you a much clearer and more actionable view of the market structure.
This tool is built for serious traders who value a clean chart and data-driven insights. It automatically filters, grades, and displays only the most relevant S/R zones, and even plots potential trade setups based on these key levels.
Justification of Originality (Why this is a "Pro" Tool)
While the foundation of this indicator is the classic Pivot High/Low concept (
- [] Pivot Clustering Algorithm: The script does not just plot raw pivots. It collects a history of recent pivot points and intelligently clusters them together based on their proximity. If multiple pivots form within a narrow price range (configurable by you), the script merges them into a single, high-validity S/R zone. This method identifies true areas of supply and demand, not just isolated price wicks.
[] Dynamic Strength Rating: Not all zones are created equal. Each zone is given a "strength" score based on the number of individual pivots that formed it. This allows the indicator (and you) to distinguish between a minor level and a major institutional zone. You can set a minimum strength to filter out insignificant levels entirely.
[] Intelligent Zone Management: To maintain chart clarity, the script has a built-in logic to manage overlapping zones. If a new, stronger zone forms that overlaps with an existing, weaker one, the weaker zone is automatically removed. This ensures your chart always shows the most relevant and current market structure.
[] Automated Trade Setup Plotting: Beyond just identifying zones, this script actively helps with trade planning. It identifies the nearest support or resistance zone relative to the current price and automatically generates and plots a potential trade setup, including:- [] An Entry Price (at the midpoint of the zone)
[] A Stop Loss (placed with a user-defined safety buffer below a support zone or above a resistance zone) - Up to 5 Take Profit Levels (dynamically identified from the subsequent S/R zones)
- [] An Entry Price (at the midpoint of the zone)
How The Indicator Works: The Logic Explained
To provide full transparency on the script's mechanics without revealing the entire source, here is a step-by-step breakdown of the calculation process:
- [] Step 1: Raw Pivot Detection: The script begins by identifying all recent pivot highs and lows using standard Pine Script functions, based on the Pivot Period you set.
[] Step 2: Pivot Clustering & Zone Creation: This is the core engine. The script iterates through the detected pivots. For each pivot, it scans for other nearby pivots within a price range defined by the Maximum Channel Width % input. All pivots found within this range are grouped into a "cluster."
[] Step 3: Strength Calculation & Filtering: The number of pivots within each cluster determines its "strength." Only clusters that meet the Minimum Strength requirement are considered valid S/R zones.
[] Step 4: Zone Consolidation & Display: The script plots the valid clusters as colored boxes (zones). To avoid clutter, it limits the display to the Maximum Number of S/R zones and ensures that stronger, overlapping zones replace weaker ones. The zone's color dynamically changes between support (green) and resistance (red) based on whether the current price is above or below it. - Step 5: Trade Setup Calculation: The indicator finds the closest valid support zone below the price and the closest valid resistance zone above it. Based on which is closer, it determines a likely trade direction (Long or Short) and plots the Entry, Stop Loss, and Take Profit levels accordingly.
Settings & Input Parameters Explained
This script is fully customizable to suit your trading style and the asset you are trading.
Setup
- []: The lookback period (number of bars to the left and right) to identify a pivot. A smaller number will be more sensitive and generate more pivots. Default is 10.
Pine Script® Pivot Period (prd)
[]: The price data used to calculate pivots. High/Low is standard for capturing extremes. Close/Open can be used to focus on body-based levels.Pine Script® Source (ppsrc)
[]: The maximum number of recent raw pivots the script will store in memory for its calculations.Pine Script® Maximum Number of Pivot (maxnumpp)
[]: This is a key setting. It defines how close pivots need to be (as a percentage of recent price range) to be clustered into a single zone. A larger value will create wider zones and group more distant pivots together.Pine Script® Maximum Channel Width % (ChannelW)
[]: The maximum number of final S/R zones to display on the chart. This keeps the chart clean.Pine Script® Maximum Number of S/R (maxnumsr)
[]: The minimum number of pivots required to form a valid S/R zone. A higher number means the zone is stronger and more respected.Pine Script® Minimum Strength (min_strength)
[]: A visual aid to see the raw pivot points that the script is using for its calculations.Pine Script® Show Point Points (showpp)
Trade Setup
- []: Toggles the display of the automated Entry, SL, and TP labels.
Pine Script® Show Trade Setups
[]: Sets the maximum number of TP levels to plot.Pine Script® Number of Take Profit Levels
[]: A crucial risk management tool. It adds a safety buffer to your stop loss, placing it a certain percentage of the zone's height away from the zone's edge to avoid stop hunts.Pine Script® Stop Loss Buffer % (sl_buffer_pct)
Colors
- Fully customize the colors, line style, width, and label location to match your chart's theme.
How to Use in Your Trading
This indicator is versatile and can be used in several ways:
- [] Mean Reversion Strategy: Look for entries when the price rejects a strong support or resistance zone. For example, wait for price to touch a green support zone and then start moving up before considering a long position.
[] Breakout Strategy: Use the zones as your breakout levels. A decisive close above a red resistance zone (which will then turn green) can signal a bullish breakout. The built-in "Resistance Broken" and "Support Broken" alerts are perfect for this.
[] Confirmation Tool: Use these data-driven zones to confirm levels identified by your own analysis. If your trendline converges with a strong zone from this script, your confidence in that level should increase.
[] Trade Management: Use the automatically plotted S/R zones as logical levels to take partial profits or trail your stop loss. The automated Take Profit levels are designed for this purpose.
Disclaimer: This indicator is a tool to aid in technical analysis and decision-making. It is not a signal-generating "robot" and should not be followed blindly. All trading involves risk, and past performance is not indicative of future results. Please use this script as part of a comprehensive trading plan with proper risk management.
Skrip jemputan sahaja
Hanya pengguna yang diluluskan oleh penulis boleh mengakses skrip ini. Anda perlu memohon dan mendapatkan kebenaran untuk menggunakannya. Ini selalunya diberikan selepas pembayaran. Untuk lebih butiran, ikuti arahan penulis di bawah atau hubungi terus cryptopastor001.
TradingView tidak menyarankan pembayaran untuk atau menggunakan skrip kecuali anda benar-benar mempercayai penulisnya dan memahami bagaimana ia berfungsi. Anda juga boleh mendapatkan alternatif sumber terbuka lain yang percuma dalam skrip komuniti kami.
Arahan penulis
Amaran: sila baca panduan kami untuk skrip jemputan sahaja sebelum memohon akses.
Penafian
Skrip jemputan sahaja
Hanya pengguna yang diluluskan oleh penulis boleh mengakses skrip ini. Anda perlu memohon dan mendapatkan kebenaran untuk menggunakannya. Ini selalunya diberikan selepas pembayaran. Untuk lebih butiran, ikuti arahan penulis di bawah atau hubungi terus cryptopastor001.
TradingView tidak menyarankan pembayaran untuk atau menggunakan skrip kecuali anda benar-benar mempercayai penulisnya dan memahami bagaimana ia berfungsi. Anda juga boleh mendapatkan alternatif sumber terbuka lain yang percuma dalam skrip komuniti kami.
Arahan penulis
Amaran: sila baca panduan kami untuk skrip jemputan sahaja sebelum memohon akses.