OPEN-SOURCE SCRIPT
Actualizado

SuperTrend - With Exits & Trade Zones

3 328
SuperTrend - With Exits & Trade Zones
Overview
An advanced trend-following indicator that combines pivot points with the SuperTrend methodology to create a complete trading system with entry signals, exit signals, and visual trade zones. This indicator adapts to market structure rather than just price action, providing more reliable trend identification.
What Makes This Unique
Unlike standard SuperTrend indicators that use moving averages, this version:

Uses actual pivot points to calculate a dynamic center line
Provides multiple entry mode options for different trading styles
Shows clear exit signals (both trailing stop and take profit)
Color-codes the entire chart into trade zones (Long, Short, No Trade)
Eliminates guesswork about when to enter, exit, and stay out

Features
📊 Core Indicator Components

Pivot Point Detection: Identifies local highs and lows in price structure
Dynamic Center Line: Weighted calculation using detected pivot points
ATR-Based Bands: Volatility-adjusted upper and lower bands
Trailing Stop Line: Adaptive stop-loss that follows the trend

🎯 Entry Signals
Four entry modes to match your trading style:
Immediate Mode ⚡

Signals right when the trailing stop breaks
Fastest entries for aggressive traders
Best for strong trending markets

Aggressive Mode 🔥 (Recommended)

Signals when price closes beyond break candle OR opens beyond it
Balanced speed and confirmation
Good for most market conditions

Balanced Mode ⚖️

Requires entire candle to close beyond break level
Moderate confirmation
Reduces false breakouts

Conservative Mode 🛡️

Waits for candle to open AND stay completely beyond break level
Highest confirmation, slowest entries
Best for choppy markets

🚪 Exit Signals
Three exit strategies:
Trailing Stop

Exits when price crosses back through the trailing stop line
Lets profits run in trending markets
Protects gains when trend weakens

Take Profit %

Exits at predetermined profit target
Locks in gains at specific percentage
Good for range-bound markets

Both

Uses whichever exit comes first
Combines profit protection with trend following
Recommended for most traders

🎨 Visual Trade Zones
Color-coded backgrounds eliminate confusion:

🟢 Light Green: Active LONG position
🔴 Light Red: Active SHORT position
⚫ Gray: NO TRADE ZONE (between exit and next signal)

📍 Additional Visual Elements

Diamond markers: Show when trailing stop is first broken
BUY/SELL labels: Clear entry signals in green/red
EXIT markers: Gray X for stop loss, Orange X (TP) for take profit
Pivot points: Optional display of detected highs/lows (H/L markers)
Support/Resistance: Optional circles at pivot levels

Settings & Parameters
Basic Settings

Pivot Point Period (default: 2)

Controls sensitivity of pivot detection
Lower = more pivots detected (more responsive)
Higher = fewer pivots (more stable)


ATR Factor (default: 3)

Distance multiplier for trailing stop bands
Lower = tighter stops (more signals, earlier exits)
Higher = wider stops (fewer signals, longer trades)


ATR Period (default: 10)

Lookback period for volatility calculation
Affects how quickly bands adapt to volatility changes



Entry Configuration

Entry Mode: Select from Immediate/Aggressive/Balanced/Conservative
Determines how quickly the indicator generates signals after a trend break

Exit Configuration

Exit Method: Choose Trailing Stop, Take Profit %, or Both
Take Profit % (default: 2%)

Set your profit target as percentage of entry price
Adjust based on volatility and timeframe



Display Options

Show Buy/Sell Labels: Toggle entry signal labels
Show Exit Signals: Toggle exit markers
Show Break Candles: Toggle diamond markers on trend breaks
Show Pivot Points: Display H/L markers at pivot points
Show PP Center Line: Display the dynamic center line
Show Support/Resistance: Display circles at S/R levels

How to Use
For Swing Traders

Set Entry Mode to "Balanced" or "Conservative"
Use "Both" exit method with 3-5% take profit
Enable all visual elements for complete market picture
Trade only in direction of colored zones

For Day Traders

Set Entry Mode to "Aggressive" or "Immediate"
Use "Trailing Stop" exit method to catch intraday trends
Lower ATR Factor to 2-2.5 for tighter stops
Watch for quick signals in the first 2 hours of trading

For Position Traders

Use higher timeframes (Daily/Weekly)
Set Entry Mode to "Conservative"
Increase Take Profit % to 5-10%
Use larger ATR Factor (4-5) for wider stops

General Trading Rules

✅ DO: Enter on BUY/SELL signals (green/red backgrounds)
✅ DO: Exit on EXIT/TP markers
❌ DON'T: Enter during gray NO TRADE ZONE
❌ DON'T: Counter-trend trade against the colored zone

Alerts
Set up the following alerts for automated trading notifications:

