OPEN-SOURCE SCRIPT

Support and Resistance all in one

The Support and Resistance Indicator (v4) is designed to identify and track key price levels in financial markets. Here's how it works:

Core Functionality
Level Detection
Uses pivot points to identify significant price levels
Looks for swing highs (resistance) and swing lows (support)
Requires price action to pivot over a specified period (default 10 bars)
Dynamic Level Management
Maintains separate arrays for support and resistance levels
Limits maximum displayed levels (default 10) to prevent chart clutter
Removes oldest levels when maximum is reached
Ensures new levels are sufficiently distant from existing ones (minimum 1% separation)
Touch Detection System
Monitors price interaction with established levels
Counts when price comes within 0.1% of any level
Updates touch count and strength classification
Categories: "New" (1 touch), "Moderate" (2 touches), "Strong" (3+ touches)
Visual Representation
Draws horizontal lines at each level
Updates line width based on strength (thicker for stronger levels)
Shows labels with price and strength information
Color coding: Red (new/moderate levels), Green (strong levels)
Displays triangles (▼▲) at pivot points
Trading Applications
Support/Resistance Trading
Strong levels (3+ touches) suggest reliable trading zones
More touches indicate higher probability reversal points
Use for stop loss and target placement
Breakout Trading
Monitor breaks of strong levels
Higher touch count suggests more significant breakouts
Watch for false breakouts at weaker levels
Risk Management
Place stops beyond strong levels
Use level strength to adjust position size
Consider multiple timeframe analysis
Best Practices
Use with other indicators for confirmation
Consider market context and trend
Monitor level strength development
Don't rely solely on touch count
Watch for price reaction at levels
Customization Options
Adjust pivot length for different timeframes
Modify minimum distance between levels
Change required touches for "Strong" classification
Toggle strength labels display
Choose line style (Solid/Dashed/Dotted)
This indicator helps identify key price levels where market participants have shown interest, making it valuable for trade planning and risk management

Declinazione di responsabilità