OPEN-SOURCE SCRIPT
MTF Bollinger Bands Trend Stop

Overview:
The "MTF Bollinger Bands Trend Stop" is an overlay indicator that uses multi-timeframe (MTF) Bollinger Bands to identify trends and provide dynamic stop levels. It helps traders follow trends and spot potential reversals by plotting a trend-following stop line and marking key breakout points on the chart.
Key Features:
Multi-Timeframe Analysis: Calculates Bollinger Bands on a user-defined higher timeframe (e.g., 1H, 4H) while overlaying them on your current chart.
Trend Detection: Determines trend direction (up or down) based on price crossing the upper or lower Bollinger Bands.
Dynamic Stop Line: Plots a stop level that adjusts with the trend, using a buffer based on a "Money Risk" factor.
Reversal Signals: Highlights trend changes with coloured circles when price crosses the buffered bands.
How It Works:
Inputs:
Resolution: Choose the timeframe for calculations (e.g., "60" for 1-hour).
Period (20): Length of the moving average for Bollinger Bands.
Standard Deviation (2): Width of the bands.
Money Risk (1.0): Adjusts the buffer size around the bands (higher values widen the buffer).
Calculations:
Computes Bollinger Bands (middle, upper, lower) on the selected timeframe.
Trend is set to +1 (up) if price crosses above the upper band, or -1 (down) if below the lower band.
Bands are adjusted to prevent retracing against the trend, and a buffer is added based on Money Risk.
Output:
Stop Line: A cross-style line shows the stop level—blue (uptrend, lower band) or purple (downtrend, upper band).
Trend Change Signals: Blue circles mark uptrend starts (price crosses above upper band), purple circles mark downtrend starts (price crosses below lower band).
How to Use:
Add the indicator to your chart and set the desired timeframe (e.g., "240" for 4H).
Watch the stop line: In an uptrend, it tracks below price as a trailing stop; in a downtrend, it sits above price.
Look for circles to signal potential trend shifts—blue for bullish, purple for bearish.
Adjust "Money Risk" to widen/tighten the stop buffer based on your risk tolerance.
Practical Application:
Use as a trailing stop to lock in profits during strong trends.
Combine with other indicators to confirm reversals signalled by the circles.
Best suited for trending markets; test on your preferred timeframe and asset.
The "MTF Bollinger Bands Trend Stop" is an overlay indicator that uses multi-timeframe (MTF) Bollinger Bands to identify trends and provide dynamic stop levels. It helps traders follow trends and spot potential reversals by plotting a trend-following stop line and marking key breakout points on the chart.
Key Features:
Multi-Timeframe Analysis: Calculates Bollinger Bands on a user-defined higher timeframe (e.g., 1H, 4H) while overlaying them on your current chart.
Trend Detection: Determines trend direction (up or down) based on price crossing the upper or lower Bollinger Bands.
Dynamic Stop Line: Plots a stop level that adjusts with the trend, using a buffer based on a "Money Risk" factor.
Reversal Signals: Highlights trend changes with coloured circles when price crosses the buffered bands.
How It Works:
Inputs:
Resolution: Choose the timeframe for calculations (e.g., "60" for 1-hour).
Period (20): Length of the moving average for Bollinger Bands.
Standard Deviation (2): Width of the bands.
Money Risk (1.0): Adjusts the buffer size around the bands (higher values widen the buffer).
Calculations:
Computes Bollinger Bands (middle, upper, lower) on the selected timeframe.
Trend is set to +1 (up) if price crosses above the upper band, or -1 (down) if below the lower band.
Bands are adjusted to prevent retracing against the trend, and a buffer is added based on Money Risk.
Output:
Stop Line: A cross-style line shows the stop level—blue (uptrend, lower band) or purple (downtrend, upper band).
Trend Change Signals: Blue circles mark uptrend starts (price crosses above upper band), purple circles mark downtrend starts (price crosses below lower band).
How to Use:
Add the indicator to your chart and set the desired timeframe (e.g., "240" for 4H).
Watch the stop line: In an uptrend, it tracks below price as a trailing stop; in a downtrend, it sits above price.
Look for circles to signal potential trend shifts—blue for bullish, purple for bearish.
Adjust "Money Risk" to widen/tighten the stop buffer based on your risk tolerance.
Practical Application:
Use as a trailing stop to lock in profits during strong trends.
Combine with other indicators to confirm reversals signalled by the circles.
Best suited for trending markets; test on your preferred timeframe and asset.
开源脚本
本着TradingView的真正精神,此脚本的创建者将其开源,以便交易者可以查看和验证其功能。向作者致敬!虽然您可以免费使用它,但请记住,重新发布代码必须遵守我们的网站规则。
免责声明
这些信息和出版物并不意味着也不构成TradingView提供或认可的金融、投资、交易或其它类型的建议或背书。请在使用条款阅读更多信息。
开源脚本
本着TradingView的真正精神,此脚本的创建者将其开源,以便交易者可以查看和验证其功能。向作者致敬!虽然您可以免费使用它,但请记住,重新发布代码必须遵守我们的网站规则。
免责声明
这些信息和出版物并不意味着也不构成TradingView提供或认可的金融、投资、交易或其它类型的建议或背书。请在使用条款阅读更多信息。