Buy Signal: Triggers when long entry conditions are met
Sell Signal: Triggers when short entry conditions are met
Exit Long: Triggers when long position should be closed
Exit Short: Triggers when short position should be closed
Trailing Stop Broken: Triggers on initial trend change

Best Practices
Timeframe Selection

1-5 min: Scalping (use Immediate/Aggressive mode)
15-60 min: Day trading (use Aggressive/Balanced mode)
4H-Daily: Swing trading (use Balanced/Conservative mode)
Weekly: Position trading (use Conservative mode)

Risk Management

Always use the EXIT signals - don't hold through gray zones
Position size based on distance to trailing stop
Never risk more than 1-2% per trade
Consider wider stops on higher timeframes

Market Conditions

Trending markets: Use Aggressive mode, Trailing Stop exits
Ranging markets: Use Conservative mode, Take Profit exits
High volatility: Increase ATR Factor, use Both exits
Low volatility: Decrease ATR Factor for tighter stops

Technical Details
Calculation Method

Detect pivot highs and lows using specified period
Calculate weighted center line: (previous_center × 2 + new_pivot) / 3
Calculate bands: Upper = Center - (ATR Factor × ATR), Lower = Center + (ATR Factor × ATR)
Determine trend based on price position relative to bands
Trail stop line follows the active trend direction

Signal Logic

Entry signals generated based on selected confirmation mode
Position tracking maintains state from entry to exit
Exit signals calculated from both trailing stop and take profit levels
Trade zones update in real-time based on position state

Limitations & Considerations

Works best in trending markets; may generate false signals in tight ranges
Not a holy grail - should be used with proper risk management
Past performance does not guarantee future results
Recommended to backtest on your specific instrument and timeframe
Consider combining with volume analysis or other indicators for confirmation

Version History

v1.0: Initial release with entry signals and confirmation modes
v1.1: Added exit signals (trailing stop and take profit)
v1.2: Added color-coded trade zones (Long/Short/No Trade)

Credits
Original Pivot Point SuperTrend concept by LonesomeTheBlue
Modified with exit signals and trade zone visualization
License
Mozilla Public License 2.0

Example Setups
Conservative Swing Trading
Pivot Point Period: 2
ATR Factor: 3
ATR Period: 10
Entry Mode: Conservative
Exit Method: Both
Take Profit %: 4%
Aggressive Day Trading
Pivot Point Period: 2
ATR Factor: 2.5
ATR Period: 10
Entry Mode: Aggressive
Exit Method: Trailing Stop
Position Trading
Pivot Point Period: 3
ATR Factor: 4
ATR Period: 14
Entry Mode: Balanced
Exit Method: Both
Take Profit %: 8%

Disclaimer: This indicator is for educational purposes only. Trading involves substantial risk. Always do your own research and never trade with money you cannot afford to lose.
Notas de prensa
Overview
This comprehensive trading indicator combines three powerful methodologies into a single, cohesive trading system: Pivot Point SuperTrend for trend following, Opening Range Breakout (ORB) for intraday opportunities, and VWAP filtering for high-probability trade selection. The indicator is designed for traders seeking a multi-dimensional approach to market analysis with clear entry and exit signals.
Key Features
1. SuperTrend With Advanced options

Dynamic trend identification using pivot-based SuperTrend calculations
Automatic trailing stop loss levels that adapt to price action
Multiple entry modes: Immediate, Aggressive, Balanced, and Conservative
Configurable ATR-based bands for different market conditions
Visual break candle markers for trend changes

2. Opening Range Breakout (ORB)

Customizable opening range period with timezone support
Automatic target generation based on range percentage
Daily bias integration for directional edge
ORB rejection signals at key levels (ORH, ORL, Fair Value)
Adaptive or Extended target display modes
Historical data toggle for clean chart presentation

3. VWAP Filter

Two filtering modes: Strict (price-based) and Moderate (close-based)
Filters all signals - SuperTrend, ORB, and Heikin Ashi reversals
Optional VWAP line display
Helps avoid counter-trend trades in ranging markets

4. Volume Analysis

Real-time volume ratio calculations
Color-coded volume labels with transparency based on strength
High-volume breakout alerts
Configurable lookback period

5. Smoothed Heikin Ashi Reversals

Dual-smoothed Heikin Ashi calculations for noise reduction
Minimum trend bar requirement to avoid false signals
VWAP-filtered reversal signals
Customizable colors and sensitivity

6. Exit Management

Three exit methods: Trailing Stop, Take Profit %, or Both
Visual exit signals with TP and EXIT markers
Background color coding for trade zones
No-trade zone highlighting after exits

How It Works
Signal Generation Flow

SuperTrend Trend Detection: The indicator first identifies the prevailing trend using pivot-based SuperTrend calculations with ATR bands.
Break Candle Identification: When the trailing stop is broken, the indicator marks the break candle and begins monitoring for confirmation based on your selected entry mode.
VWAP Filtering: Before any signal is generated, the VWAP filter (if enabled) ensures price is positioned correctly:

