OPEN-SOURCE SCRIPT

Trend lines & Pressure Zone

140
Overview
This indicator intelligently identifies and plots dynamic support and resistance zones based on swing pivots and price action validation. It combines trend analysis with pressure zone detection to highlight key areas where price is likely to react.
Key Features
1.Smart Zone Detection

Automatically identifies the strongest resistance and support levels
Requires multiple price touches for validation (configurable)
Plots only the 2 most relevant trendlines to keep charts clean
Dynamic channel zones show the area of influence around each trendline

2.Dual Analysis Method

Uses swing pivot detection to find turning points
Validates zones through touch counting with price margin tolerance
Combines aspects of trendline analysis and pressure zone theory
Adapts to different timeframes and instruments

3.Contact Detection & Alerts

Visual circle markers when price contacts zones
Arrow indicators for zone interactions
Alert conditions for zone creation, breaks, and contacts
Customizable visual feedback

4.Flexible Configuration

Adjustable swing length for pivot detection
Configurable price margin tolerance
Minimum touch requirements prevent false signals
Optional line extension with custom length
Peak reset interval to refresh zones periodically

How It Works
Resistance Zones:

Identifies swing high pivots
Tracks the highest peak within the reset interval
When price drops below the peak, draws a downward trendline
Validates the zone by counting touches within the price margin
Only displays the zone after minimum touches are confirmed

Support Zones:

Identifies swing low pivots
Tracks the lowest trough within the reset interval
When price rises above the trough, draws an upward trendline
Validates the zone by counting touches within the price margin
Only displays the zone after minimum touches are confirmed

Zone Channels:
Each trendline includes a parallel channel showing the pressure zone width, making it easier to identify when price is interacting with the zone.

Pivot Detection:

Swing Length (default: 5) - Bars on each side to confirm pivot points
Peak Reset Interval (default: 100) - Bars before resetting tracked peak/trough

Zone Settings:

Price Margin % (default: 0.1%) - Tolerance for touch validation
Minimum Touches (default: 3) - Required touches before drawing zone
Channel Width % (default: 0.5%) - Visual width of pressure zone

Extension:

Extend Lines (default: off) - Project lines into the future
Extension Length (default: 50) - Bars to extend when enabled

Visual Styling:

Separate color/width controls for resistance and support
Customizable fill transparency for channels, Toggle contact arrows and circles

Trading Applications
Entry Signals:

Buy when price contacts support zone with confirmation
Sell when price contacts resistance zone with confirmation, Look for zone breaks as momentum signals

Stop Loss Placement:
Place stops beyond the opposite zone, Use channel width to gauge volatility

Target Setting:
Opposite zone acts as first profit target, Zone breaks signal potential trend continuation

Confluence:

Works well with volume analysis,Combine with RSI/MACD for confirmation,
Use multiple timeframes for stronger signals

Best Practices
✅ DO:

Adjust swing length based on timeframe (lower for intraday, higher for daily+)
Reduce minimum touches (2-3) for volatile markets
Increase price margin for choppy conditions
Wait for candle close confirmation on zone breaks

❌ DON'T:

Trade zones in isolation without other confirmation
Use overly tight parameters that generate false signals
Ignore the broader trend context
Chase price after zone breaks without pullback

Tips for Optimization

Scalping (1-5 min): Swing Length: 3-5, Min Touches: 2
Day Trading (15-60 min): Swing Length: 5-10, Min Touches: 3
Swing Trading (4H-Daily): Swing Length: 10-20, Min Touches: 3-4
Position Trading (Daily-Weekly): Swing Length: 15-25, Min Touches: 4-5

Alert Conditions

Zone Contact: Price touches resistance or support zone
Set up notifications for real-time trading opportunities


Disclaimer: This indicator is for educational and informational purposes only. It should not be considered financial advice. Always perform your own analysis and risk management before trading.

Wyłączenie odpowiedzialności

Informacje i publikacje nie stanowią i nie powinny być traktowane jako porady finansowe, inwestycyjne, tradingowe ani jakiekolwiek inne rekomendacje dostarczane lub zatwierdzone przez TradingView. Więcej informacji znajduje się w Warunkach użytkowania.