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.
Skrip sumber terbuka
Dalam semangat sebenar TradingView, pencipta skrip ini telah menjadikannya sumber terbuka supaya pedagang dapat menilai dan mengesahkan kefungsiannya. Terima kasih kepada penulis! Walaupun anda boleh menggunakannya secara percuma, ingat bahawa menerbitkan semula kod ini adalah tertakluk kepada Peraturan Dalaman kami.
Penafian
Maklumat dan penerbitan adalah tidak dimaksudkan untuk menjadi, dan tidak membentuk, nasihat untuk kewangan, pelaburan, perdagangan dan jenis-jenis lain atau cadangan yang dibekalkan atau disahkan oleh TradingView. Baca dengan lebih lanjut di Terma Penggunaan.
Skrip sumber terbuka
Dalam semangat sebenar TradingView, pencipta skrip ini telah menjadikannya sumber terbuka supaya pedagang dapat menilai dan mengesahkan kefungsiannya. Terima kasih kepada penulis! Walaupun anda boleh menggunakannya secara percuma, ingat bahawa menerbitkan semula kod ini adalah tertakluk kepada Peraturan Dalaman kami.
Penafian
Maklumat dan penerbitan adalah tidak dimaksudkan untuk menjadi, dan tidak membentuk, nasihat untuk kewangan, pelaburan, perdagangan dan jenis-jenis lain atau cadangan yang dibekalkan atau disahkan oleh TradingView. Baca dengan lebih lanjut di Terma Penggunaan.