This TradingView script calculates and visualizes the Normalized Bollinger Band Distance to analyze the relative spread of Bollinger Bands as a percentage of the moving average. It also determines thresholds based on global statistics to highlight unusual market conditions. Here's a detailed description:
Indicator Overview Purpose: The indicator measures the normalized distance between the upper and lower Bollinger Bands relative to the Simple Moving Average (SMA). It helps identify periods of high or low volatility. Visualization: Displays the normalized distance along with dynamic thresholds based on global statistical calculations (mean and standard deviation). Inputs Length (length): Defines the period for the SMA and Bollinger Bands calculation. Default is 200. Standard Deviations (stdDev): Number of standard deviations for the Bollinger Bands. Default is 2. Calculation Bollinger Bands:
Upper Band: SMA + ( Standard Deviation × stdDev ) SMA+(Standard Deviation×stdDev) Lower Band: SMA − ( Standard Deviation × stdDev ) SMA−(Standard Deviation×stdDev) Normalized Distance:
Normalized Distance = Upper Band − Lower Band SMA Normalized Distance= SMA Upper Band−Lower Band
Global Statistics:
Global Mean ( 𝜇 μ): Average of all normalized distances up to the current bar. Global Standard Deviation ( 𝜎 σ): Standard deviation of all normalized distances up to the current bar. High Threshold: 𝜇 + 1.5 × 𝜎 μ+1.5×σ Low Threshold: 𝜇 − 1.5 × 𝜎 μ−1.5×σ Visualization Normalized Distance Plot: The normalized distance is plotted in blue as a percentage for easy interpretation. Threshold Lines: High Threshold: Red line to signal unusually high volatility. Low Threshold: Green line to signal unusually low volatility. Mean Line: White line indicating the average normalized distance. Zero Line: Horizontal white line for reference. Use Case High Threshold Breach: Indicates an unusual increase in Bollinger Band width relative to the SMA, signaling potential high market volatility. Low Threshold Breach: Indicates an unusual narrowing of Bollinger Band width, suggesting low volatility and potential consolidation. Trend Analysis: Observe how the normalized distance evolves over time to anticipate market conditions.
قام مؤلف هذا النص البرمجي بنشره وجعله مفتوح المصدر، بحيث يمكن للمتداولين فهمه والتحقق منه، وهو الأمر الذي يدخل ضمن قيم TradingView. تحياتنا للمؤلف! يمكنك استخدامه مجانًا، ولكن إعادة استخدام هذا الرمز في المنشور يخضع لقواعدقوانين الموقع. يمكنك جعله مفضلاً لاستخدامه على الرسم البياني.
هل تريد استخدام هذا النص البرمجي على الرسم البياني؟
لا يُقصد بالمعلومات والمنشورات أن تكون، أو تشكل، أي نصيحة مالية أو استثمارية أو تجارية أو أنواع أخرى من النصائح أو التوصيات المقدمة أو المعتمدة من TradingView. اقرأ المزيد في شروط الاستخدام.