PROTECTED SOURCE SCRIPT

STC Overlay by WHS

170
STC Overlay by WHS (SuperTrend Channel Overlay)

This indicator is a Pine Script v6 implementation of the SuperTrend Channel (v1.42) originally featured on the NanoTrader platform. Unlike the standard SuperTrend, this script expands trailing stop mechanics by introducing dynamic neckline tracking and forming an asymmetric trend channel directly overlaid on the price chart.

Key Features & How It Works
Trailing Stop Ratchet: The trailing stop ratchets up during uptrends (or down during downtrends) based on Average True Range (ATR), dynamically adapting to market volatility.

Neckline Tracking: Tracks and locks the highest high reached during an uptrend (or the lowest low during a downtrend) to form the outer channel boundary.

Dynamic Middle Line: Calculates the mid-point between the active trailing stop and the neckline , providing a clear reference level for pullbacks and profit-taking.

Asymmetric Channel Fill: Color-codes the area between the stop level and the neckline to immediately reveal trend strength and structure.

Live Info Box (Dashboard): A compact table centered at the bottom displays real-time key metrics: trend state (UP/DOWN), exact price values for Stop, Neckline, and Middle Line, alongside the current ATR value.

Signal Logic
BUY Signal: Triggered on a confirmed bar close above the bearish trailing stop. The sentiment flips to Long, displaying a green BUY label and an optional highlighted signal bar.

SELL Signal: Triggered on a confirmed bar close below the bullish trailing stop. The sentiment flips to Short, displaying a red SELL label.

Settings & Inputs
SuperTrend Channel Settings:

ATR Period (Span): Lookback period for ATR volatility calculation (Default: 10).

ATR Factor: Distance multiplier applied to the ATR for stop placement (Default: 3.0).

Visual Settings:

Show Channel Fill: Toggles the shaded channel background.

Show BUY/SELL Labels: Toggles price chart text labels on trend changes.

Show Middle Line / Neckline: Toggles individual channel boundaries.

Show Info Box: Toggles the live metrics table at the bottom center.

Alerts
Includes built-in alert conditions for push notifications or automated execution:

STC — BUY: Triggers on a new Long trend reversal.

STC — SELL: Triggers on a new Short trend reversal.

STC — Any Signal: Triggers on any trend direction shift (BUY or SELL).

คำจำกัดสิทธิ์ความรับผิดชอบ

ข้อมูลและบทความไม่ได้มีวัตถุประสงค์เพื่อก่อให้เกิดกิจกรรมทางการเงิน, การลงทุน, การซื้อขาย, ข้อเสนอแนะ หรือคำแนะนำประเภทอื่น ๆ ที่ให้หรือรับรองโดย TradingView อ่านเพิ่มเติมใน ข้อกำหนดการใช้งาน