OPEN-SOURCE SCRIPT
Bollinger Bands Difference Score

Bollinger Bands Difference Score (TradingView – Pine Script v6)
The **Bollinger Bands Difference Score** is a volatility-based scoring system designed to help traders quickly assess whether a stock is in a **strong trend, neutral zone, or weak setup**. It transforms the raw **Bollinger Band Width (BB-Diff)** into a **normalized score (0–100)** and classifies conditions with intuitive thresholds.
---
### 🔹 What is Bollinger Bands Difference (BB-Diff)?
* **Bollinger Bands** are built from a moving average with upper and lower bands set by standard deviations.
* The **difference (or width)** between the bands reflects market volatility.
* A **high difference** = wide bands = strong volatility (breakout/trend).
* A **low difference** = narrow bands = low volatility (consolidation).
This indicator standardizes BB-Diff into a score and smooths it for cleaner signals.
---
### 🔹 Key Features
1. **BB-Diff Scoring System**
* Converts Bollinger Band width into a **0–100 normalized score**.
* Higher score → higher volatility/trend strength.
* Lower score → consolidation or weaker momentum.
2. **Signal Levels**
* **Strong Zone (≥ 70):** Indicates strong trend strength or expansion in volatility.
* **Neutral Zone (40–70):** Sideways or undecided price action.
* **Weak Zone (≤ 20):** Suggests very low volatility, potential upcoming squeeze.
3. **Score Smoothing**
* Applies a moving average to reduce noise.
* Helps avoid false signals during choppy markets.
4. **Visual Enhancements**
* Plots the score as a line (0–100 scale).
* Adds horizontal reference lines for **Strong**, **Neutral**, and **Weak** levels.
* Background colors automatically highlight **bullish strength (green)** or **weakness (red)**.
---
### 🔹 How to Use
* **Trend Confirmation:**
Look for scores **above 70** → suggests trend continuation or volatility breakout.
* **Consolidation Watch:**
Scores in the **20 or below** zone may precede volatility squeezes → breakout setups.
* **Neutral Zone:**
Scores between **40–70** suggest sideways price action; avoid aggressive trades.
* **Combine with Price Action:**
Use with support/resistance, candlestick patterns, or momentum indicators for confirmation.
---
### 🔹 Best Practices
* Great as a **volatility filter** before entries.
* Use in combination with **RSI, MACD, or OBV** for directional bias.
* Works well for **breakout trading** (when score rises from low levels).
* Monitor on multiple timeframes for alignment.
---
✅ **In summary:** The **Bollinger Bands Difference Score** is a simple yet powerful tool that quantifies volatility strength into an actionable score, making it easier to spot strong trends, consolidation phases, and potential breakout opportunities.
开源脚本
本着TradingView的真正精神,此脚本的创建者将其开源,以便交易者可以查看和验证其功能。向作者致敬!虽然您可以免费使用它,但请记住,重新发布代码必须遵守我们的网站规则。
免责声明
这些信息和出版物并不意味着也不构成TradingView提供或认可的金融、投资、交易或其它类型的建议或背书。请在使用条款阅读更多信息。
开源脚本
本着TradingView的真正精神,此脚本的创建者将其开源,以便交易者可以查看和验证其功能。向作者致敬!虽然您可以免费使用它,但请记住,重新发布代码必须遵守我们的网站规则。
免责声明
这些信息和出版物并不意味着也不构成TradingView提供或认可的金融、投资、交易或其它类型的建议或背书。请在使用条款阅读更多信息。