Buy signals: Price must be above VWAP
Sell signals: Price must be below VWAP


Entry Confirmation: Depending on your entry mode:

Immediate: Signals on the first bar after break
Aggressive: Waits for price to cross the break level
Balanced: Requires both close AND low/high beyond break level
Conservative: Most stringent - requires open AND low/high beyond break level


Volume Confirmation: Volume ratio labels appear on signals, with color intensity indicating volume strength (2x+ volume = bright, <1x = faded).
Exit Execution: The system monitors for either trailing stop violation or take profit target hit, displaying clear exit markers.

ORB Component
The Opening Range Breakout operates independently but is also VWAP-filtered:

Establishes range during configurable opening period
Generates targets above (bullish) and below (bearish) the range
Signals breakouts with directional arrows
Identifies rejection patterns at ORH, ORL, and Fair Value mid-point
Adapts target display to current price movement

Configuration Guide
Quick Start Settings
For Day Trading:

Entry Mode: Aggressive
VWAP Filter: Strict
ORB Time Period: 30 minutes
Enable ORB: Yes
Volume Lookback: 20

For Swing Trading:

Entry Mode: Balanced or Conservative
VWAP Filter: Moderate
Disable ORB features
Focus on SuperTrend signals

For Scalping:

Entry Mode: Immediate
VWAP Filter: Strict
ORB Time Period: 15 minutes
Show HA Reversals: Yes

Parameter Optimization

ATR Factor: Higher values (3-4) for trending markets, lower (2-2.5) for choppy conditions
Pivot Period: Smaller values (1-2) for faster signals, larger (3-5) for stability
Rejection Wick %: Increase (60-70%) for stronger confirmation, decrease (40-50%) for more signals

Alert Configuration
The indicator includes comprehensive alert conditions:

Buy/Sell signals (VWAP filtered)
Exit long/short notifications
Trailing stop breaks
High volume breakouts
ORB bullish/bearish breakouts

Simply create alerts using TradingView's alert menu and select the desired condition.
Visual Elements

Green/Red Lines: Trailing stop loss levels
Diamond Markers: Trend break candles
BUY/SELL Labels: Entry signals
EXIT/TP Markers: Exit points
HA Circles: Heikin Ashi reversals
ORB Boxes: Opening range highlighting
Target Lines: Profit targets with TP labels
Volume Labels: Real-time volume ratio
Background Colors: Trade zone status

Best Practices

Combine Signals: Look for alignment between SuperTrend and ORB signals for highest probability setups
Respect VWAP: The filter prevents many losing counter-trend trades - don't override it
Volume Matters: Prioritize signals with 1.5x+ volume ratio
Use Appropriate Timeframes: 5-15 minute charts for day trading, 1H-4H for swing trading
Risk Management: Always use the trailing stop - it adapts to volatility

Limitations

Like all indicators, this works best in trending conditions
Choppy, sideways markets may generate false signals
VWAP filter may cause missed opportunities in strong trends that start below/above VWAP
ORB component is designed for instruments with defined trading sessions

Credits
Original SuperTrend concept by tapaspattanaik, enhanced with Exit Signals, Volume Analysis, ORB integration, VWAP filtering, and Heikin Ashi reversals.

Disclaimer: This indicator is for educational purposes only. Always practice proper risk management and never risk more than you can afford to lose. Past performance does not guarantee future results.
Notas de prensa
Pivot Point SuperTrend + ORB + VWAP - Advanced Trading System
Overview
This comprehensive trading indicator combines three powerful methodologies into a single, cohesive trading system: Pivot Point SuperTrend for trend following, Opening Range Breakout (ORB) for intraday opportunities, and VWAP filtering for high-probability trade selection. The indicator is designed for traders seeking a multi-dimensional approach to market analysis with clear entry and exit signals.
Key Features
1. Pivot Point SuperTrend

Dynamic trend identification using pivot-based SuperTrend calculations
Automatic trailing stop loss levels that adapt to price action
Multiple entry modes: Immediate, Aggressive, Balanced, and Conservative
Configurable ATR-based bands for different market conditions
Visual break candle markers for trend changes

2. Opening Range Breakout (ORB)

Customizable opening range period with timezone support
Automatic target generation based on range percentage
Daily bias integration for directional edge
ORB rejection signals at key levels (ORH, ORL, Fair Value)
Adaptive or Extended target display modes
Historical data toggle for clean chart presentation

3. VWAP Filter

Two filtering modes: Strict (price-based) and Moderate (close-based)
Filters all signals - SuperTrend, ORB, and Heikin Ashi reversals
Optional VWAP line display
Helps avoid counter-trend trades in ranging markets

