PROTECTED SOURCE SCRIPT

Phantom Trend Cloud + Bands [CLEVER]

106
“Phantom Trend Cloud + Bands [CLEVER]” indicator actually does.
You’ve got a sophisticated mash-up of trend structure, adaptive ATR-based retests, and multi-layer smoothed Bollinger bandwidths using a Nadaraya-Watson kernel regression.
Let’s walk through it in plain language.
快照 XAUUSD USDCNH BTCUSD GBPMXN USOIL
⭐ High-Level Overview

This indicator combines two major systems:

1️⃣ Phantom Trend System (Top Layer)

A trend-tracking engine that:

Uses two moving averages (MA1 and MA2) calculated on any chosen timeframe

Adds ATR-based offsets to detect retests

Identifies trend direction and trend shifts

Draws dotted support/resistance retest lines during trend continuation

Generates configurable BUY/SELL signals on retests

2️⃣ Multi-Level Smoothed Bollinger Bands (Bottom Layer)

A custom band system that:

Builds 4 total Bollinger envelopes (short, med, long, long+)

Smooths each using Nadaraya–Watson kernel regression, giving ultra-smooth curves

Fills the regions between band levels with color-coded clouds

Detects band breaks and optionally triggers notifications

Highlights breakouts with triangle markers

💠 Part 1 — Phantom Trend Engine
✔ How the trend is calculated

You choose MA type: SMA, EMA, RMA, WMA, VWMA

Two MAs are computed:

MA1 = length

MA2 = length × 2

Trend = MA1 > MA2

ATR = 200-period ATR

MA1 and MA2 are shifted up/down by ATR depending on trend, helping define structure.

✔ Retest logic

A trend continuation retest triggers when:

Price crosses back over the ATR-offset MA

No trend change

Retests spaced at least 5 bars apart

Bar is confirmed

Trend direction matches the retest type

✔ Signals

When retestUp or retestDn occur:

Draws dotted line from prior bar to current bar

Places configurable BUY/SELL shapes (user selects style)

Adds "BUY" or "SELL" labels

Trend color (user-selected) is applied to shapes

💠 Part 2 — Multi-Level Bollinger Cloud System

This section is large and powerful. Here’s what it delivers:

✔ Multiple Bands

You create 4 Bollinger layers:

First = short period

Second = medium period

Third = long period

Fourth = long period + long deviation

Each band pair gives:

Upper line (BOLU)

Lower line (BOLD)

✔ Kernel Regression Smoothing

Instead of plotting raw Bollinger bands, each is run through:

Nadaraya-Watson Gaussian smoothing
(running_nadaraya())

This gives incredibly smooth, fluid, lag-reduced bands with far fewer jagged edges.

✔ Color Theme System

Each band layer has:

Bull color

Bear color

Two shading levels for cloud fills

Creates a visually layered volatility cloud.

✔ Cloud Fills

The script fills:

Level 1 (short → medium band gaps)

Level 2 (medium → long band gaps)

These visually show:

Narrow bands = compression

Wide bands = volatility expansion

Color flips = sentiment pressure shifts

✔ Breakout Detection

The indicator identifies when price:

Breaks above the smoothed upper band

Breaks below the smoothed lower band

And optionally sends alerts.

Small triangle markers show these breakout events.

💠 Part 3 — Labels, Alerts, Plot Control

You included:

optional labels for band-break events

optional alerts

switchable plotting for bands

choice of shape style for signal markers

automated pivot source logic

logic to handle repaint vs non-repaint behavior

🎨 Overall Visualization

You end up with:

✔ Trend structure (Phantom)

Dotted S/R retest lines

Trend-colored MA backbone

BUY/SELL retest signals

✔ Bands cloud system

Multi-layer volatility cloud

Ultra-smooth kernel-filtered Bollinger envelopes

Breakout markers

The chart becomes a hybrid of:

Trend-following

Mean-reversion

Volatility structure

Smoothed breakout detection

Very similar to a fusion of:

Phantom Trend

LuxAlgo Cloud

Nadaraya-Watson Bands

Multi-Bollinger adaptive compression

📌 In short:

Your indicator is a dual-system tool that:

✔ Tracks trend direction
✔ Spots high-probability trend retests (BUY/SELL signals)
✔ Maps volatility regimes using smoothed Bollinger clouds
✔ Highlights breakouts and band exits
✔ Provides a very polished aesthetic with multiple smoothing layers

免责声明

这些信息和出版物并非旨在提供,也不构成TradingView提供或认可的任何形式的财务、投资、交易或其他类型的建议或推荐。请阅读使用条款了解更多信息。