OPEN-SOURCE SCRIPT

DT Bollinger Bands

Indicator Overview
Purpose: The script calculates and plots Bollinger Bands, a technical analysis tool that shows price volatility by plotting:

A central moving average (basis line).
Upper and lower bands representing price deviation from the moving average.
Additional bands for a higher deviation threshold (3 standard deviations).
Customization: Users can customize:

The length of the moving average.
The type of moving average (e.g., SMA, EMA).
The price source (e.g., close price).
Standard deviation multipliers for the bands.
Fixed Time Frame: The script can use a fixed time frame (e.g., daily) for calculations, regardless of the chart's time frame.

Key Features
Moving Average Selection:

The user can select the type of moving average for the basis line:
Simple Moving Average (SMA)
Exponential Moving Average (EMA)
Smoothed Moving Average (SMMA/RMA)
Weighted Moving Average (WMA)
Volume Weighted Moving Average (VWMA)
Standard Deviation Multipliers:

Two multipliers are used:
Standard (default = 2.0): For the original Bollinger Bands.
Larger (default = 3.0): For additional bands.
Bands Calculation:

Basis Line: The selected moving average.
Upper Band: Basis + Standard Deviation.
Lower Band: Basis - Standard Deviation.
Additional Bands: Representing ±3 Standard Deviations.
Plots:

Plots the basis, upper, and lower bands.
Fills the area between the bands for visual clarity.
Plots and fills additional bands for ±3 Standard Deviations with lighter colors.
Alerts:

Generates an alert when the price enters the range between the 2nd and 3rd standard deviation bands.
The alert can be used to notify when price volatility increases significantly.
Background Highlighting:

Colors the chart background based on alert conditions:
Green if the price is above the basis line.
Red if the price is below the basis line.
Offset:

Adds an optional horizontal offset to the plots for fine-tuning their alignment.
How It Works
Input Parameters:

The user specifies settings such as moving average type, length, multipliers, and fixed time frame.
Calculations:

The script computes the basis (moving average) and standard deviations on the fixed time frame.
Bands are calculated using the basis and multipliers.
Plotting:

The basis line and upper/lower bands are plotted with distinct colors.
Additional 3 StdDev bands are plotted with lighter colors.
Alerts:

An alert condition is created when the price moves between the 2nd and 3rd standard deviation bands.
Visual Enhancements:

Chart background changes color dynamically based on the price’s position relative to the basis line and alert conditions.

Usage
This script is useful for traders who:

Want a detailed visualization of price volatility.
Use Bollinger Bands to identify breakout or mean-reversion trading opportunities.
Need alerts when the price enters specific volatility thresholds.
Bollinger Bands (BB)

오픈 소스 스크립트

진정한 TradingView 정신에 따라, 이 스크립트의 저자는 트레이더들이 이해하고 검증할 수 있도록 오픈 소스로 공개했습니다. 저자에게 박수를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 출판물에서 이 코드를 재사용하는 것은 하우스 룰에 의해 관리됩니다. 님은 즐겨찾기로 이 스크립트를 차트에서 쓸 수 있습니다.

차트에 이 스크립트를 사용하시겠습니까?

면책사항