INVITE-ONLY SCRIPT

Pro Dual Supertrend-PDS|ask2maniish

37
📘 Dual Supertrend Pro|PDS
Version: Pine Script v6 | Author: ask2maniish | Overlay: Yes
Description: Combines two Supertrend layers for high-confidence signals with advanced trade management and volatility-adjusted safety margins.

🌟 Key Features
Feature Description
Dual Supertrend Confirmation Main (conservative) + Fast (responsive) layers for high-probability entries
Trade Management System 3 Profit Targets + Dynamic Trailing Stop-Loss with auto-exit at T3
Safety Margin ATR/Percentage/Point-based buffer with volatility adjustments
Professional Visualization Trend tables, target lines, and color-coded trade markers
Comprehensive Alerts Entry/exit signals, target hits, and SL updates

⚙️ Input Parameters
🔵 Supertrend (Main)
Parameter Description Default
ATR Period (Main) ATR length for trend filtering 10
ATR Multiplier (Main) Sensitivity control 3.0
Change ATR Method? Use SMA(TR) instead of classic ATR true
Show Signals? Display buy/sell markers true
Highlighter Color-coded trend background true
🟢 Supertrend (Fast)
Parameter Description Default
ATR Period (Fast) Shorter ATR for early signals 5
ATR Multiplier (Fast) Aggressive sensitivity 1.5
Change ATR Method? Use SMA(TR) calculation true
Show Signals? Display fast layer markers true
Highlighter Highlight fast trend true

🎯 Trade Management
Parameter Description Default
ATR For SL/Target Volatility basis for risk management 21
SL/Target Multiplier Base distance multiplier 3.0
Auto Exit After T3? Close trade automatically at final target true
Show Target Labels? Mark T1/T2/T3 hits on chart true
Show Entry/Exit Marks? Label trade events true

🛡️ Safety Margin
Parameter Description Default
Enable Safety Margin Activate SL buffer true
Margin Type ATR/Percentage/Points ATR
Margin Value Buffer size (e.g., 0.5 ATR) 0.5
Dynamic Adjustment? Auto-increase in volatility true
Volatility Threshold ATR % to trigger dynamic mode 1.5%
Dynamic Factor Margin multiplier in volatility 1.5x

📊 Visuals & Tables
Parameter Description Default
Show Target Lines Plot T1/T2/T3 levels true
Show Trailing SL Display dynamic stop-loss true
Trend Layer Table Show Main/Fast trend status true
Trade State Table Real-time trade dashboard true
Table Location Bottom Right/Top Left etc. Bottom Right

🔍 Logic Overview
1. Dual Supertrend Calculation
pine
// Modified ATR Calculation
getATR(len, changeMethod) => changeMethod ? ta.atr(len) : ta.sma(ta.tr, len)

// Supertrend Logic
upBand = src - (Multiplier × ATR)
dnBand = src + (Multiplier × ATR)
trend = close > prevUpBand ? 1 : close < prevDnBand ? -1 : prevTrend
2. Trade Triggers
Condition Action
Both supertrends flip UP Long Entry
Both supertrends flip DOWN Short Entry
Price hits trailing SL or T3 Exit Trade
3. Safety Margin Adjustment
pine
safetyMargin =
useSafetyMargin ?
(safetyMarginType=="ATR" ? atrVal×safetyMarginValue :
safetyMarginType=="Percentage" ? close×(safetyMarginValue/100) :
safetyMarginValue×syminfo.mintick) : 0
4. Trailing SL Evolution
Event New SL Position
T1 Hit Entry price (breakeven)
T2 Hit Entry ± 0.5×ATR
T3 Hit Entry ± 1.5×ATR

📊 Visual Outputs
Trend Lines

Main Layer: 🟢 Green (UP) / 🔴 Red (DOWN)

Fast Layer: 🦠 Teal (UP) / 🟠 Orange (DOWN)

Signals

Buy/Sell markers for individual layers

CB (Confirmed Buy) / CS (Confirmed Sell) labels

Trade Markers

Entry: 🟩 Long / 🟥 Short

Exit: ⛔ "SL Hit" or "Exit"

Targets: ✅ T1 (Green) / T2 (Blue) / T3 (Purple)

IST Timestamps

All trade events in Indian Standard Time

🔔 Alert Conditions
Long Entry - Both supertrends confirm UP trend

Short Entry - Both supertrends confirm DOWN trend

Target 1/2/3 Hit - Profit targets achieved

Stop Loss Updated - Trailing SL moved

Long/Short Exit - Trade closed at SL or T3

⚡ Recommended Settings
Market Profile ATR Period Multiplier Use Case
Conservative 14 1.0-1.5× Balanced risk-reward
High Volatility 21 1.5-2.5× Crypto/indices
Scalping 5-10 0.5-1.0× Fast intraday trades
Swing Trading 14-21 1.5-3.0× Trend following
💡 Pro Tips
Layer Alignment - Only trade when both supertrends agree

Safety Margin - Use dynamic mode for crypto/volatile assets

Trade Management

Trail stops aggressively after T2

Enable auto-exit at T3 to lock profits

Backtesting - Test multipliers: Stocks (1-3×), Crypto (2-5×)

Note: For institutional-style exits, combine with order blocks/volume analysis

*** Disclaimer: Educational tool only. Not financial advice. Test strategies in risk-controlled environments.

Declinazione di responsabilità

Le informazioni ed i contenuti pubblicati non costituiscono in alcun modo una sollecitazione ad investire o ad operare nei mercati finanziari. Non sono inoltre fornite o supportate da TradingView. Maggiori dettagli nelle Condizioni d'uso.