Middle Band (Basis): Calculated using a Simple Moving Average (SMA) over a user-defined period. Upper Band: The middle band plus the standard deviation of the price multiplied by a user-defined multiplier. Lower Band: The middle band minus the standard deviation of the price multiplied by the same multiplier. User Inputs:
Length: The number of periods used for the SMA and standard deviation (default: 20). Deviation: The multiplier for the standard deviation to calculate the upper and lower bands (default: 2.0). Buy and Sell Signals:
Buy Signal: Generated when the price crosses above the lower band, indicating a potential oversold condition. Sell Signal: Generated when the price crosses below the upper band, indicating a potential overbought condition. Visual Markers:
Buy Signals: Displayed below the price bars as green labels with the text "BUY." Sell Signals: Displayed above the price bars as red labels with the text "SELL." The Bollinger Bands (upper, middle, and lower) are plotted directly on the price chart for easy visualization. How to Use the Script: Customize Parameters:
Modify the length and deviation inputs to adapt to different market conditions or timeframes. Interpret Signals:
A BUY signal indicates a possible reversal or upward movement from the lower band. A SELL signal suggests a potential price decline from the upper band. Combine with Other Indicators:
While effective in certain conditions, this strategy performs better when combined with other technical tools, such as RSI or MACD, to confirm trends and avoid false signals. Limitations: This script assumes that price will revert to the mean, which may not hold during strong trends or highly volatile conditions. It is not a standalone trading system and should be backtested and optimized before applying to real trading.
نص برمجي مفتوح المصدر
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
For quick access on a chart, add this script to your favorites — learn more here.
لا يُقصد بالمعلومات والمنشورات أن تكون، أو تشكل، أي نصيحة مالية أو استثمارية أو تجارية أو أنواع أخرى من النصائح أو التوصيات المقدمة أو المعتمدة من TradingView. اقرأ المزيد في شروط الاستخدام.
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
For quick access on a chart, add this script to your favorites — learn more here.
لا يُقصد بالمعلومات والمنشورات أن تكون، أو تشكل، أي نصيحة مالية أو استثمارية أو تجارية أو أنواع أخرى من النصائح أو التوصيات المقدمة أو المعتمدة من TradingView. اقرأ المزيد في شروط الاستخدام.