4. Volume Analysis

Real-time volume ratio calculations
Color-coded volume labels with transparency based on strength
High-volume breakout alerts
Configurable lookback period

5. Smoothed Heikin Ashi Reversals

Dual-smoothed Heikin Ashi calculations for noise reduction
Minimum trend bar requirement to avoid false signals
VWAP-filtered reversal signals
Customizable colors and sensitivity

6. Exit Management

Three exit methods: Trailing Stop, Take Profit %, or Both
Visual exit signals with TP and EXIT markers
Background color coding for trade zones
No-trade zone highlighting after exits

How It Works
Signal Generation Flow

SuperTrend Trend Detection: The indicator first identifies the prevailing trend using pivot-based SuperTrend calculations with ATR bands.
Break Candle Identification: When the trailing stop is broken, the indicator marks the break candle and begins monitoring for confirmation based on your selected entry mode.
VWAP Filtering: Before any signal is generated, the VWAP filter (if enabled) ensures price is positioned correctly:

Buy signals: Price must be above VWAP
Sell signals: Price must be below VWAP


Entry Confirmation: Depending on your entry mode:

Immediate: Signals on the first bar after break
Aggressive: Waits for price to cross the break level
Balanced: Requires both close AND low/high beyond break level
Conservative: Most stringent - requires open AND low/high beyond break level


Volume Confirmation: Volume ratio labels appear on signals, with color intensity indicating volume strength (2x+ volume = bright, <1x = faded).
Exit Execution: The system monitors for either trailing stop violation or take profit target hit, displaying clear exit markers.

ORB Component
The Opening Range Breakout operates independently but is also VWAP-filtered:

Establishes range during configurable opening period
Generates targets above (bullish) and below (bearish) the range
Signals breakouts with directional arrows
Identifies rejection patterns at ORH, ORL, and Fair Value mid-point
Adapts target display to current price movement

Configuration Guide
Quick Start Settings
For Day Trading:

Entry Mode: Aggressive
VWAP Filter: Strict
ORB Time Period: 30 minutes
Enable ORB: Yes
Volume Lookback: 20

For Swing Trading:

Entry Mode: Balanced or Conservative
VWAP Filter: Moderate
Disable ORB features
Focus on SuperTrend signals

For Scalping:

Entry Mode: Immediate
VWAP Filter: Strict
ORB Time Period: 15 minutes
Show HA Reversals: Yes

Parameter Optimization

ATR Factor: Higher values (3-4) for trending markets, lower (2-2.5) for choppy conditions
Pivot Period: Smaller values (1-2) for faster signals, larger (3-5) for stability
Rejection Wick %: Increase (60-70%) for stronger confirmation, decrease (40-50%) for more signals

Alert Configuration
The indicator includes comprehensive alert conditions:

Buy/Sell signals (VWAP filtered)
Exit long/short notifications
Trailing stop breaks
High volume breakouts
ORB bullish/bearish breakouts

Simply create alerts using TradingView's alert menu and select the desired condition.
Visual Elements

Green/Red Lines: Trailing stop loss levels
Diamond Markers: Trend break candles
BUY/SELL Labels: Entry signals
EXIT/TP Markers: Exit points
HA Circles: Heikin Ashi reversals
ORB Boxes: Opening range highlighting
Target Lines: Profit targets with TP labels
Volume Labels: Real-time volume ratio
Background Colors: Trade zone status

Best Practices

Combine Signals: Look for alignment between SuperTrend and ORB signals for highest probability setups
Respect VWAP: The filter prevents many losing counter-trend trades - don't override it
Volume Matters: Prioritize signals with 1.5x+ volume ratio
Use Appropriate Timeframes: 5-15 minute charts for day trading, 1H-4H for swing trading
Risk Management: Always use the trailing stop - it adapts to volatility

Limitations

Like all indicators, this works best in trending conditions
Choppy, sideways markets may generate false signals
VWAP filter may cause missed opportunities in strong trends that start below/above VWAP
ORB component is designed for instruments with defined trading sessions

Credits
Original Pivot Point SuperTrend concept by tapaspattanaik, enhanced with Exit Signals, Volume Analysis, ORB integration, VWAP filtering, and Heikin Ashi reversals.

Disclaimer: This indicator is for educational purposes only. Always practice proper risk management and never risk more than you can afford to lose. Past performance does not guarantee future results.
Notas de prensa
Updated the Target & SL feature
Notas de prensa
- Updated SL & TP(Adaptive & Fixed options)
- Added ADX filter for added confidence
Notas de prensa
Minor Updates

Exención de responsabilidad

La información y las publicaciones no constituyen, ni deben considerarse como asesoramiento o recomendaciones financieras, de inversión, de trading o de otro tipo proporcionadas o respaldadas por TradingView. Más información en Condiciones de uso.